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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X