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

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.

      Kate W.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,222 views
      0 likes
      Last Post xiinteractive  
      Started by andrewtrades, Today, 04:57 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      7 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      438 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      10 views
      0 likes
      Last Post FAQtrader  
      Working...
      X