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 PaulMohn, Today, 03:49 AM
      0 responses
      6 views
      0 likes
      Last Post PaulMohn  
      Started by inanazsocial, Today, 01:15 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by rocketman7, Today, 02:12 AM
      0 responses
      10 views
      0 likes
      Last Post rocketman7  
      Started by dustydbayer, Today, 01:59 AM
      0 responses
      4 views
      0 likes
      Last Post dustydbayer  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      5 responses
      23 views
      0 likes
      Last Post trilliantrader  
      Working...
      X