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

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 jaybedreamin, Today, 05:56 PM
          0 responses
          7 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          12 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          13 views
          0 likes
          Last Post bltdavid  
          Working...
          X