-
Notifications
You must be signed in to change notification settings - Fork 6
/
C_PierceLine_DkCloud.Indicator.CS
65 lines (53 loc) · 2 KB
/
C_PierceLine_DkCloud.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
60
61
62
63
64
65
using System;
using System.Drawing;
namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
public class C_PierceLine_DkCloud : IndicatorObject
{
private Function.C_PierceLine_DkCloud m_c_pierceline_dkcloud1;
private VariableObject<int> m_opiercingline;
private VariableObject<int> m_odarkcloud;
private IPlotObject Plot1;
private IPlotObject Plot2;
public C_PierceLine_DkCloud(object ctx) :
base(ctx){
length = 14;
}
[Input]
public int length { get; set; }
protected override void Create(){
m_c_pierceline_dkcloud1 = new Function.C_PierceLine_DkCloud(this);
m_opiercingline = new VariableObject<int>(this);
m_odarkcloud = new VariableObject<int>(this);
Plot1 =
AddPlot(new PlotAttributes("PierceLine", EPlotShapes.Point,
Color.Yellow, Color.Empty, 4,
0,
true));
Plot2 =
AddPlot(new PlotAttributes("DkCloud", EPlotShapes.Point,
Color.Magenta, Color.Empty, 4,
0,
true));
}
protected override void StartCalc(){
m_c_pierceline_dkcloud1.length = length;
m_c_pierceline_dkcloud1.opiercingline = m_opiercingline;
m_c_pierceline_dkcloud1.odarkcloud = m_odarkcloud;
}
protected override void CalcBar(){
m_c_pierceline_dkcloud1.Call();
if (m_opiercingline.Value == 1){
Plot1.Set(0, Bars.High[0]);
Alerts.Alert("PiercingLine");
}
else{
if (m_odarkcloud.Value == 1){
Plot2.Set(0, Bars.Low[0]);
Alerts.Alert("DarkCloud");
}
}
}
}
}