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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X