Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PlotStyle Applied to a drawn Line

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

    PlotStyle Applied to a drawn Line

    Greetings,

    For a typical plot, we can normally do something like this to set a style:

    Code:
    Plots[0].PlotStyle = PlotStyle.HLine;
    and we have a property to set a dash style as well:

    Code:
    Plots[0].DashStyleHelper = DashStyleHelper.Dash;
    The same could be said if we try to apply the "DashStyleHelper" to a "Line"

    Code:
    var aaa = Draw.Line(this, _lineTag + "L1", false, BarsArray[0].GetTime(CurrentBar), L1[0],
    BarsArray[0].GetTime(CurrentBar).AddHours(8), L1[0], Plots[0].Brush, Plots[0].DashStyleHelper, 1);
    
    aaa.Stroke.DashStyleHelper = DashStyleHelper.Dash;
    I am aware that a custom "Stroke" could be created but I was hoping I could use that PlotStyle property you can find on plots. Is there a way to apply such a property to a "Line"?

    #2
    Hello hbustami,

    The PlotStyle is a class type. This will not be accepted by a drawing object which does not have property of PlotStyle.

    If you are trying to convert a PlotStyle to a DashStyleHelper you would need to use a keyvaluepair array or something similar and map specific plotstyles to specific dashstylehelpers.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    46 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    67 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X