Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Different values multi-instrument

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

    Different values multi-instrument

    Hello

    I added a specific data series on my strategy Initialize().
    I also added a chart with the same data series and placed ADX indicator on it(High, 4,3).

    From my strategy i printed the SRI value:
    PrintWithTimeStamp(RSI(Highs[1], 4, 3)[0].ToString());

    The values from the print and from the chart aren't the same (i use market replay, CalculateOnBarClose = false on the indicator and strategy).

    Needed to be said that printing seris 0 works well (PrintWithTimeStamp(RSI(Highs[0], 4, 3)[0].ToString())

    Why is that?

    Thanks
    Last edited by kiss987; 09-28-2012, 03:41 PM.

    #2
    Hello kiss987,

    Could you post some of the code that you are using Add() the instrument and OnBarUpdate? Also what instrument and period is your Primary Data series?

    http://www.ninjatrader.com/support/h...nstruments.htm

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi

      The code is:
      Init:
      Add(Instrument.ToString(), PeriodType.Range, 60, MarketDataType.Last);

      BarUpdate:
      PrintWithTimeStamp(BarsInProgress + " " + RSI(Highs[0], 4, 3)[0].ToString() + " " + RSI(Highs[1], 4, 3)[0].ToString() + " " + Highs[BarsInProgress][0]);

      Comment


        #4
        Hello kiss987,

        To start we do not recommend, using a Dynamic Add() method as it can cause some unexpected results. With that said, since you are using a vary large range value I would make sure that your Data Series objects are in sync with each other. You can see the following forum post on synchronizing Data Series objects on a second time frame.
        http://www.ninjatrader.com/support/f...ead.php?t=3572

        Also I would make sure that if you are using MarketDataType.Last that the primary data series is using the last as well to make sure that they are referencing the same object and price.
        http://www.ninjatrader.com/support/h...marketdata.htm

        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        55 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 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