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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        581 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        338 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X