Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    55 views
    0 likes
    Last Post CarlTrading  
    Working...
    X