Please help me to use this custom indicator in my ea

 

I have the indicator as below.

I would like to use this to place order in the ea, can someone please help?

I would like to place buy order when the green dot firmed (2nd green dot appeared). My buy order will be at the last Fuchsia dot.

Please help me in placing order, thanks

Indicator : Price_Stop V1

-----------------------------
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Green
#property indicator_color2 Fuchsia
#property indicator_color3 Green
#property indicator_color4 Fuchsia
#property indicator_color5 Green
#property indicator_color6 Fuchsia

extern double DeviationBands = 1.5;
extern int Length = 14;
extern int Displace = 0;
extern double PctFilter = 0.0;
extern double Deviation = 0.0;
extern bool EmailON = TRUE;
extern bool SoundON = TRUE;
extern bool AlertON = TRUE;
extern int AlertRepeat = 3;
extern bool EndLessRepeat = FALSE;
extern string SoundFile = "Alert";
extern int Nbars = -1;
int g_applied_price_140 = PRICE_CLOSE;
int gi_unused_144 = 0;
int gi_unused_148 = 1;
double gd_152 = 1.0;
int gi_160 = 1;
int gi_164 = 1;
double g_ibuf_168[];
double g_ibuf_172[];
double g_ibuf_176[];
double g_ibuf_180[];
double g_ibuf_184[];
double g_ibuf_188[];
bool gi_unused_192 = FALSE;
bool gi_unused_196 = FALSE;
double gda_200[];
int g_index_204;
int gi_208;
int gi_212;
int gi_216 = 4;
double gd_220;
double gd_228;
double gd_236;
double gd_244;
double gd_252;
double gd_260;
double gd_268 = 3.1415926535;
double gda_276[];
double gda_280[];
double gda_284[];
double gda_288[];
double gda_292[];
double gda_296[];
double gda_300[];
double gda_304[];
double gda_308[];
double gda_312[];
int gi_316;
int gi_320;
int g_datetime_324;
int g_datetime_328;
int gi_332 = 0;
int gi_336 = 0;

int init() {
Comment("",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"\n");
ObjectDelete("Bell");
gd_220 = 3.0 * gd_268;
gi_208 = Length - 1;
gi_212 = Length * gi_216 + gi_208;
ArrayResize(gda_200, gi_212);
gd_252 = 0;
for (g_index_204 = 0; g_index_204 < gi_212 - 1; g_index_204++) {
if (g_index_204 <= gi_208 - 1) gd_236 = 1.0 * g_index_204 / (gi_208 - 1);
else gd_236 = (g_index_204 - gi_208 + 1) * (2.0 * gi_216 - 1.0) / (gi_216 * Length - 1.0) + 1.0;
gd_228 = MathCos(gd_268 * gd_236);
gd_260 = 1.0 / (gd_220 * gd_236 + 1.0);
if (gd_236 <= 0.5) gd_260 = 1;
gda_200[g_index_204] = gd_260 * gd_228;
gd_252 += gda_200[g_index_204];
}
gi_316 = 0;
gi_320 = 0;
SetIndexBuffer(0, g_ibuf_168);
SetIndexBuffer(1, g_ibuf_172);
SetIndexBuffer(2, g_ibuf_176);
SetIndexBuffer(3, g_ibuf_180);
SetIndexBuffer(4, g_ibuf_184);
SetIndexBuffer(5, g_ibuf_188);
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 1);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 1);
SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, 1);
SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID, 1);
SetIndexStyle(4, DRAW_LINE);
SetIndexStyle(5, DRAW_LINE);
SetIndexArrow(0, 159);
SetIndexArrow(1, 159);
SetIndexArrow(2, 108);
SetIndexArrow(3, 108);
IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
string ls_0 = "Price Stop(" + Length + "," + Deviation + ")";
IndicatorShortName("Price_Stop");
SetIndexLabel(0, "UpTrend Stop");
SetIndexLabel(1, "DownTrend Stop");
SetIndexLabel(2, "UpTrend Signal");
SetIndexLabel(3, "DownTrend Signal");
SetIndexLabel(4, "UpTrend Line");
SetIndexLabel(5, "DownTrend Line");
SetIndexDrawBegin(0, Length);
SetIndexDrawBegin(1, Length);
SetIndexDrawBegin(2, Length);
SetIndexDrawBegin(3, Length);
SetIndexDrawBegin(4, Length);
SetIndexDrawBegin(5, Length);
return (0);
}

int deinit() {
ObjectDelete("Bell");
return (0);
}

void start() {
double l_ima_0;
double ld_8;
double ld_16;
double ld_24;
double ld_32;
double ld_40;
double ld_48;
double ld_56;
int li_64 = Bars - MathMax(gi_212, Length) - 1.0;
int li_68 = Bars - IndicatorCounted();
if (ArraySize(gda_284) < Bars) {
ArraySetAsSeries(gda_284, FALSE);
ArraySetAsSeries(gda_276, FALSE);
ArraySetAsSeries(gda_280, FALSE);
ArraySetAsSeries(gda_288, FALSE);
ArraySetAsSeries(gda_292, FALSE);
ArraySetAsSeries(gda_296, FALSE);
ArraySetAsSeries(gda_308, FALSE);
ArraySetAsSeries(gda_312, FALSE);
ArraySetAsSeries(gda_300, FALSE);
ArraySetAsSeries(gda_304, FALSE);
ArrayResize(gda_284, Bars);
ArrayResize(gda_276, Bars);
ArrayResize(gda_280, Bars);
ArrayResize(gda_288, Bars);
ArrayResize(gda_292, Bars);
ArrayResize(gda_296, Bars);
ArrayResize(gda_308, Bars);
ArrayResize(gda_312, Bars);
ArrayResize(gda_300, Bars);
ArrayResize(gda_304, Bars);
ArraySetAsSeries(gda_284, TRUE);
ArraySetAsSeries(gda_276, TRUE);
ArraySetAsSeries(gda_280, TRUE);
ArraySetAsSeries(gda_288, TRUE);
ArraySetAsSeries(gda_292, TRUE);
ArraySetAsSeries(gda_296, TRUE);
ArraySetAsSeries(gda_308, TRUE);
ArraySetAsSeries(gda_312, TRUE);
ArraySetAsSeries(gda_300, TRUE);
ArraySetAsSeries(gda_304, TRUE);
}
int li_72 = MathMin(li_68, li_64);
for (int li_76 = li_72 - 1; li_76 >= 0; li_76--) {
gd_244 = 0;
for (int l_index_80 = 0; l_index_80 <= gi_212 - 1; l_index_80++) {
l_ima_0 = iMA(NULL, 0, 1, 0, MODE_LWMA, g_applied_price_140, l_index_80 + li_76);
gd_244 += gda_200[l_index_80] * l_ima_0;
}
if (gd_252 > 0.0) gda_284[li_76] = (Deviation / 100.0 + 1.0) * gd_244 / gd_252;
if (PctFilter > 0.0) {
gda_276[li_76] = MathAbs(gda_284[li_76] - (gda_284[li_76 + 1]));
ld_8 = 0;
for (l_index_80 = 0; l_index_80 <= Length - 1; l_index_80++) ld_8 += gda_276[li_76 + l_index_80];
gda_280[li_76] = ld_8 / Length;
ld_16 = 0;
for (l_index_80 = 0; l_index_80 <= Length - 1; l_index_80++) ld_16 += MathPow(gda_276[li_76 + l_index_80] - (gda_280[li_76 + l_index_80]), 2);
ld_24 = MathSqrt(ld_16 / Length);
ld_32 = PctFilter * ld_24;
if (MathAbs(gda_284[li_76] - (gda_284[li_76 + 1])) < ld_32) gda_284[li_76] = gda_284[li_76 + 1];
}
}
for (l_index_80 = li_72 - 1; l_index_80 >= 0; l_index_80--) {
ld_40 = 0;
for (int l_count_84 = 0; l_count_84 < Length; l_count_84++) ld_40 += Close[l_index_80 + l_count_84];
ld_48 = ld_40 / Length;
ld_40 = 0;
for (l_count_84 = 0; l_count_84 < Length; l_count_84++) ld_40 += (Close[l_index_80 + l_count_84] - ld_48) * (Close[l_index_80 + l_count_84] - ld_48);
ld_56 = MathSqrt(ld_40 / Length);
gda_288[l_index_80] = gda_284[l_index_80] + DeviationBands * ld_56;
gda_292[l_index_80] = gda_284[l_index_80] - DeviationBands * ld_56;
}
if (Nbars > 0) {
SetIndexDrawBegin(0, Bars - Nbars);
SetIndexDrawBegin(1, Bars - Nbars);
SetIndexDrawBegin(2, Bars - Nbars);
SetIndexDrawBegin(3, Bars - Nbars);
SetIndexDrawBegin(4, Bars - Nbars);
SetIndexDrawBegin(5, Bars - Nbars);
}
gda_308[li_64] = gda_288[li_64];
gda_312[li_64] = gda_292[li_64];
for (li_76 = li_72 - 1; li_76 >= 0; li_76--) {
g_ibuf_168[li_76] = 0;
g_ibuf_172[li_76] = 0;
g_ibuf_176[li_76] = 0;
g_ibuf_180[li_76] = 0;
g_ibuf_184[li_76] = EMPTY_VALUE;
g_ibuf_188[li_76] = EMPTY_VALUE;
gda_296[li_76] = gda_296[li_76 + 1];
gda_308[li_76] = gda_288[li_76];
gda_312[li_76] = gda_292[li_76];
if (Close[li_76] > gda_308[li_76 + 1]) gda_296[li_76] = 1;
if (Close[li_76] < gda_312[li_76 + 1]) gda_296[li_76] = -1;
if (gda_296[li_76] > 0.0 && gda_312[li_76] < gda_312[li_76 + 1]) gda_312[li_76] = gda_312[li_76 + 1];
if (gda_296[li_76] < 0.0 && gda_308[li_76] > gda_308[li_76 + 1]) gda_308[li_76] = gda_308[li_76 + 1];
gda_300[li_76] = gda_308[li_76] + (gd_152 - 1.0) / 2.0 * (gda_308[li_76] - gda_312[li_76]);
gda_304[li_76] = gda_312[li_76] - (gd_152 - 1.0) / 2.0 * (gda_308[li_76] - gda_312[li_76]);
if (gda_296[li_76] > 0.0 && gda_304[li_76] < gda_304[li_76 + 1]) gda_304[li_76] = gda_304[li_76 + 1];
if (gda_296[li_76] < 0.0 && gda_300[li_76] > gda_300[li_76 + 1]) gda_300[li_76] = gda_300[li_76 + 1];
if (gda_296[li_76] > 0.0) {
if (gi_160 > 0 && g_ibuf_168[li_76 + 1] == -1.0) {
g_ibuf_176[li_76] = gda_304[li_76];
g_ibuf_168[li_76] = gda_304[li_76];
if (gi_164 > 0) g_ibuf_184[li_76] = gda_304[li_76];
} else {
g_ibuf_168[li_76] = gda_304[li_76];
if (gi_164 > 0) g_ibuf_184[li_76] = gda_304[li_76];
g_ibuf_176[li_76] = -1;
}
if (gi_160 == 2) g_ibuf_168[li_76] = 0;
g_ibuf_180[li_76] = -1;
g_ibuf_172[li_76] = -1.0;
g_ibuf_188[li_76] = EMPTY_VALUE;
}
if (gda_296[li_76] < 0.0) {
if (gi_160 > 0 && g_ibuf_172[li_76 + 1] == -1.0) {
g_ibuf_180[li_76] = gda_300[li_76];
g_ibuf_172[li_76] = gda_300[li_76];
if (gi_164 > 0) g_ibuf_188[li_76] = gda_300[li_76];
} else {
g_ibuf_172[li_76] = gda_300[li_76];
if (gi_164 > 0) g_ibuf_188[li_76] = gda_300[li_76];
g_ibuf_180[li_76] = -1;
}
if (gi_160 == 2) g_ibuf_172[li_76] = 0;
g_ibuf_176[li_76] = -1;
g_ibuf_168[li_76] = -1.0;
g_ibuf_184[li_76] = EMPTY_VALUE;
}
}
int li_88 = 1;
if (g_ibuf_176[li_88] != -1.0 && g_ibuf_176[li_88] != 0.0 && g_ibuf_176[li_88] != EMPTY_VALUE) {
if (Time[0] != gi_332) {
gi_332 = Time[0];
if (EmailON) SendMail("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + ")", "Price Stop going Up");
if (SoundON || AlertON) {
fObjLabel("Bell", 100, 100, StringSetChar("", 0, '%'), 3, Red, 16, 0, "Wingdings", FALSE);
if (EndLessRepeat) gi_316 = 1;
else gi_316 = AlertRepeat;
g_datetime_324 = 0;
gi_320 = 0;
}
}
}
if (g_ibuf_180[li_88] != -1.0 && g_ibuf_180[li_88] != 0.0 && g_ibuf_180[li_88] != EMPTY_VALUE) {
if (Time[0] != gi_336) {
gi_336 = Time[0];
if (EmailON) SendMail("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + ")", "Price Stop going Down");
if (SoundON || AlertON) {
fObjLabel("Bell", 100, 100, StringSetChar("", 0, '%'), 3, Red, 16, 0, "Wingdings", FALSE);
if (EndLessRepeat) gi_320 = 1;
else gi_320 = AlertRepeat;
g_datetime_328 = 0;
gi_316 = 0;
}
}
}
if (ObjectFind("Bell") == 0) {
if (gi_316 > 0) {
if (TimeLocal() > g_datetime_324 + 1) {
if (!EndLessRepeat) gi_316--;
g_datetime_324 = TimeLocal();
if (AlertON) Alert("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + "): Price Stop going UP");
if (SoundON) {
Print("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + "): Price Stopgoing UP");
PlaySound(SoundFile);
}
}
}
if (gi_320 > 0) {
if (TimeLocal() > g_datetime_328 + 1) {
if (!EndLessRepeat) gi_320--;
g_datetime_328 = TimeLocal();
if (AlertON) Alert("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + "): Price Stop going DOWN");
if (SoundON) {
Print("Price Stop(" + Symbol() + " " + fTimeFrameName(Period()) + "): Price Stop going DOWN");
PlaySound(SoundFile);
}
}
}
}
if (gi_320 <= 0 && gi_316 <= 0) ObjectDelete("Bell");
}

string fTimeFrameName(int ai_0) {
int l_timeframe_4;
if (ai_0 == 0) l_timeframe_4 = Period();
else l_timeframe_4 = ai_0;
switch (l_timeframe_4) {
case 0:
return ("0");
case PERIOD_M1:
return ("M1");
case PERIOD_M5:
return ("M5");
case PERIOD_M15:
return ("M15");
case PERIOD_M30:
return ("M30");
case PERIOD_H1:
return ("H1");
case PERIOD_H4:
return ("H4");
case PERIOD_D1:
return ("D1");
case PERIOD_W1:
return ("W1");
case PERIOD_MN1:
return ("MN1");
}
return ("Wrong TimeFrame");
}

void fObjLabel(string a_name_0, int a_x_8, int a_y_12, string a_text_16, int a_corner_24 = 0, color a_color_28 = 255, int a_fontsize_32 = 8, int a_window_36 = 0, string a_fontname_40 = "Arial", bool a_bool_48 = FALSE) {
if (ObjectFind(a_name_0) != a_window_36) ObjectCreate(a_name_0, OBJ_LABEL, a_window_36, 0, 0);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_8);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_12);
ObjectSetText(a_name_0, a_text_16, a_fontsize_32, a_fontname_40, a_color_28);
ObjectSet(a_name_0, OBJPROP_BACK, a_bool_48);
ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_24);
}

 

Are you kidding?

Who is going to read such a code? no comments, no format....

Basically, YOU know what parameters change and when, so your EA should address these parameters. For instance: when buffer 3 changes value.

 

That code is a DECOMPILE.

He didn't write it.

Nobody writes if (gda_296[li_76] > 0.0 && gda_312[li_76] < gda_312[li_76 + 1]) gda_312[li_76] = gda_312[li_76 + 1];

read as:

if ( global double array #296 [ local integer #76 ] < global double array #312 [ local integer #76 + 1 ] ...and so on...

.

Here's an example of source.mq4 -> compiler -> ex4 -> decompiler -> text file

http://ellipse.mine.nu/public/ircforex/decompile.txt

Do those variable names look familiar?

Reason: