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

Displaced Moving Averages

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

    Displaced Moving Averages

    I see that in NT you can offset a moving average to the left or right. When you offset them to the right, is there a way to see the part of the average that is to the right (future) of the current price bar. Example: You create SMA that is offset 5 bars to the right. There should be 5 bars of average past the current bar. How can I get this to be shown? Am I missing some setting or is this something that NT cannot currently do?

    #2
    Mahsu01,

    Thank you for your post.

    If you set the Displacement to 5 bars from the indicator visual properties, you should see the SMA 5 bars ahead of the current bar - Is this not what you're currently seeing?

    I've attached a screen shot to clarify.
    Attached Files
    MatthewNinjaTrader Product Management

    Comment


      #3
      I just figured this out and yes you are correct in that it does push the SMA in front of the price. The one thing I did not realize however is that this also works in negative values. That is what I needed. Thanks for your help.

      Comment


        #4
        Thank you so much for the post. It's really useful.

        _________________
        baltimore used cars

        Comment


          #5
          I know this is old, but I have a question directly related to it

          I know you can displace the moving averages on the chart,

          How do you do the same thing in the strategy builder?


          Thanks,

          - K

          EDIT:
          TO BE CLEAR: I want to displace my moving average precisely how it is listed in this post...to the right. However, the displacements in the Strategy Builder seem to imply offsetting the moving average up or down by price/percent/ticks. I want sideways...

          Thanks again,

          - K
          Last edited by Darth_Trader; 01-28-2015, 08:35 PM. Reason: wasn't clear

          Comment


            #6
            Darth_Trader, the offset is for the Y value, correct. To displace to the right, just access a past indicator value, like on the CurrentBar work with the MA value from 5 bars ago - this is essentially the displacement then.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              So let's say I want to measure if price crosses a moving average that I want displaced by say 4 bars.

              I would set the CLOSE >/crosses above MA(4)? And that would work? (pseudocode obviously). Would ">" or "crosses above" be more correct in this case?


              - K
              Last edited by Darth_Trader; 01-29-2015, 04:26 AM. Reason: to be clear

              Comment


                #8
                The CrossAbove you could not use in this case, you would need to express the condition via the <> comparisons in the Condition Builder.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hello,
                  I came across this thread as I am having a problem myself using the crossabove and crossbelow condition comparing 2 indicators being the second indicator displaced. My strategy was getting different results if I used the cross condition vs a simple >< condition.

                  I can see on the last post Bertrand replied to the previous post saying that you can not use: CrossAbove(Close, EMA(14)[Displaced], 1) in a strategy. May I ask why? Anybody using something like this with any success? Thank you.

                  Comment


                    #10
                    Hello bertochi,

                    Thanks for your post.

                    Correct you would not be able to use the CrossAbove() or CrossBelow() methods in the case of using a displaced plot as the method does not accommodate a displaced plot.

                    As Bertrand had previously advised, "The CrossAbove you could not use in this case, you would need to express the condition via the <> comparisons in the Condition Builder." and "To displace to the right, just access a past indicator value, like on the CurrentBar work with the MA value from 5 bars ago - this is essentially the displacement then."

                    I will write up a feature request to add this ability (CrossAbove/below methods to use a displaced plot) and will update this thread when I have further information.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello bertochi,

                      The feature request to have the strategy builder use displacement plots in the CrossAbove/CrossBelow has been assigned to SFT-1638.

                      Feature requests are submitted for possible implementation in the future. There is no guarantee this will be included in a future release.
                      Paul H.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by rtwave, 04-12-2024, 09:30 AM
                      4 responses
                      29 views
                      0 likes
                      Last Post rtwave
                      by rtwave
                       
                      Started by yertle, Yesterday, 08:38 AM
                      7 responses
                      28 views
                      0 likes
                      Last Post yertle
                      by yertle
                       
                      Started by bmartz, 03-12-2024, 06:12 AM
                      2 responses
                      21 views
                      0 likes
                      Last Post bmartz
                      by bmartz
                       
                      Started by funk10101, Today, 12:02 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post funk10101  
                      Started by gravdigaz6, Yesterday, 11:40 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X