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];

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,768 views
          0 likes
          Last Post Leafcutter  
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          30 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          943 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          10 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by rocketman7, Today, 01:00 AM
          0 responses
          7 views
          0 likes
          Last Post rocketman7  
          Working...
          X