Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is adding a secondary timeseries as meta criteria possible?

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

    Is adding a secondary timeseries as meta criteria possible?

    My idea is to produce a set of criterias where the general market conditions (say criteria of S&P) would used as a meta criteria and checked first and if that is passed then calculate the results of the actually analyzed instrument (like AAPL).

    A rough example of my thinking

    if
    50 day SMA of S&P is rising
    calculate 10 day SMA AAPL + ATR
    else if
    50 day SMA of S&P is sinking
    calculate 10 day SMA AAPL - ATR
    else
    calculate 10 day SMA AAPL

    My main question is: If possible how should I formulate the parts:
    50 day SMA of S&P is rising
    and
    50 day SMA of S&P is sinking

    should I perhaps use the DataSeries Class?

    A practical code snippet would be much appreciated!

    #2
    Hi Mickey, you would use the Add() method to add the needed instruments / series to your scripts in the Initialize() section. A practical working code example showing this is preinstalled with NinjaTrader and it's called 'SampleMultiInstrument'. To review the MultiSeries framework documentation with further examples please check into this link here from our helpguide - http://www.ninjatrader.com/support/h...nstruments.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    41 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
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X