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 Hwop38, 05-04-2026, 07:02 PM
            0 responses
            164 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            317 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            245 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            179 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Working...
            X