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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X