• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose = false

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    CalculateOnBarClose = false

    I have set CalculateOnBarClose = false within the strategy code
    yet when I run the strategy the entry signals are not being generated until the start of the next bar.
    Is there anything else which could be impacting this?

    #2
    fiddy, and when you check the UI parameters of the running strategy, it's still set to false correct?

    Do you have any logic in FirstTickOfBar?

    What indicator do you call in your script? Any custom ones that might have the COBC setting explicitly set in their own Initialize() as well?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      In the UI I cannot see a CalculateonBarClose Option
      Below is the code I have so far, which is waiting to the next bar
      Should I be using something other than CLOSE[0]

      protectedoverridevoid Initialize()
      {
      ExitOnClose =
      true;
      CalculateOnBarClose =
      false;
      DefaultQuantity =
      100;
      }
      ///<summary>
      /// Called on each bar update event (incoming tick)
      ///</summary>
      protectedoverridevoid OnBarUpdate()
      {
      if (Bars.FirstBarOfSession)
      {
      LowSupport = PriorDayOHLC().PriorLow[
      0];
      HighResistance = PriorDayOHLC().PriorHigh[
      0];
      }

      // Condition set 1
      if (CurrentDayOHL().CurrentOpen[0] < LowSupport
      && Close[
      0] > LowSupport)
      {
      EnterLong(DefaultQuantity,
      "");

      Comment


        #4
        fiddy, if you don't see the UI option for CalculateOnBarClose - are you in the backtesting engine then as this is seen? Here there would be no option to work on any other CalculateOnBarClose then true, as per default the intrabar formation of the bars would not be known.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand,

          Apologies I do not follow what you have explained.
          I am in the strategy analyser and in the toolbar that appears on right, there is no CalculateOnBarClose field.

          Comment


            #6
            Correct, in backtesting there would be no option to set CalculateOnBarClose to false, thus it would be true all the times as historical data is processed. Even if you set this in your code, the processing for that part of the data is still CalculateOnBarClose == true.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks for the reply. Is there anything I can do then in back testing to enable me to test when setting is false.

              Comment


                #8
                You could look into simulating those conditions on a lower timeframe series thus to be able to look inside that bigger timeframe bar. For order submission and fills, you can send them as well to a finer series - we have a reference sample to demonstrate this technique - http://www.ninjatrader.com/support/f...ead.php?t=6652
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by tonynt, Today, 01:42 AM
                0 responses
                6 views
                0 likes
                Last Post tonynt
                by tonynt
                 
                Started by NT-Roland, Yesterday, 04:36 PM
                0 responses
                3 views
                0 likes
                Last Post NT-Roland  
                Started by Newtrader101, Yesterday, 03:40 PM
                2 responses
                11 views
                0 likes
                Last Post Newtrader101  
                Started by Branpo, Yesterday, 02:58 PM
                2 responses
                12 views
                0 likes
                Last Post Branpo
                by Branpo
                 
                Started by sdauteuil, Yesterday, 02:09 PM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X