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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jpeep, 08-16-2020, 08:31 AM
    17 responses
    502 views
    0 likes
    Last Post notenufftime  
    Started by ETFVoyageur, 05-07-2024, 07:05 PM
    15 responses
    123 views
    0 likes
    Last Post ETFVoyageur  
    Started by esmall, Today, 07:14 PM
    0 responses
    9 views
    0 likes
    Last Post esmall
    by esmall
     
    Started by Option Whisperer, 05-09-2024, 07:58 PM
    6 responses
    26 views
    0 likes
    Last Post Option Whisperer  
    Started by rayyyu12, Today, 05:38 PM
    0 responses
    12 views
    0 likes
    Last Post rayyyu12  
    Working...
    X