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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,235 views
        0 likes
        Last Post xiinteractive  
        Working...
        X