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 cmoran13, 04-16-2026, 01:02 PM
            0 responses
            51 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            31 views
            0 likes
            Last Post PaulMohn  
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            165 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            100 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            160 views
            2 likes
            Last Post CaptainJack  
            Working...
            X