Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,606 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    6 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    15 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X