Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need help with multiple data series

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

    Need help with multiple data series

    I have these two data series as my strategy is based on 15 min candles, but I want to enter trade based on at any point the criteria is met within a candle.

    Code:
    AddDataSeries(BarsPeriodType.Minute, 15); // Primary series with 15-minute bars
    AddDataSeries(BarsPeriodType.Tick, 1); // Secondary series with tick bars
    I have a few questions:

    1) When i do current bar check, should the indexing for current bar be 0 and 1 for primary and secondary? I tried that based on some posts i found here, but it didnt work and i had to use 1 and 2. Not sure if this is doing the correct thing though.

    Code:
    if (CurrentBars[1] < 2 || CurrentBars[2] < 2)
    return;
    2) I want to enter based on any time the price meets the criteria, not based on the 15 min candle close. I've tried this, to enter based on the dataseries under index 1 which should be the tick data, but it doesn't seem to work correctly

    Code:
    EnterLong(1, 1, "Long_" + i)
    Appreciate any help.​

    #2
    Hello sofortune,

    Thank you for your post.​

    CurrentBars[0] is the primary data series (the one the strategy is applied to), CurrentBars[1] is the secondary data series, and so on.

    Since you have 2 calls to AddDataSeries(), you have 2 additional data series in your strategy. The 15 minute series is the secondary series and the 1 tick series is the third added data series.

    You would need a CurrentBars check for CurrentBars[0], CurrentBars[1], and CurrentBars[2].



    Your second question has been addressed in your previous post about the same topic: https://forum.ninjatrader.com/forum/ninjatrader-8/strategy-development/1303786-enter-based-on-intracandle-price

    We kindly ask that users refrain from posting multiple threads about the same topic as this can affect our ability to assist users in a timely manner and properly track each issue. We appreciate your cooperation in this regard.

    Comment


      #3
      Thanks

      Sorry about the multiple posts... just gathered my thoughts into this post.

      So the 15m data series is not really necessary as long as it is the chart data it is being applied to right?

      Comment


        #4
        Hello sofortune,

        No worries.

        No, it is not necessary if you are already applying the strategy to a 15 minute chart. The primary series(CurrentBars[0]) is the one you apply the chart to.

        Please let us know if you have any further questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        43 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X