Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Offset indicator

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

    Offset indicator

    Hi All,
    How do I offset an indicator 5 candles e.g. have the current candle correspond to SMA from 5 candles ago.
    I've tried: Myplot = SMA(Close,10)[5]; but this doesn't plot anything

    Thank you, RN

    #2
    AddPlot(...);

    // later

    double MyVariable = 0;
    if (CurrentBar >= 5) MyVariable = SMA(Close, 10)[5];
    if (MyVariable > 0) Value[0] = MyVariable;
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Thanks Bruce. it worked

      Comment


        #4
        Hello RN,

        Thanks for your post.

        I am happy to hear you were able to get this to work with help from QuantKey_Bruce.

        See this help guide page for more information about AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm

        See this help guide page about the Value collection: https://ninjatrader.com/support/help.../nt8/value.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, Yesterday, 04:31 AM
        0 responses
        22 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        280 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        279 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        130 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        90 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X