ChartHorizontalLine


Summary

Represents the Horizontal Line chart object. Used to mark a certain value on the Y-axis throughout the whole chart.

Syntax

public interface ChartHorizontalLine : ChartObject

Members

NameTypeSummary
Color PropertyGets or sets the line color.
LineStyle PropertyGets or sets the line style.
Thickness PropertyGets or sets the line thickness.
Y PropertyGets or sets the Y-axis value of the line location.

Example 1

using cAlgo.API;
namespace cAlgo
{
    // This sample indicator shows how to use Chart.DrawHorizontalLine method to draw an horizontal line
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class HorizontalLineSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.DrawHorizontalLine("horizontalLine", Bars.ClosePrices.LastValue, Color.Red);
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference