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

Control Line style from indicator

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

    Control Line style from indicator

    I am drawing a simple line in an indicator....which works well.

    The problem comes when I try to tell indicator to draw a 'dash-dot-dot'
    instead of a solid line.
    When I try to add DashStyle parameter to the command....(see below)

    Add(new Line(Color.DimGray, DashStyle.DashDotDot, -100, "Level -1"));

    I get an error saying that I have too many arguments.

    I'm getting a mental blank on this...and for some reason can't figure it out.
    Any help would be appreciated...

    Thanks.............

    #2
    Hi photog53,

    You can add the DashStyle after the Add line, within Initialize()

    Something like...
    Code:
    Add(new Line(Color.DimGray, -100, "Level -1"));
    Lines[0].Pen.DastStyle=DashStyle.DashDotDot
    TimNinjaTrader Customer Service

    Comment


      #3
      Thanks!!
      ....(probably should have thought of that, but for some reason I couldn't get the concept right)

      One more quick question....If I am drawing mulitple lines, will the "pen" command
      apply to all of them or only one specific line?


      As always, you guys are great!!

      Last edited by photog53; 06-07-2010, 08:37 AM.

      Comment


        #4
        Hi photog53,


        This will be specific to that line or plot.

        For example...
        Code:
        Add(new Line(Color.DimGray, -0, "Level 1"));
        Add(new Line(Color.DimGray, -100, "Level 2"));
        
        Lines[0].Pen.DastStyle=DashStyle.DashDotDot;
        Lines[1].Pen.DastStyle=DashStyle.Dash;
        TimNinjaTrader Customer Service

        Comment


          #5
          Great!!! (thanks again)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ageeholdings, 05-01-2024, 05:22 AM
          5 responses
          33 views
          0 likes
          Last Post ageeholdings  
          Started by reynoldsn, Today, 02:34 PM
          0 responses
          6 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          11 views
          0 likes
          Last Post nightstalker  
          Started by llanqui, Yesterday, 09:59 AM
          8 responses
          29 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by quicksandatl, Today, 01:39 PM
          1 response
          6 views
          0 likes
          Last Post quicksandatl  
          Working...
          X