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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X