Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossAbove / CrossBelow Clarification for MultiTimeframe

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

    CrossAbove / CrossBelow Clarification for MultiTimeframe

    Hello,

    I have a MultiTimeframe strategy, and a condition for CrossAbove / Below.
    Does the "look back period (I have 10 in my case)" applies to the BarsArray bars of the indicator (5 minutes in my case), or the BarsInProgress bars, (1 Tick in my case)?

    (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Minute, 5);
    AddDataSeries(Data.BarsPeriodType.Tick, 1);

    }
    else if (State == State.DataLoaded)
    {
    RSI1 = RSI(BarsArray[2], 14, 3);
    }

    protected override void OnBarUpdate()

    (CurrentBars[0] < 15) || (CurrentBars[1] < 15) || (CurrentBars[2] < 15 && (State == State.Historical))
    return;

    if (BarsInProgress == 2)
    {
    if CrossAbove(RSI1.Default, 70 , 10)

    {
    do something
    }
    }
    Thank you!

    #2
    Sorry I meant:

    (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Minute, 5);
    AddDataSeries(Data.BarsPeriodType.Tick, 1);

    }
    else if (State == State.DataLoaded)
    {
    RSI1 = RSI(BarsArray[1], 14, 3);
    }

    protected override void OnBarUpdate()

    (CurrentBars[0] < 15) || (CurrentBars[1] < 15) || (CurrentBars[2] < 15 && (State == State.Historical))
    return;

    if (BarsInProgress == 2)
    {
    if CrossAbove(RSI1.Default, 70 , 10)

    {
    do something
    }
    }

    Comment


      #3
      Hello YakusaTrader,

      Thank you for your post.

      As written, the lookback period would apply to your 5 minute bars as those would be held in BarsArray[1] used in calculating RSI1.

      Here is a link to further info on the AddDataSeries() method:


      Please let us know if we may be of further assistance to you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X