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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        51 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        31 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        165 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        100 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        160 views
        2 likes
        Last Post CaptainJack  
        Working...
        X