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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X