Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rdtdale, Yesterday, 01:02 PM
        2 responses
        15 views
        0 likes
        Last Post rdtdale
        by rdtdale
         
        Started by TradeSaber, Today, 07:18 AM
        0 responses
        7 views
        0 likes
        Last Post TradeSaber  
        Started by PaulMohn, Today, 05:00 AM
        0 responses
        9 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Working...
        X