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

Overlay Minute based indicator on bar chart trouble

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

    #16
    What? I thought that OnUpdateBar is called when a bar closes. Then you check the BarsInProgress to see which bar closed, the 8 range or the 3 min. If we filter for just the 3 min bars, then we should get the same number of bars to work with as a 3min primary. Is that not correct?

    Comment


      #17
      Hi TiggerTrader,

      Regardless of when a bar closes, plots are only synced with the primary data series.

      The plot will dictate the number of bars in the series and which bars are used in the calculation.

      Yes, OnBarUpdate is called when a bar closes. That is not was is causing the behavior.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_ChelseaB View Post
        Hi TiggerTrader,

        Regardless of when a bar closes, plots are only synced with the primary data series.
        Yes, I agree. This has nothing to do with my issue, yet. Unless, what you are saying is that even tho I have a 3min bar close, and I have the correct 3min bar data, the plot associated with the 3min data is NOT plotted until the 8range bar closes, and then the data at that point is used regardless of the bar close state of the 3min bar.

        The plot will dictate the number of bars in the series and which bars are used in the calculation.
        I assume you are meaning the primary series is "the plot". So I interpret what you are saying, is that the primary series dictates when OnBarUpdate is called. I thought OnBarUpdate gets called whenever any bar in any series in the chart updates. I guess I am wrong.

        Comment


          #19
          OK, I've been reading & re-reading the
          Multi-Time Frame & Instruments
          section of help.

          I'm having trouble with the plot idea. Specifically I am trying to create the 3min Stochastics in a new panel of an 8range chart.

          How does plot data differ from bar data from a timing point of view? Is it that I may get a call for a 3min bar and do my calculations, but the plot of my data does NOT occur until the next 8range bar closes? Or will it plot because the 3min bar closes?

          Comment


            #20
            Hi TiggerTrader,

            A plot is the data series used for the points that will be displayed on the chart as a line.

            For example, when you place an SMA on a chart, the orange line is created from the plot dataseries.

            In an indicator this is set with Value.Set.

            A plot is added with Add(new Plot(Color.Blue, "myPlot"));
            http://www.ninjatrader.com/support/h...es/nt7/add.htm
            http://www.ninjatrader.com/support/h...plot_class.htm

            All plots added (and yes you can add more than one) will be syncronized with the primary data series.

            If your chart is a 1 Minute chart, then the primary data series is a 1 minute data series. Each plot will hold 1 value per primary bar.

            If your primary bar is 8 range, and the secondary series is 3 minute, and there are 20 range breaks in that 3 minute period, then your plot will have 20 values that are the same. An average of this would be an average of the same value over and over 20 times.

            It is possible to synchronize a plot (or another dataseries to a secondary series).
            Below is a link to an example of how to do this.
            http://www.ninjatrader.com/support/f...ead.php?t=3572

            To answer your question, OnBarUpdate is called on both (all) data series. When either the 8 range or 3 minute bar closes OnBarUpdate will be called (with the proper BarsInProgress index). But again, whether OnBarUpdate is called is not the issue you are experiencing.

            Let me know if this does not clarify plots and the primary data series.
            Last edited by NinjaTrader_ChelseaB; 11-10-2014, 11:33 AM.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              What you said makes some sense but doesn't apply to my problem.

              I am not overlaying the plot. It is in a different panel.

              I've attached my 3min Stochastics indicator. You can add it to an 8range chart as a new panel. Also, create a 3min chart with Stochastics to compare values. That is where the confusion ensues.

              As you can see, I print the OHLC of the 3min bar to the output window, and that works fine. I see the data every 3 minutes and it matches the candle on the 3min chart.

              So why wouldn't the data in the calculations be the same? I ONLY perform the Stochastics work when I get the new 3min bar.
              Attached Files

              Comment


                #22
                Hi TiggerTrader,

                The plot is the visual data series but other than that it has nothing to do with your chart.

                I was trying to express what a plot is.

                However, overlay has nothing to do with what I am describing or anything visual on the chart. This is in code only. The panel has absolutely nothing to do with this issue.

                When you perform the calculation and save this to a plot, you are saving this to a 8 range plot not a 3 minute plot. The primary data series is 8 range then the plot is 8 range. Even if the calculations are made every 3 minutes and then saved to the plot (which is synchronized with the 8 range plot), the plot is still an 8 range plot.

                I brought up the SMA to help you understand that a plot will eventually be shown a chart, however, this is not what we are discussing. You are saving values that are calculated every 3 minutes to an 8 range plot series. There is a plot value for every primary bar not every secondary bar.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Ooooohhhhh!

                  OK, I'll work with that in mind. That explains the disconnect in my brain.

                  Thx

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, 04-16-2024, 06:09 PM
                  4 responses
                  12 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by terofs, Today, 04:18 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post nandhumca  
                  Started by The_Sec, Today, 03:37 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post The_Sec
                  by The_Sec
                   
                  Started by GwFutures1988, Today, 02:48 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Working...
                  X