Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose qestion

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

    CalculateOnBarClose qestion

    Hi,

    Am I correct assuming that if I use:
    Code:
    CalculateOnBarClose = true;
    a Low[0] refers to the bar that is in the process of being closed, and it is still the last bar on the chart? Further, can I assume that entry placed at that point will get filled (almost) immediately e.g. first tick of the next bar? (Talking back testing of course)

    If so, is there a way to access the OnBarClose event for processing when
    CalculateOnBarClose is set to false?

    The reason I am asking for this is that I need to do some calculation intra bar, but using FirstTickOfBar comes too late to get the order in immediately, if my conditions are met on the bar that just ended, and I have to wait for the next bar to get an order filled. Almost always that is too late and simply too far out to be considered accurate.

    So, could I have it both ways? Process tick by tick, but get a chance to evaluate the bar at its close and place an "immediate" order before the next bar starts?

    Hope this makes sense...

    Roman
    Last edited by Roman; 01-30-2009, 01:38 AM.

    #2
    With it set to true: Low[0] references the last bar updated. This happens at the close of the bar. The close of a bar is determined by the first tick of a new bar so technically speaking you are not at the right most of the chart when you call it. Since placing an order on a closed bar can't possibly execute there, you will execute at the first tick of the new bar.

    If set to false: everything goes tick by tick. This does not have influence on backtesting. In backtesting, you can only evaluate at bar close and execute at open of new bar. In real-time you can process tick by tick and submit whenever you want.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh,

      That explains things a bit...

      Cheers,

      Roman

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      656 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X