Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Class as Indicator Pamatere

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

    Custom Class as Indicator Pamatere

    Hello all,
    In my indicator I draw some lines (via DrawLine). I would like to set their style, color and width per indicator parameter. But each property like individual parameter is too bit uncomfortable.
    I tried to use private Line variable and parameter of Line type...It could be good, but it has expect Color, DashStyle and Width (which I need) also Value property..it is stupid for this situation..it has no sense.
    My question is if there exists some other class I could use for this situation (just Width, DashStyle and Color properties) or if I have to do my own class. I tried to do my own class SimpleLine, but parameter of SimpleLine type appeared in gray color and instead of value..there is just class name and of course its not expandable.
    Could you help me somehow ??
    My simple class for testing is:

    public class SimpleLineClass
    {
    public Color Color {get;set;}
    public int Width {get;set;}
    public DashStyle DashStyle {get;set;}

    public SimpleLineClass(Color color, int width, DashStyle dashstyle)
    {
    this.Color = color;
    this.Width = width;
    this.DashStyle = dashstyle;
    }
    }

    Or class must have some interface or directive ??
    Thanks
    Alex

    #2
    Hello Alex,

    Thank you for your post.

    Are you familiar with the following syntax for the DrawLine()?
    Code:
    DrawLine(string tag, bool autoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color, DashStyle dashStyle, int width)
    You can find this syntax and information on DrawLine() at the following link: http://www.ninjatrader.com/support/h...7/drawline.htm

    Are you trying to create user defined settings for each parameter of the above syntax for DrawLine()?

    I look forward to your response.

    Comment


      #3
      Im not sure if you and me are talking about the same thing. Please review pic...

      Comment


        #4
        I dont want to have parameter Line1 Color, Line1 Width, Line1 DashStyle...and similar to other lines...it is stupid. Better way is to have just Line1..and you can expand it and there you can found Width, DashStyle and Color property...similar to Line class.
        Therefore I tried to write my own class SimleLineClass with properties I really need. But It doesnt work
        Alex

        Comment


          #5
          Hello Alex,

          Thank you for your response.

          There would not be any supported items for an expander in the parameters.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          597 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          555 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X