Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart data is not the same as in Print(...)

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

    #16
    OK, AGAIN, I need to get current trade day open price and previous trade day prices (high/low/close).
    I do it like this: (in OnBarUpdate() when (Bars.FirstBarOfSession) is true):
    CurrentDayOHL().CurrentOpen[0]
    Bars.GetDayBar(1).Low, etc.

    During backtest I use template "CME US Index Futures RTH". Data I get DOES NOT correspond to data box from the chart of daily prices with the SAME template "CME US Index Futures RTH".
    Why? What am I doing wrong?

    Comment


      #17
      I use DAILY (i.e. interval = 1 day) chart with template "CME US Index Futures RTH". It shows 1483.50 open on 1/21/2013 in databox - not what you get. Why?

      Comment


        #18
        Hello MarkZ,
        If you try adding a day bar series and then refer to that price series then are you getting the correct values.

        //in Initialize section of the code
        Code:
        Add(PeriodType.Day, 1);
        //in OnBarUpdate
        Code:
        if (BarsInProgress == 0)
        {
         Print(Time[0].Date.ToString("d") + " " + CurrentDayOHL().CurrentOpen[0] + " " +
        Lows[1][1] + " " + Hghs[1][1]);
        }
        Please refer to our help guide to know more about it
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X