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 NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X