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 cmoran13, Yesterday, 01:02 PM
    0 responses
    27 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    18 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X