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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          68 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
          1 like
          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