Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

drawing hash / dash for 5 bars (NT8)

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

    drawing hash / dash for 5 bars (NT8)

    Hi

    My indicator currently plots a red or blue hash above / below a bar on its close if it meets my definition, however how do I change the hash to plot a dash say for the next 5 bars ?

    AddPlot(new Stroke(Brushes.Red,2), PlotStyle.Hash, "Upside");

    AddPlot(new Stroke(Brushes.Blue,2), PlotStyle.Hash, "Downside");

    Thanks to anyone who can help

    Regards
    Craig

    #2
    Hello cwhitelaw,

    Thanks for opening the thread.

    It wouldn't be possible to stretch a plot to span over a certain number of bars, but it is certainly possible to come up with the visual result.

    You could for example, use Drawing Objects to place a visual object for the next five bars after your plot.

    Another approach would be to add additional plots so you plot hashes for as many bars you would like the plot to stay at that level.

    For example, adding 5 additional plots and then assigning Values[0][0] (for plot 0) to be the current plot value, and then assigning Values[1][0] (for plot 1) to be the value from Values[0][1] (Plot 0's previous value) and so on.

    Different Drawing objects you may wish to use are documented here: https://ninjatrader.com/support/help...us/drawing.htm

    For modifying Values please see here: https://ninjatrader.com/support/help...-us/values.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    140 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X