Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-timeframe indicator referencing

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

    Multi-timeframe indicator referencing

    Hello,
    i am trying to build a multi-time frame strategy processing in real-time with setting
    'CalculateOnBarClose = false'

    The primary bars are 10min while secondary bars object is Add(PeriodType.Tick, 10);

    My question is the following:
    If I would like to initiate something on the secondary bars object with condition examined on the primary bars, can I reference the MACD on the primary bar to trigger conditional action on the secondary bar with...

    if( MACD(BarsArray[0],8, 21, 10).Diff[0]) > 0 )
    {
    if(Highs[1][0] > Highs[1][1])
    {
    EnterLong("","")
    }
    }

    ...or the 'if (BarsInProgress == 0)' and 'if (BarsInProgress == 1)' conditions are necessary to reference the correct bars object?

    Thank you

    #2
    Hi LazKz, welcome to the NinjaTrader support forums! Both methods are fine - either use the BarsArray and point to the correct bars object with the index value or call the methods in reference to the BarsInProgress and which bars object is calling the OnBarUpdate().

    Comment


      #3
      Thanks Bertrand,

      There is one thing I am still not sure of. When checking which bars object is calling the OnBarUpdate() method with the following code

      if (BarsInProgress == 1)
      {
      MACD(8, 21, 10).Diff[0] > 0
      }

      the MACD().Diff[0] without the BarsArray[1] defining the Inputdata would it refer to the secondary Bars object or to the primary bars object?

      Comment


        #4
        When in BIP=1, a regular call would refer to the secondary bar object.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 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