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

negative displacement SMA and plot effective value for remaining bars

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

    negative displacement SMA and plot effective value for remaining bars

    When I use a moving average indicator and displace it by a negative number, the indicator gets truncated X number of bars ( X being the negative displaced value). there are charting software that are able to plot an "effective" line (turquoise color line on the pic attached) for the remaining bars on the graph. (seems they are just concatenating the effective SMA with a reduce length for the last bars). could this be done (or is it possible ) on NT8? Thank you for your support.

    #2
    Hello VeganCat,

    Thanks for your post.

    If we displace an indicator we will be visually offsetting the plot. Let's say the last bar on the chart is bar 300 and we add an SMA with a Displacement of -10. The plot value that is associated with bar 300 is displaced so it visually resides on bar 290.

    In NinjaTrader, we could create an indicator that has plot values offset instead of using the displacement property, and then math can be used to assign plot values for the "predicted" bars with a calculated value. The "predicted" values could be the original SMA plot values, but those values would have to be translated so they connect with the last displaced/offset plot value and create a continuous line.

    For more information on plotting SMA's in a custom indicator, please see the documentation below.

    AddPlot() (creating plots and assigning plot values) - https://ninjatrader.com/support/help...8/?addplot.htm

    SMA syntax - https://ninjatrader.com/support/help...simple_sma.htm

    Working with Price Series (Indexing/BarsAgo references) - https://ninjatrader.com/support/help...ice_series.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    6 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Yesterday, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X