-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCust_Gradient_Unbnd.Indicator.CS
More file actions
83 lines (68 loc) · 2.7 KB
/
Cust_Gradient_Unbnd.Indicator.CS
File metadata and controls
83 lines (68 loc) · 2.7 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Drawing;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
public class Cust_Gradient_Unbnd : IndicatorObject
{
private NormGradientColor m_normgradientcolor1;
private IPlotObject Plot1;
private IPlotObject Plot2;
private IPlotObject Plot3;
private IPlotObject Plot4;
public Cust_Gradient_Unbnd(object ctx) :
base(ctx){
dncolor = Color.Cyan;
upcolor = Color.Yellow;
colornormlength = 14;
}
private ISeries<double> formula { get; set; }
[Input]
public bool crosseszero { get; set; }
[Input]
public int colornormlength { get; set; }
[Input]
public Color upcolor { get; set; }
[Input]
public Color dncolor { get; set; }
protected override void Create(){
m_normgradientcolor1 = new NormGradientColor(this);
Plot1 =
AddPlot(new PlotAttributes("Plot1", EPlotShapes.BarHigh,
Color.White, Color.Empty, 0,
0,
true));
Plot2 =
AddPlot(new PlotAttributes("Plot2", EPlotShapes.BarLow,
Color.White, Color.Empty, 0,
0,
true));
Plot3 =
AddPlot(new PlotAttributes("Plot3", EPlotShapes.LeftTick,
Color.White, Color.Empty, 0,
0,
true));
Plot4 =
AddPlot(new PlotAttributes("Plot4", EPlotShapes.RightTick,
Color.White, Color.Empty, 0,
0,
true));
}
protected override void StartCalc(){
formula = Bars.Close;
m_normgradientcolor1.dataseriesvalue = formula;
m_normgradientcolor1.crosseszero = crosseszero;
m_normgradientcolor1.colornormlength = colornormlength;
m_normgradientcolor1.upcolor = upcolor;
m_normgradientcolor1.dncolor = dncolor;
}
protected override void CalcBar(){
var m_colorlevel = m_normgradientcolor1[0];
Plot1.Set(0, Bars.High[0], m_colorlevel);
Plot2.Set(0, Bars.Low[0], m_colorlevel);
Plot3.Set(0, Bars.Open[0], m_colorlevel);
Plot4.Set(0, Bars.Close[0], m_colorlevel);
}
}
}