|
|
@@ -15,7 +15,7 @@
|
|
15
|
15
|
//+------------------------------------------------------------------+
|
|
16
|
16
|
|
|
17
|
17
|
input string string_1 = "<><><><><><> General SETTINGS <><><><><><>"; //__
|
|
18
|
|
-input double threshold = 30.0; // Threshold Value
|
|
|
18
|
+input double threshold = 10.0; // Threshold Value
|
|
19
|
19
|
|
|
20
|
20
|
sinput string atrSettings = " <><><><><> Atr Settings <><><><><> "; //_
|
|
21
|
21
|
input int atrPeriod = 14; // ATR Period
|
|
|
@@ -39,8 +39,8 @@ int OnInit()
|
|
39
|
39
|
|
|
40
|
40
|
//--- Set buffer names
|
|
41
|
41
|
SetIndexLabel(0, "Atr %");
|
|
42
|
|
- SetIndexLabel(1, "Signal");
|
|
43
|
|
- SetIndexLabel(2, "No Signal");
|
|
|
42
|
+ SetIndexLabel(1, "Above threshold");
|
|
|
43
|
+ SetIndexLabel(2, "Below threshold");
|
|
44
|
44
|
|
|
45
|
45
|
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2, atr_line_color);
|
|
46
|
46
|
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 4, signal_color);
|
|
|
@@ -76,7 +76,7 @@ int OnCalculate(const int rates_total,
|
|
76
|
76
|
while(i >= 0)
|
|
77
|
77
|
{
|
|
78
|
78
|
double atrValueIs = atrValue(i);
|
|
79
|
|
-
|
|
|
79
|
+
|
|
80
|
80
|
double candle_0 = iClose(Symbol(), PERIOD_CURRENT, i);
|
|
81
|
81
|
double candle_1 = iClose(Symbol(), PERIOD_CURRENT, i + 1);
|
|
82
|
82
|
double candle_2 = iClose(Symbol(), PERIOD_CURRENT, i + 2);
|
|
|
@@ -96,6 +96,7 @@ int OnCalculate(const int rates_total,
|
|
96
|
96
|
double totalSum = value_1 + value_2 + value_3;
|
|
97
|
97
|
|
|
98
|
98
|
atrPercentageBuffer[i] = ((atrValueIs / candle_1) * 100);
|
|
|
99
|
+ //Print(" atrValueIs: ",atrValueIs," candle_1: ",candle_1," final: ",atrPercentageBuffer[i]);
|
|
99
|
100
|
atrPercentageBuffer[i] = atrPercentageBuffer[i] * 100;
|
|
100
|
101
|
|
|
101
|
102
|
if(totalSum > threshold)
|