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

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 -

    BertrandNinjaTrader Customer Service

    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.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Great, thanks again for your fast assistance!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by funk10101, Today, 12:02 AM
            0 responses
            3 views
            0 likes
            Last Post funk10101  
            Started by gravdigaz6, Yesterday, 11:40 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by MarianApalaghiei, Yesterday, 10:49 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by XXtrader, Yesterday, 11:30 PM
            0 responses
            4 views
            0 likes
            Last Post XXtrader  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            28 views
            0 likes
            Last Post love2code2trade  
            Working...
            X