帮助解答,非常感谢!下图中的向下红色箭头和向上兰色箭头的出现时如何自动发出警报?是ASCTrend1sig-imran这个指标
//+------------------------------------------------------------------+
//| ASCTrend1sig_noSound.mq4 |
//| Ramdass - Conversion only |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- input parameters
extern int RISK = 3;
extern int CountBars = 300;
//---- buffers
double val1[];
double val2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0, DRAW_ARROW, 0, 1);
SetIndexArrow(0, 234);
SetIndexStyle(1, DRAW_ARROW, 0, 1);
SetIndexArrow(1, 233);
SetIndexBuffer(0, val1);
SetIndexBuffer(1, val2);
if(CountBars >= 1000)
CountBars=950;
SetIndexDrawBegin(0, Bars - CountBars + 11 + 1);
SetIndexDrawBegin(1, Bars - CountBars + 11 + 1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| ASCTrend1sig |
//+------------------------------------------------------------------+
int start()
{
int i, shift, counted_bars = IndicatorCounted();
int Counter, i1, value10, value11;
double value1, x1, x2;
double value2, value3;
double TrueCount, Range, AvgRange, MRO1, MRO2;
double Table_value2[1000];
//----
value10 = 3 + RISK*2;
x1 = 67 + RISK;
x2 = 33 - RISK;
value11 = value10;
//----
if(Bars = Range*4.6)
TrueCount = TrueCount + 1;
Counter = Counter + 1;
}
//----
if(TrueCount >= 1)
{
MRO2 = Counter;
}
else
{
MRO2 = -1;
}
//----
if(MRO1 > -1)
{
value11 = 3;
}
else
{
value11 = value10;
}
//----
if(MRO2 > -1)
{
value11 = 4;
}
else
{
value11 = value10;
}
//----
value2 = 100 - MathAbs(iWPR(NULL, 0, value11, shift)); // PercentR(value11=9)
Table_value2[shift] = value2;
val1[shift] = 0;
val2[shift] = 0;
value3 = 0;
//----
if(value2 < x2)
{
i1 = 1;
while(Table_value2[shift + i1] >= x2 && Table_value2[shift+i1] x1)
{
value3 = High[shift] + Range*0.5;
val1[shift] = value3;
}
}
if(value2 > x1)
{
i1=1;
while(Table_value2[shift+i1] >= x2 && Table_value2[shift+i1] |