Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Displacement parameter

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

    #16
    Hi! I have one more question regarding displaced SMA in strategy builder. Is there a way to execute an order based on displaced SMA's level at current price level ?

    When I try to build a strategy on this, it always takes the latest displaced SMA's value, which is not what I need.

    Comment


      #17
      George, can you please clarify what you're trying to do ("execute an order based on displaced SMA's level")? Can you post the code you're using so we can see what might be occurring here?
      AustinNinjaTrader Customer Service

      Comment


        #18
        Sure it's:
        // Condition set 1
        if (GetCurrentBid() >= SMA(30)[50]])
        {
        EnterLong(DefaultQuantity, "");
        }
        When I backtest the strategy, entries are wrong, as it doesn't seem to take SMA's value at current price.

        Comment


          #19
          Hello,

          SMA(30)[50]]

          This is telling NinjaTrader do get the value of a 30 bar SMA and get the value of this indicator 50 bars ago. Is this what your wanting to do? As this would not be the current value. Current value would be SMA(30)[0];
          BrettNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          17 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          120 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          174 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          92 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          134 views
          0 likes
          Last Post cmoran13  
          Working...
          X