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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    605 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    351 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    560 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    561 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X