Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Horizontal line and create a dot line.

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

    Draw Horizontal line and create a dot line.

    Hello,

    I want my horizontal line in a dot style.
    There is something i am missing.

    Code:
    Draw.HorizontalLine(this, "tag13", red, DashStyleHelper.Dot, Brushes.Red);
    The code return errors. I try to follow the syntax provided in the tutorial.

    Also is it possible to add words and number on the line in the chart? Like A1 or anything else?

    thank you

    #2
    Hello frankduc,

    It looks like you used an invalid set of parameters. You can find examples of what can be used in the help guide:
    https://ninjatrader.com/support/help...horizontalline

    You can use either of these overloads which include the DashStyleHelper. You do need all the parameters though so what you have provided looks like it is missing some.

    Code:
    Draw.HorizontalLine(NinjaScriptBase owner, string tag, bool isAutoScale, double y, Brush brush, DashStyleHelper dashStyle, int width)
    Draw.HorizontalLine(NinjaScriptBase owner, string tag, double y, Brush brush, DashStyleHelper dashStyle, int width, bool drawOnPricePanel)
    Code:
     Draw.HorizontalLine(this, "tag13", true, Close[0], Brushes.Red, DashStyleHelper.Dot, 1);
    Words and numbers can be drawn using Draw.Text, you would need to supply the price you wanted for it to be drawn at that price.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    46 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    67 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X