Announcement

Collapse
No announcement yet.

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