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

How to do this type of plot?

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

    How to do this type of plot?

    am converting a custom eSignal indicator written in Java Script to NinjaScript.
    Have the logic working.. working on the plot.
    The indicator is a stop indicator. as the the price changes the stop moves.. the stop always should be plotted as a horizontal line, and when the stop moves up, there should not be a continuous line connected two successive horizontal segments.
    In Java Script there is nice way to do this as follows:

    setPlotType( PLOTTYPE_FLATLINES, 0 );
    Then you plot the line but assigning a value to plot0. When a new value is assigned, a new horizontal line is drawn at the new value.

    I can't find a "flatlines" plot type in NinjaScript... How would one do this?

    bigtee

    #2
    Originally posted by bigtee View Post
    am converting a custom eSignal indicator written in Java Script to NinjaScript.
    Have the logic working.. working on the plot.
    The indicator is a stop indicator. as the the price changes the stop moves.. the stop always should be plotted as a horizontal line, and when the stop moves up, there should not be a continuous line connected two successive horizontal segments.
    In Java Script there is nice way to do this as follows:

    setPlotType( PLOTTYPE_FLATLINES, 0 );
    Then you plot the line but assigning a value to plot0. When a new value is assigned, a new horizontal line is drawn at the new value.

    I can't find a "flatlines" plot type in NinjaScript... How would one do this?

    bigtee
    Code:
    Plots[x].PlotStyle = PlotStyle.Hash;
    where "x" is the zero-based index of the relevant Plot in the Plots collection.

    Comment


      #3
      Hello bigtee,

      Thank you for your post.

      In NinjaScript you can use PlotStyle.HLine where the syntax for the plot is Plot(Color color, PlotStyle plotStyle, string name) or Plot(Pen pen, PlotStyle plotStyle, string name).

      For information on the PlotClass in NinjaScript please visit the following link: http://www.ninjatrader.com/support/h...plot_class.htm

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

      Comment


        #4
        Thanks to both of you..
        koganam, your suggestion of using the "Hash" works perfectly.... does exactly what I need.

        PatrickH, yours will plot but draws lines across the entire chart.. whereas the "Hash" draws a line only until the value changes... the value can change every few bars.... so the HLINE is not what I was looking for.



        bigtee

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        8 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X