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 TraderG23, 12-08-2023, 07:56 AM
      9 responses
      382 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      1 view
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Working...
      X