Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Referencing indicator values of same contract different timeframe

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

    Referencing indicator values of same contract different timeframe

    Hello,

    I am writing an indicator that is run on a 1-min chart.

    I would like to access the Swing indicator values on the 5-min chart of the same contract.

    For example, in
    Swing(IDataSeries input, int strength).SwingHigh[int barsAgo] or
    Swing(IDataSeries input, int strength).SwingLow[int barsAgo],

    how do I set the input series to be the 5-min series of the same contract even though my indicator is running on the 1-min chart?

    Thanks.

    #2
    wintermelon, you would Add() in the needed 5 minute series - http://www.ninjatrader.com/support/h...ghlightsub=Add

    And then call your Swing indicator on the respective BarsArray instead -

    Comment


      #3
      That's exactly what I needed. Thanks Bertrand!

      Comment


        #4
        Hi Bertrand,

        On a related question. When I call the Swing indicator function in my custom indicator, if my custom indicator has CalculateOnBarClose = false in the initialize function, does that mean that the Swing indicator will 'inherit' that setting?

        or will the Swing indicator still default to COBC = true? If so, how do I programmatically make it COBC = false?

        Comment


          #5
          Yes, the Swing indicator you call does not have anything coded in for CalculateOnBarClose, so would take the UI setting. If you call in a script then with CalculateOnBarClose = false context it would use that as well.

          Comment


            #6
            Great, thanks again for your fast assistance!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X