-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGapless_Bar_Chart.Indicator.CS
51 lines (43 loc) · 1.71 KB
/
Gapless_Bar_Chart.Indicator.CS
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Drawing;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
public class Gapless_Bar_Chart : IndicatorObject
{
private IPlotObject Plot1;
private IPlotObject Plot2;
private IPlotObject Plot3;
private IPlotObject Plot4;
public Gapless_Bar_Chart(object ctx) :
base(ctx) {}
protected override void Create(){
Plot1 =
AddPlot(new PlotAttributes("TrueHigh", EPlotShapes.BarHigh,
Color.Yellow, Color.Empty, 0,
0,
true));
Plot2 =
AddPlot(new PlotAttributes("TrueLow", EPlotShapes.BarLow,
Color.Yellow, Color.Empty, 0,
0,
true));
Plot3 =
AddPlot(new PlotAttributes("Open", EPlotShapes.LeftTick,
Color.Yellow, Color.Empty, 0,
0,
true));
Plot4 =
AddPlot(new PlotAttributes("Close", EPlotShapes.RightTick,
Color.Yellow, Color.Empty, 0,
0,
true));
}
protected override void CalcBar(){
Plot1.Set(0, _TrueHigh.TrueHigh(Bars, 0));
Plot2.Set(0, _TrueLow.TrueLow(Bars, 0));
Plot3.Set(0, Bars.Open[0]);
Plot4.Set(0, Bars.Close[0]);
}
}
}