Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Correct Setting for calling yesturday close

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

    Correct Setting for calling yesturday close

    I'm using the following code to call the close of the previous day. The period im calling is a daily bar saved as bar array 2 and the primary data is intraday 1 minute. I have set the number of bars back to [0] believing that the last daily bar is yesturdays bar until the current intraday sesison ends. Is this correct? Or should I have been using [1]? Is there any difference when backtesting v live trading?

    Thanks

    Mark

    && GetCurrentAsk() < (Closes[2][0] + (ATR(BarsArray[2], 8)[0]))

    #2
    Mark, the easiest way to get yesterday's close would be to use the PriorDayOHLC indicator and just call the plot of yesterday's close.
    Code:
    double prevClose = PriorDayOHLC().PriorClose[0];
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    630 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    565 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X