ChartTrendLine
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.
Signature
| public abstract interface ChartTrendLine
|
Namespace
cAlgo.API
Methods
Name | Description |
CalculateY | Calculates Y-axis value corresponding the specified time value. |
Properties
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 | 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)
{
}
}
}
|
See Also
Last update: March 30, 2023