LineStyle


Summary

An enumeration of different stroke styles used to render lines.

Syntax

public sealed enum LineStyle

Members

NameTypeSummary
Dots FieldA dotted line: .....
DotsRare FieldA dotted line, large gap between dots: . . . .
DotsVeryRare FieldA dotted line, extra large gap between dots: . . . .
Lines FieldLines with gaps are used to render the line: - - - -
LinesDots FieldA mixed line / dot style is used to render the line: - . - . - .
Solid FieldA solid line: -----

Example 1

//Examples of all different LineStyles
[Output("Dots", LineStyle = LineStyle.Dots)]
public IndicatorDataSeries outputDots { get; set; }
[Output("DotsRare", LineStyle = LineStyle.DotsRare)]
public IndicatorDataSeries outputDotsRare { get; set; }
[Output("DotsVeryRare", LineStyle = LineStyle.DotsVeryRare)]
public IndicatorDataSeries outputDotsVeryRare { get; set; }
[Output("Lines", LineStyle = LineStyle.Lines)]
public IndicatorDataSeries outputLines { get; set; }
[Output("LinesDots", LineStyle = LineStyle.LinesDots)]
public IndicatorDataSeries outputLinesDots { get; set; }
[Output("Solid", LineStyle = LineStyle.Solid)]
public IndicatorDataSeries outputSolid { get; set; }

Example 2

using cAlgo.API;
namespace cAlgo
{
    // This sample indicator shows how to use different line styles
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class LineStyleSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.DrawVerticalLine("Dots", Chart.LastVisibleBarIndex, Color.Red, 3, LineStyle.Dots);
            Chart.DrawVerticalLine("DotsRare", Chart.LastVisibleBarIndex - 2, Color.Yellow, 3, LineStyle.DotsRare);
            Chart.DrawVerticalLine("DotsVeryRare", Chart.LastVisibleBarIndex - 4, Color.Green, 3, LineStyle.DotsVeryRare);
            Chart.DrawVerticalLine("Lines", Chart.LastVisibleBarIndex - 6, Color.Blue, 3, LineStyle.Lines);
            Chart.DrawVerticalLine("LinesDots", Chart.LastVisibleBarIndex - 8, Color.Magenta, 3, LineStyle.LinesDots);
            Chart.DrawVerticalLine("Solid", Chart.LastVisibleBarIndex - 10, Color.Brown, 3, LineStyle.Solid);
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference