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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X