Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame (MTF) Indicator

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

    #31
    Hi ChelseaB,
    right clear. But when both timeseries are 60-min (or the same), it doesn't work because the primary series is processed first (TmpUpBuffer is zero or plot is false)....
    Peter

    Comment


      #32
      Hello Peter,

      If the primary series and secondary series use the same instrument and same interval, then its likely BarsInProgress 0 will run first (this is not guaranteed).
      (I'm not quite sure I understand why there would be an added data series that is the same instrument and interval as the primary series..)

      If the primary series and secondary series do not use the same instrument but use the same interval, then whichever tick is received first will be the first to trigger.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #33
        Hi,
        (I'm not quite sure I understand why there would be an added data series that is the same instrument and interval as the primary series..)
        As I wrote several times before, I want to have global picture (daily view) based on calculation from 60-min. But sometimes I would like to switch indicator view to 60-min for details -> PRIMARY will be equal to SECONDARY.

        It is still connected with your advise to move Plots to BarsInProgress PRIMARY section of my example indicator code. But when I move UpTargetBuffer[0]=TmpUpTargetBuffer[0]
        into PRIMARY section, there will be no values in TmpUpTargetBuffer[0] in case PRIMARY = SECONDARY

        if (BarsInProgress == 1)
        {
        TmpUpTargetBuffer[0]=1845;
        plot = true;
        }

        if (BarsInProgress == 0)
        {
        if(plot == true) Plot[0]=TmpUpTargetBuffer[0];

        Comment


          #34
          Hi Peter Cherry,

          Basically, if you have a primary data series that is equal to the secondary series, you will need different code.

          My suggestion in this situation is that if the primary and secondary dataseries are exactly the same, then have separate code that ignores BarsInProgress 1 and just do all calculations and plotting in BarsInProgress 0.

          (While I generally think plotting in bars in progress 0 is easier to understand and keep in my head, this is just a general tip that makes coding strategies easier but may not work in every situation).
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          173 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          91 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          129 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          209 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          186 views
          0 likes
          Last Post CarlTrading  
          Working...
          X