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 cmtjoancolmenero, Yesterday, 03:58 PM
    4 responses
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Brevo, Today, 01:45 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rjbtrade1, 11-30-2023, 04:38 PM
    2 responses
    74 views
    0 likes
    Last Post DavidHP
    by DavidHP
     
    Started by suroot, 04-10-2017, 02:18 AM
    5 responses
    3,022 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Stanfillirenfro, Today, 07:23 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X