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 pkefal, 04-11-2024, 07:39 AM
          11 responses
          36 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Yesterday, 08:51 AM
          8 responses
          43 views
          0 likes
          Last Post bill2023  
          Started by yertle, Today, 08:38 AM
          6 responses
          25 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          24 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X