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 junkone, Today, 11:37 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, Yesterday, 09:08 AM
    11 responses
    41 views
    0 likes
    Last Post frankthearm  
    Started by quantismo, 04-17-2024, 05:13 PM
    5 responses
    35 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by proptrade13, Today, 11:06 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    34 views
    0 likes
    Last Post love2code2trade  
    Working...
    X