-
Notifications
You must be signed in to change notification settings - Fork 6
/
Day_OpenHiLo_RT.Indicator.CS
59 lines (50 loc) · 1.79 KB
/
Day_OpenHiLo_RT.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
52
53
54
55
56
57
58
59
using System.Drawing;
namespace PowerLanguage.Indicator
{
public class Day_OpenHiLo_RT : IndicatorObject
{
private IPlotObject Plot1;
private IPlotObject Plot2;
private IPlotObject Plot3;
private IPlotObject Plot4;
public Day_OpenHiLo_RT(object ctx) :
base(ctx){
plotopen = true;
}
[Input]
public bool plotopen { get; set; }
[Input]
public bool plotprevclose { get; set; }
protected override void Create(){
Plot1 =
AddPlot(new PlotAttributes("High", 0, Color.Cyan,
Color.Empty, 0, 0, true));
Plot2 =
AddPlot(new PlotAttributes("Low", 0, Color.Yellow,
Color.Empty, 0, 0, true));
Plot3 =
AddPlot(new PlotAttributes("Open", 0, Color.Blue,
Color.Empty,
0, 0, true));
Plot4 =
AddPlot(new PlotAttributes("YestClose", 0, Color.Silver,
Color.Empty, 0, 0, true));
}
protected override void CalcBar(){
if ((Environment.IsRealTimeCalc)){
var m_dhigh = Bars.StatusLine.High;
var m_dlow = Bars.StatusLine.Low;
Plot1.Set(0, m_dhigh);
Plot2.Set(0, m_dlow);
if (plotopen){
var m_dopen = Bars.StatusLine.Open;
Plot3.Set(0, m_dopen);
}
if (plotprevclose){
var m_yestclose = Bars.StatusLine.PrevClose;
Plot4.Set(0, m_yestclose);
}
}
}
}
}