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

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    18 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    44 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    20 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    180 views
    0 likes
    Last Post jeronymite  
    Working...
    X