• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
      Patrick H.NinjaTrader Customer Service

      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 spikeruk, Today, 01:49 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by Yandychang, Today, 02:16 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by priceisking, Today, 01:16 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by kashyapjdave, 03-23-2017, 12:12 AM
        11 responses
        1,956 views
        0 likes
        Last Post forextrader2003  
        Started by Gav_G, 07-26-2018, 04:29 PM
        5 responses
        422 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Working...
        X