求助:论坛下了个指标没报警功能,想请大神帮忙加个报警功能。1、图片所示的蓝色线和红色线一出现就发出报警。2、突破报警模式分为A即时突破报警和B换线突破报警,两种突破模式可切换。3、报警方式有:A声音报警B弹窗报警C电邮报警 三种方式可自由打开或关闭。谢谢!可私聊QQ:376746642
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 DimGray
#property indicator_color2 Black
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_color5 Black
extern int CCIPeriod = 14;
extern int CCIPrice = 5;
extern double OverSold = -100.0;
extern double OverBought = 100.0;
extern color OverSoldColor = Red;
extern color OverBoughtColor = DeepSkyBlue;
double G_ibuf_108[];
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];
double G_ibuf_124[];
double G_ibuf_128[];
double G_ibuf_132[];
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
IndicatorBuffers(7);
SetIndexBuffer(0, G_ibuf_108);
SetIndexBuffer(1, G_ibuf_112);
SetIndexStyle(1, DRAW_LINE, EMPTY, EMPTY, OverSoldColor);
SetIndexBuffer(2, G_ibuf_116);
SetIndexStyle(2, DRAW_LINE, EMPTY, EMPTY, OverSoldColor);
SetIndexBuffer(3, G_ibuf_120);
SetIndexStyle(3, DRAW_LINE, EMPTY, EMPTY, OverBoughtColor);
SetIndexBuffer(4, G_ibuf_124);
SetIndexStyle(4, DRAW_LINE, EMPTY, EMPTY, OverBoughtColor);
SetIndexBuffer(5, G_ibuf_128);
SetIndexBuffer(6, G_ibuf_132);
SetLevelValue(0, OverBought);
SetLevelValue(1, OverSold);
IndicatorShortName("CCI (" + CCIPeriod + ")");
return (0);
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
double Ld_16;
double Ld_24;
int Li_0 = IndicatorCounted();
if (Li_0 0) Li_0--;
int Li_12 = MathMin(Bars - Li_0, Bars - 1);
if (G_ibuf_132[Li_12] == 1.0) f0_0(Li_12, G_ibuf_112, G_ibuf_116);
if (G_ibuf_132[Li_12] == -1.0) f0_0(Li_12, G_ibuf_120, G_ibuf_124);
for (int Li_4 = Li_12; Li_4 >= 0; Li_4--) {
G_ibuf_128[Li_4] = iMA(NULL, 0, 1, 0, MODE_SMA, CCIPrice, Li_4);
Ld_16 = 0;
for (int count_8 = 0; count_8 OverBought) G_ibuf_132[Li_4] = 1;
if (G_ibuf_108[Li_4] OverSold && G_ibuf_108[Li_4] < OverBought) G_ibuf_132[Li_4] = 0;
if (G_ibuf_132[Li_4] == 1.0) f0_1(Li_4, G_ibuf_112, G_ibuf_116, G_ibuf_108);
if (G_ibuf_132[Li_4] == -1.0) f0_1(Li_4, G_ibuf_120, G_ibuf_124, G_ibuf_108);
}
return (0);
}
// 21F8D7C6ACBD885873A4BA3D594D41CD
void f0_0(int Ai_0, double &Ada_4[], double &Ada_8[]) {
if (Ada_8[Ai_0] != EMPTY_VALUE && Ada_8[Ai_0 + 1] != EMPTY_VALUE) {
Ada_8[Ai_0 + 1] = EMPTY_VALUE;
return;
}
if (Ada_4[Ai_0] != EMPTY_VALUE && Ada_4[Ai_0 + 1] != EMPTY_VALUE && Ada_4[Ai_0 + 2] == EMPTY_VALUE) Ada_4[Ai_0 + 1] = EMPTY_VALUE;
}
// D1B45A6FF1A5430B6E40FB3AD384517E
void f0_1(int Ai_0, double &Ada_4[], double &Ada_8[], double Ada_12[]) {
if (Ada_4[Ai_0 + 1] == EMPTY_VALUE) {
if (Ada_4[Ai_0 + 2] == EMPTY_VALUE) {
Ada_4[Ai_0] = Ada_12[Ai_0];
Ada_4[Ai_0 + 1] = Ada_12[Ai_0 + 1];
Ada_8[Ai_0] = EMPTY_VALUE;
return;
}
Ada_8[Ai_0] = Ada_12[Ai_0];
Ada_8[Ai_0 + 1] = Ada_12[Ai_0 + 1];
Ada_4[Ai_0] = EMPTY_VALUE;
return;
}
Ada_4[Ai_0] = Ada_12[Ai_0];
Ada_8[Ai_0] = EMPTY_VALUE;
}
|