Skip to content

LineStyle

Summary

An enumeration of different stroke styles used to render lines.

Signature

1
public enum LineStyle

Namespace

cAlgo.API

Fields

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 //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; }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 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)
         {
         }
     }
 }

Last update: December 5, 2022

Comments