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

Easiest way to draw a dotted line?

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

    Easiest way to draw a dotted line?

    I have just started my NinjaScript endeavors and managed to create a %B indicator that actually works, quite happy with myself.

    I have added three lines that represent the upper/middle/lower bands of the Bollinger indicator. I have done it this way and it creates a solid line:

    AddLine(Brushes.Gray, 1.0, "Upper");

    However I would like the line to be dotted. I understand that I need to use Strokes instead of Brushes but not sure how. Which would be the simplest way to make the line dotted?

    #2
    Hello Chrille,

    Thank you for your note.

    If you wanted your line to be dotted rather than solid, you should use the following,

    AddLine(new Stroke(Brushes. Gray, DashStyleHelper.Dash, 1), 1.0, " Upper");

    Rather than,

    AddLine(Brushes.Gray, 1.0, "Upper");

    Please see the second example in the Line section of our helpguide for an example of using stroke.


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Perfect, thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Christopher Leggit, 02-15-2024, 09:00 AM
      3 responses
      45 views
      0 likes
      Last Post rdtdale
      by rdtdale
       
      Started by DavidHP, Today, 07:56 AM
      0 responses
      2 views
      0 likes
      Last Post DavidHP
      by DavidHP
       
      Started by Aviram Y, 08-09-2023, 09:04 AM
      10 responses
      299 views
      0 likes
      Last Post MrHump
      by MrHump
       
      Started by jpapa, Today, 07:22 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by kevinenergy, 02-17-2023, 12:42 PM
      116 responses
      2,758 views
      1 like
      Last Post kevinenergy  
      Working...
      X