#property copyright "eevviill"
#property link "
[email protected]"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 OrangeRed
double ExtMapBuffer1[];
double ExtMapBuffer2[];
extern int MA_fast_period = 40;
extern int MA_slow_period = 60;
bool gi_76 = FALSE;
bool gi_80 = FALSE;
bool gi_84 = FALSE;
int gi_unused_104 = 0;
string gs_88 = "alert.wav";
double gd_unused_108 = 0.618;
int gi_116 = 3;
int gi_120 = 0;
int gi_124 = 0;
int gi_128 = 0;
double g_ibuf_132[];
double g_ibuf_136[];
double g_bars_140;
int init()
{
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(0,DRAW_ARROW,1,10);
SetIndexArrow(0,71);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(1,DRAW_ARROW,1,10);
SetIndexArrow(1,72);
return;
}
int start()
{
int li_4 = IndicatorCounted();
if (li_4 < 0) li_4 = 0;
if (li_4 > 0) li_4--;
int li_0 = Bars - li_4;
for (int li_8 = 0; li_8 < li_0; li_8++){
double MA1 = iMA(Symbol(),0,MA_fast_period,0,MODE_LWMA,PRICE_CLOSE,li_8+1);
double MA11 = iMA(Symbol(),0,MA_fast_period,0,MODE_LWMA,PRICE_CLOSE,li_8);
double MA2 = iMA(Symbol(),0,MA_slow_period,0,MODE_LWMA,PRICE_CLOSE,li_8+1);
double MA22 = iMA(Symbol(),0,MA_slow_period,0,MODE_LWMA,PRICE_CLOSE,li_8);
//if(MA11<MA22 && MA1>MA2) ExtMapBuffer1[li_8] =High[li_8]; //up
//if(MA11>MA22 && MA1<MA2) ExtMapBuffer2[li_8] =Low[li_8] ; //down
if (MA11 > MA22 + gi_128 * Point && MA1 <= MA2) {
ExtMapBuffer1[li_8] = iLow(Symbol(), 0, li_8) - 3.0 * Point;
ExtMapBuffer2[li_8] = EMPTY_VALUE;
if (gi_76 == TRUE) PlaySound(gs_88);
if (gi_84 == TRUE && Bars > g_bars_140) {
Alert(Symbol(), "Buy signal", Period());
g_bars_140 = Bars;
}
if (gi_80 == TRUE) Comment("Buy signal at Ask=", Ask, ", Bid=", Bid, ", Date=", TimeToStr(TimeCurrent(), TIME_DATE), " ", TimeHour(TimeCurrent()), ":", TimeMinute(TimeCurrent()), " Symbol=", Symbol(), " Period=", Period());
} else {
if (MA1 >= MA2 && MA11 < MA22 - gi_124 * Point) {
ExtMapBuffer1[li_8] = EMPTY_VALUE;
ExtMapBuffer2[li_8] = iHigh(Symbol(), 0, li_8) + 3.0 * Point;
if (gi_76 == TRUE) PlaySound(gs_88);
if (gi_84 == TRUE && Bars > g_bars_140) {
Alert(Symbol(), "Sell signal", Period());
g_bars_140 = Bars;
}
if (gi_80 == TRUE) Comment("Sell signal at Ask=", Ask, ", Bid=", Bid, ", Date=", TimeToStr(TimeCurrent(), TIME_DATE), " ", TimeHour(TimeCurrent()), ":", TimeMinute(TimeCurrent()), " Symbol=", Symbol(), " Period=", Period());
} else {
ExtMapBuffer1[li_8] = EMPTY_VALUE;
ExtMapBuffer2[li_8] = EMPTY_VALUE;
}
}
}
return;
}