Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars used in Multi-Time frame

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

    Bars used in Multi-Time frame

    I have a strategy that is run on a 10 minute chart. I am trying to use an indicator on a 2 minute basis, on the 10 min chart. All works well with Add() 2 min bars object and BarsInProgress ==0 except:

    If I use the MIN function to confirm that the MIN value of an indicator on a 2Min basis is less then a certain value for x periods, the software uses the 10 minute periods rather then the 2 minute periods.

    Here is the code:

    // Conservative go long condition. 10Min RSI 0.50 or above, 2Min R+R swing low
    if (BarsInProgress == 0)
    {
    if (DmRSI(Period)[0] > 0.48
    && DmREIplusRSI(BarsArray[1], 8)[0] > DmREIplusRSI(BarsArray[1], 8)[1]
    && DmREIplusRSI(BarsArray[1], 8)[1] < DmREIplusRSI(BarsArray[1], 8)[2]
    && MIN(DmREIplusRSI(BarsArray[1], 8),3)[0] < 35.0)
    {
    DrawArrowUp("GoLong1" + CurrentBar, true, 1, Low[0] + -5 * TickSize, Color.Gold);
    }
    }

    See the MIN(DmREIplusRSI(BarsArray[1], 8),3)[0], the calculation is done using the 10 minute bars rather then the 2 minute bars.

    What do I need to code to make it use the 2 minute bars here? This condition has to include both 10 minute and 2 minute statements.

    Thanks

    #2
    Hello gDavis,

    Thank you for your note.

    How do you know the MIN is only working for the 10 minute bars? Have you printed out the values and compared them on the chart?

    The current setup is taking the MIN value of the last three bars for the DataSeries input that you are passing through it, which is an Indicator using the 2 Minute Bars.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    57 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X