Skip to content

ChartHorizontalLine

interface cAlgo.API

DesktopCLICloud

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

Environment behaviour

CLI — works differently. Created and kept with all its properties, but never drawn: the CLI displays no chart.

Cloud — works differently. Created and kept with all its properties, but never drawn: the cloud displays no chart.

Definition

public interface ChartHorizontalLine

Namespace: cAlgo.API · Group: Drawings · Implements: ChartObject

Examples

using cAlgo.API;

namespace cAlgo
{
    // This sample indicator shows how to use Chart.DrawHorizontalLine method to draw an horizontal line
    public partial class HorizontalLineSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.DrawHorizontalLine("horizontalLine", Bars.ClosePrices.LastValue, Color.Red);
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.DrawHorizontalLine("horizontalLine", api.Bars.ClosePrices.LastValue, Color.Red)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Properties

Name Description
ColorDesktopCLICloudColor Gets or sets the line color.
LineStyleDesktopCLICloudLineStyle Gets or sets the line style.
ThicknessDesktopCLICloudint Gets or sets the line thickness.
YDesktopCLIClouddouble Gets or sets the Y-axis value of the line location.

Inherited members

From ChartObject: Name, Comment, ObjectType, IsInteractive, IsLocked, IsHidden, ZIndex, IsAlive

See also