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

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 rdtdale, Today, 01:02 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by RookieTrader, Today, 09:37 AM
          4 responses
          19 views
          0 likes
          Last Post RookieTrader  
          Started by PaulMohn, Today, 12:36 PM
          0 responses
          10 views
          0 likes
          Last Post PaulMohn  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          41 views
          0 likes
          Last Post love2code2trade  
          Working...
          X