Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Displaced SMA?

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

    Displaced SMA?

    Can someone give me simple code line for: Displaced -3 of SMA(5) CrossAbove SMA(13)
    Thanks,

    #2
    phillionair,

    Unfortunately it is not simple to get this displacement value. You will need to generate your own DataSeries that keeps track of the displaced value and then call it when you want it.

    Alternatively, you could try and make your own SMA indicator that does the displacement for you. You will need to replace all the Value.Set lines.

    Take Value.Set(Input[0]) and replace it with Value.Set(3, Input[0]). Add the "3" into all of the other Value.Sets and see if that works out for you.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      phillionair,

      Unfortunately it is not simple to get this displacement value. You will need to generate your own DataSeries that keeps track of the displaced value and then call it when you want it.

      Alternatively, you could try and make your own SMA indicator that does the displacement for you. You will need to replace all the Value.Set lines.

      Take Value.Set(Input[0]) and replace it with Value.Set(3, Input[0]). Add the "3" into all of the other Value.Sets and see if that works out for you.
      Josh,
      Where can I find more info./details about Value.Set/Displace? The help guide did not help much.

      Comment


        #4
        phillionair,

        Please check out the article on DataSeries. http://www.ninjatrader-support.com/H...iesObject.html

        Please read the "Setting Values - DataSeries.Set() & DataSeries.Reset()" section.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        71 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        39 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X