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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    94 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    80 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    75 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Working...
    X