Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MTF question on LINING up multiple added series?

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

    MTF question on LINING up multiple added series?

    Howdy.

    Attached is an image.

    Note the main series, is an M15. In this example, I would add 3 additional TFs, M5, M60 and M240.

    For this example, w/M240 being the highest, most of my calcs will be based on that larger TF. So I essentially want to look INSIDE the developing M240, and look at the smaller TF bars that belong INSIDE that bar. NOTE: I will also want to be looking INSIDE the M60 for smaller bars within that also, but not important for this example.

    Right now, I was thinking of doing a semi-complex dataSeries for the EACH bar series, and assigning to it, the sequence count of the HIGHER TFs. You can imagine for say the M240, if that bottom bar, was the 20th M240 bar... I would put the number "20" in each of the LOWER TF's dataSeries I described above, that way I know which bars LINE UP with the other bars.

    I have not played with MTF scripts too much, so I'm wondering if there is a simple way to reference the bars across TFs I am not thinking of?

    This indie will mostly function in onPriceChange/onEachTick.

    Thanks,
    FP
    Attached Files

    #2
    UNless there is a simpler way, after thinking about this, I think my best bet, would be to simply take the CURRENT higher TF bar... get the timestamp of the PRIOR bar... then go to a lower TF series, and scroll back from right to left, as long as the current TIME is GREATER than the timestamp I gathered from the higher TF bar.

    If it's equal to, I'll break; and stop looping backwards.

    I guess I'll do this unless there is a more obvious way to do what I want. Shown in the modifications are the RED boxes in the attached image.

    Thanks,
    FP
    Attached Files

    Comment


      #3
      Hello FP,

      When adding multiple series with AddDataSeries() each series will update OnBarUpdate(). The series updating OnBarUpdate() will be indicated by the BarsInProgress index.

      You can access other series by using the BarsInProgress index.

      For example to get the close price of an added series when the primary series is updating:

      if (CurrentBars[0] < 1 || CurrentBars[1] < 1)
      return;

      if (BarsInProgress == 0)
      {
      Print(Times[1][0].ToString() + " | Closes[1][0]: " + Closes[1][0].ToString());
      }
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      589 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X