Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateonBarClose question

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

    CalculateonBarClose question

    I'm trying to troubleshoot a situation where my live strategy delayed entry by a full bar and would like some clarification on my understanding if I may..

    On a strategy with CalculateOnBarClose = true;

    1) OnBarUpdate is run after the close price of the bar is generated so any entry/exit orders will be shown on the following bar soon after (allowing for fill timing)

    2) The minimum lookback period for CrossAbove is 1 and this value would represent the bar just closed (currentbar) before the OnBarUpdate is run?

    3) For indicators with the "BarsAgo" variable, [0] would also represent the currentbar after it was closed and just before OnBarUpdateis run?

    4) If I was using DM(DMValue).DiPlus and DM(DMValue).DiMinus for the CrossAbove calculation, would it use 2 or more decimal places for the comparison?


    Thanks

    #2
    jmtoll, your understand is correct - it will take one bar for the CrossAbove / CrossBelow to trigger with CalculateOnBarClose = true - the comparison can have up to double precision, but will limited by the instrument's ticksize rouding applied.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X