Summary
Represents the Trend Line chart object. A straight line that can be drawn from point 1 to the point 2 in any direction to mark the trends on the chart.
Syntax
public interface ChartTrendLine : ChartObject
Members
Name | Type | Summary |
---|---|---|
CalculateY | Method | Calculates Y-axis value corresponding the specified bar index. |
Color | Property | Gets or sets the color of the Trend Line. |
ExtendToInfinity | Property | Defines if the Trend Line extends to infinity. |
LineStyle | Property | Gets or sets the Trend Line style. |
ShowAngle | Property | Defines the trend line angle. |
Thickness | Property | Gets or sets the thickness of the Trend Line. |
Time1 | Property | Gets or sets the value 1 on the Time line. |
Time2 | Property | Gets or sets the value 2 on the Time line. |
Y1 | Property | Gets or sets the value 1 on the Y-axis. |
Y2 | Property | Gets or sets the value 2 on the Y-axis. |
Example 1
using cAlgo.API; namespace cAlgo { // This sample shows how to use Chart.DrawTrendLine to draw a trend line on chart [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class ChartTrendLineSample : Indicator { protected override void Initialize() { var trendLine = Chart.DrawTrendLine("trendLine", Chart.FirstVisibleBarIndex, Bars.LowPrices[Chart.FirstVisibleBarIndex], Chart.LastVisibleBarIndex, Bars.HighPrices[Chart.LastVisibleBarIndex], Color.Red, 2, LineStyle.Dots); trendLine.IsInteractive = true; } public override void Calculate(int index) { } } }