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

Indicator using multiple instruments/timeframes

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

    Indicator using multiple instruments/timeframes

    Hi there,

    I want to write an indicator which requires access to a couple instruments/timeframes.

    Can this be done in a class derived from Indicator ?

    Thanks in advance
    Dominique

    #2
    Originally posted by dom993 View Post
    Hi there,

    I want to write an indicator which requires access to a couple instruments/timeframes.

    Can this be done in a class derived from Indicator ?

    Thanks in advance
    Dominique
    Yes

    Comment


      #3
      Thank you Sledge. Although I have several multi-instrument strategies, I didn't realize the same technique could be used in an Indicator.

      Now, to refine the initial question ... when I use an indicator from within a strategy, the strategy decides which instrument/timeframe (BarsArray) is to be used by the indicator as primary timeframe ... is it possible for the strategy to also provide the indicator with the secondary timeframe to be used, instead of the indicator having to find that on its own? (I suppose I can pass the instrument / PeriodType & period value as indicator parameters, but is there a way to pass a BarsArray to be used as secondary timeframe more directly ?)

      Thanks in advance
      Dominique

      Comment


        #4
        Originally posted by dom993 View Post
        Thank you Sledge. Although I have several multi-instrument strategies, I didn't realize the same technique could be used in an Indicator.

        Now, to refine the initial question ... when I use an indicator from within a strategy, the strategy decides which instrument/timeframe (BarsArray) is to be used by the indicator as primary timeframe ... is it possible for the strategy to also provide the indicator with the secondary timeframe to be used, instead of the indicator having to find that on its own? (I suppose I can pass the instrument / PeriodType & period value as indicator parameters, but is there a way to pass a BarsArray to be used as secondary timeframe more directly ?)

        Thanks in advance
        Dominique

        If I'm understanding...

        Isn't this the same as adding an EMA/SMA of 5/10/30/60 minutes to your strategy?

        Or adding 5/10/30/60 minutes and having EMA/SMA compute those, and your strategy can decide which to use?..



        Now if you want to start doing infinite possibilities of 1-1,000,000 of EMA, then you will hit performance issues for sure.

        Comment


          #5
          Although this is not the exact/final use of it, let's say I am building an indicator to compute a price ratio between 2 instruments (in a way that requires access to both instrument OHLCVT series).

          The strategy choose which is instrument #1, and which is instrument #2. Since the strategy already has BarArrays for each instrument, it would be nice to call the indicator providing both BarArrays.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X