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 samish18, Today, 01:01 PM
    0 responses
    4 views
    0 likes
    Last Post samish18  
    Started by WHICKED, Today, 12:56 PM
    0 responses
    7 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Spiderbird, Today, 12:15 PM
    2 responses
    11 views
    0 likes
    Last Post Spiderbird  
    Started by WHICKED, Today, 12:45 PM
    0 responses
    7 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by FrazMann, Today, 11:21 AM
    2 responses
    8 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X