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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    72 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X