Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to prevent past position of a moving average to change?

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

    How to prevent past position of a moving average to change?

    Hello Support; I have noticed, in NinjaTrader 8 the past position of a moving average can change with passage of time. Perhaps this is best evident with 2 pictures enclosed. In first picture the shadow of the bar with pink arrow has clearly penetrated the yellow color dashed-Dot moving average above. Yet few bars later, position of this moving average in past changes, & actually moves up. In the second picture the shadow of the bar with pink arrow is no longer penetrating this moving average. Chart events in the past should not change position with passage of time. Is there anyway to avoid this? Or are there Special Scripts for NinjaTrader 8 for moving averages that behaves "normal." ?
    Attached Files

    #2
    Which moving average indicator is in your chart?

    Comment


      #3
      The Yellow line is a 5 Min. EMA on a 1 minute chart. The data for 5 Min. EMA is in panel 2 (5 min Chart Hidden) the graph for 5 Min EMA is on panel 1 ( 1 Minute Chart)

      Comment


        #4
        You don't have them in the same scale. Check their scales and make sure they are both set to "Right". Do not set either of them to Left, or Overlay, or no scale - only Right - and this will not happen.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Settings appear to be correct. Here are Few Pics from Settings. The 9 EMA should be for a 5 Min Chart, that is superimposed on 1 Min Chart. Updated all, still get the same results. Have to wait till Monday to see in real time. Simple observation. Take any short period MA, like 9 on a short time frame like 1 Min. set to change on each tick on a market that has some volatility, /ES. As the price moves Up/Down its not just the tip of the MA Line that move Up/Down but up to 3-4 bars going back moves up/ down as prices changes.
          Attached Files

          Comment


            #6
            It seems likely this has to do with your superimposition of the two data series. Have you tried it without superimposing two data series in one panel? That seems like that's most likely the issue.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment


              #7
              Yes, I believe past MA positions change as front of MA Line Change on any simple chart. I will take some pics in next few days. In some forums I have seen others pointing this issue out. Once I have more pics I will post here.

              Comment


                #8
                Because of your superimposition of the 5-min on the 1-mni, the right-most 5-min bar will be shifting right as more data arrives, and that could change the perceived angle of the MA and whether it's above/below something that is on a different time farme like the 1-min time frame in the past 5 minutes which is up to 5 1-minute bars. I think the superimposition of the two data series is almost certainly the issue here. Try putting the two data series each in their own panel and I think you will observe that the MA does not move past bars (except for the question of it shifting visually in time because there are two data series in one panel).
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment


                  #9
                  What you really should do, if you want to see the 5-minute MA on a 1-minute chart is to AddDataSeries a 5-minute data series in your indicator, and then calculate the EMA - plot the CLOSED BAR value of the 5-minute EMA on the 1-minute chart, and it will be rock solid. If you plot the intrabar value of the 5-minute EMA, you'll see a stair-step as it wiggles up and down with each 1-minute passage of time (which is intrabar for the 5-minute series). That's the way to do a multi-timeframe MA right, instead of having two data series in one panel, which is going to be confusing and cause these kinds of visual anomalies.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  Comment


                    #10
                    Hello FishTrade,

                    I agree with Bruce and am suspect about the scaling, but you have the indicators running with Calculate.OnEachTick.

                    If you are viewing the value on the last bar before the bar closes, it's going to change by the time the bar closes.

                    Just to confirm, are you waiting for the bar to close before viewing the final value?

                    Using the databox, are you seeing after the bar has closed the value is changing after a few new bars have formed?

                    As a tip, the EMA does not need to count ticks or volume and only reacts to changes in price. It would be more efficient to use Calculate.OnPriceChange to update this indicator in real-time.
                    Chelsea B.NinjaTrader Customer Service

                    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