Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Refernce Plot Width and line attributes

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

    Refernce Plot Width and line attributes

    Scenario:
    I draw rays but want to add a plot so the user can define his plot with and line attributes.

    Question
    How do I retrieve/reference these plot values for my draw ray? I can set the values with "Plots[0].Pen.Width" but what is the syntax to reference them?

    Cheers

    #2
    Hello ct,

    Thanks for your post.

    If your end goal is to obtain the users preferences for line width and line style and plot style, you can use properties to allow the user to select them and then can work with the variables in your code.

    For example, to get a line width:

    [Description("Width for MA plot.")]
    [Category("3. MA Plot")]
    [Gui.Design.DisplayNameAttribute("3.Line Width MA")]
    public int Plot0Width
    {
    get { return plot0Width; }
    set { plot0Width = Math.Max(1, value); }
    }


    To get the plot style:

    [Description("PlotStyle for MA plot.")]
    [Category("3. MA Plot")]
    [Gui.Design.DisplayNameAttribute("1.Plot Style MA")]
    public PlotStyle Plot0Style
    {
    get { return plot0Style; }
    set { plot0Style = value; }
    }


    To get the dashstyle:

    [Description("DashStyle for MA plot.")]
    [Category("3. MA Plot")]
    [Gui.Design.DisplayNameAttribute("2.Dash Style")]
    public DashStyle Dash0Style
    {
    get { return dash0Style; }
    set { dash0Style = value; }
    }
    Attached Files
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CortexZenUSA, Today, 12:53 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by CortexZenUSA, Today, 12:46 AM
    0 responses
    1 view
    0 likes
    Last Post CortexZenUSA  
    Started by usazencortex, Today, 12:43 AM
    0 responses
    5 views
    0 likes
    Last Post usazencortex  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    168 responses
    2,265 views
    0 likes
    Last Post sidlercom80  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X