PlotType
Summary
The Plot type.
Signature
Namespace
cAlgo.API
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 | using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo
{
// This sample shows how to use different types of plots for your indicator outputs
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class PlotTypeSample : Indicator
{
private StandardDeviation _standardDeviation;
[Output("Discontinuous Line", LineColor = "Red", PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries DiscontinuousLine { get; set; }
[Output("Histogram", LineColor = "Green", PlotType = PlotType.Histogram)]
public IndicatorDataSeries Histogram { get; set; }
[Output("Line", LineColor = "Blue", PlotType = PlotType.Line)]
public IndicatorDataSeries Line { get; set; }
[Output("Points", LineColor = "Yellow", PlotType = PlotType.Points)]
public IndicatorDataSeries Points { get; set; }
protected override void Initialize()
{
_standardDeviation = Indicators.StandardDeviation(Bars.ClosePrices, 20, MovingAverageType.Simple);
}
public override void Calculate(int index)
{
DiscontinuousLine[index] = Bars.ClosePrices[index] + _standardDeviation.Result[index];
Histogram[index] = Bars.ClosePrices[index] + (_standardDeviation.Result[index] * 1.5);
Line[index] = Bars.ClosePrices[index] + (_standardDeviation.Result[index] * 2);
Points[index] = Bars.ClosePrices[index] + (_standardDeviation.Result[index] * 2.5);
}
}
}
|
Fields
Line
Summary
Plot Indicator result as a line.
Signature
| public static PlotType Line;
|
Return Value
PlotType
Examples
| [Output("Main", PlotType = PlotType.Line)]
public IndicatorDataSeries Result { get; set; }
|
Histogram
Summary
Plot Indicator result as a histogram.
Signature
| public static PlotType Histogram;
|
Return Value
PlotType
Examples
| [Output("Main", PlotType = PlotType.Histogram)]
public IndicatorDataSeries Result { get; set; }
|
Points
Summary
Plot Indicator result as a sequence of points.
Signature
| public static PlotType Points;
|
Return Value
PlotType
Examples
| [Output("Main", PlotType = PlotType.Points)]
public IndicatorDataSeries Result { get; set; }
|
DiscontinuousLine
Summary
Plot Indicator result as a line with breaks where there are no values in the IndicatorDataSeries.
Signature
| public static PlotType DiscontinuousLine;
|
Return Value
PlotType
Examples
| [Output("Main", PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries Result { get; set; }
|
Last update: December 6, 2023