Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

displaced line in strategy

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

    displaced line in strategy

    im trying to make a stragety. I can add the SMA but i can displace it. how do i displace the line in the strategy.

    #2
    Hello cbart_1,

    Displacement is a visual setting only that offsets the indicator by the specified number of bars.

    There is not an equivalent setting in strategies, however you can access prior bar values using the bars ago setting/indexing applied to bars or indicators.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Add(SMA(3)[2]);
      So just addind that code doesnt work to plot a sma with a period of 3 and displced by 2.

      Comment


        #4
        I see. For that you can set the displacement property for the added indicator.

        Add(SMA(3));
        SMA(3).Displacement = 2;
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          2 SMA indicators with same period

          ok thank you that should help. But now i need to know if i can do a strategy with 2 SMA lines with same period and just one of them displaced or do i need to just make new indicator that has the SMA displaced already and then check to see when one crosses above or below the other.
          Last edited by cbart_1; 10-24-2011, 05:38 PM. Reason: Clearifying

          Comment


            #6
            Hello,


            The method Ryan has below will only apply to the one SMA indicator. You are free to go ahead and add the second one without the displacement.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X