rEQUIRED AFL CODING FOR TREND DASHBOARD

#1
hi Amibrokerfans
and other experts
can you code this mt4 indicator into afl please!
------------------

/*
Generated by EX4-TO-MQ4 decompiler V4.0.225.1g []

*/

#property indicator_separate_window

string gs_unused_76 = "MACD Indicator Settings";
int g_period_84 = 12;
int g_period_88 = 26;
int g_period_92 = 9;
int g_applied_price_96 = PRICE_CLOSE;
string gs_unused_100 = "Stochastics Indicator Settings";
int g_period_108 = 8;
int g_period_112 = 3;
int g_slowing_116 = 3;
int gi_unused_120 = 80;
int gi_unused_124 = 20;
int g_price_field_128 = 0;
string gs_unused_132 = "RSI Indicator Settings";
int g_period_140 = 14;
int gi_144 = 50;
int g_applied_price_148 = PRICE_CLOSE;
int gi_unused_152 = 80;
int gi_unused_156 = 20;
string gs_unused_160 = "CCI Indicator Settings";
int g_period_168 = 14;
int g_applied_price_172 = PRICE_CLOSE;
int gi_176 = 0;
int gi_unused_180 = 100;
int gi_unused_184 = -100;
string gs_unused_188 = "ADX Indicator Settings";
int g_period_196 = 14;
int g_applied_price_200 = PRICE_CLOSE;
string gs_unused_204 = "Moving Averages 1";
int gi_unused_212 = 15;
int gi_unused_216 = 0;
int gi_unused_220 = 1;
string gs_unused_224 = "Moving Averages 2";
int gi_unused_232 = 50;
int gi_unused_236 = 0;
int gi_unused_240 = 1;
string gs_unused_244 = "Moving Averages 3";
int gi_unused_252 = 100;
int gi_unused_256 = 0;
int gi_unused_260 = 1;
string gs_unused_264 = "Momentum Settings";
int g_period_272 = 14;
int g_applied_price_276 = PRICE_CLOSE;
int gi_280 = 100;
string gs_unused_284 = "RVI Settings";
int g_period_292 = 14;
int gi_unused_296 = 0;
int gi_unused_300 = 100;
string gs_unused_304 = "Force Settings";
int g_period_312 = 14;
int g_applied_price_316 = PRICE_CLOSE;
int gi_320 = 0;
int g_ma_method_324 = MODE_SMA;
string gs_unused_328 = "Bull Settings";
int g_period_336 = 14;
int g_applied_price_340 = PRICE_CLOSE;
int gi_344 = 0;
string gs_unused_348 = "Bear Settings";
int g_period_356 = 14;
int g_applied_price_360 = PRICE_CLOSE;
int gi_364 = 0;
int gi_unused_368 = 21;
int gia_372[] = {1, 5, 15, 30, 60, 240, 1440, 10080};
string gsa_376[] = {"1M", "5M", "15M", "30M", "1H", "4H", "D1", "W1"};
string gsa_380[] = {"10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"};
string gsa_384[] = {"MA1", "MA2", "MA3", "MACD", "RSI", "CCI", "ADX", "STO", "MOM", "RVI", "FOR", "BULL", "BEAR", "ATR"};
int gi_388 = 50;
int gi_392 = 20;
int gi_396 = 0;
int gi_400 = 100;
int g_y_404 = 20;
int g_fontsize_408 = 10;
int gi_unused_412 = 42;
int gi_unused_416 = 232;
string gs_unused_420 = "-";
double g_irsi_428;
double g_irsi_436;
double g_icci_444;
double g_icci_452;
double g_iadx_460;
double g_iadx_468;
double g_iadx_476;
double g_istochastic_484;
double g_istochastic_492;
double g_imomentum_500;
double g_imacd_508;
double g_imacd_516;
double g_irvi_524;
double g_irvi_532;
double g_iforce_540;
double g_ibullspower_556;
double g_ibearspower_572;

int init() {
IndicatorShortName("Trend Strength");
return (0);
}

int deinit() {
for (int l_count_0 = 0; l_count_0 < 10; l_count_0++) {
ObjectDelete("TS_txtPer" + l_count_0);
ObjectDelete("TS_txtArrow1" + l_count_0);
ObjectDelete("TS_txtArrow2" + l_count_0);
}
ObjectDelete("TS_txtUp");
ObjectDelete("TS_txtDn");
return (0);
}

int start() {
int l_ind_counted_0 = IndicatorCounted();
double ld_4 = 0;
double ld_12 = 0;
for (int l_index_20 = 0; l_index_20 < 10; l_index_20++) {
ObjectCreate("TS_txtPer" + l_index_20, OBJ_LABEL, WindowFind("Trend Strength"), 0, 0);
ObjectSetText("TS_txtPer" + l_index_20, gsa_380[l_index_20], g_fontsize_408, "Tahoma", LightSteelBlue);
ObjectSet("TS_txtPer" + l_index_20, OBJPROP_CORNER, 0);
ObjectSet("TS_txtPer" + l_index_20, OBJPROP_XDISTANCE, l_index_20 * gi_388 + gi_400);
ObjectSet("TS_txtPer" + l_index_20, OBJPROP_YDISTANCE, g_y_404);
}
for (l_index_20 = 0; l_index_20 < 10; l_index_20++) {
ObjectCreate("TS_txtArrow1" + l_index_20, OBJ_LABEL, WindowFind("Trend Strength"), 0, 0);
ObjectSetText("TS_txtArrow1" + l_index_20, CharToStr(232), 12, "Wingdings", C'0x1E,0x1E,0x1E');
ObjectSet("TS_txtArrow1" + l_index_20, OBJPROP_CORNER, 0);
ObjectSet("TS_txtArrow1" + l_index_20, OBJPROP_XDISTANCE, l_index_20 * gi_388 + gi_400);
ObjectSet("TS_txtArrow1" + l_index_20, OBJPROP_YDISTANCE, g_y_404 + 1 * gi_392);
}
for (l_index_20 = 0; l_index_20 < 10; l_index_20++) {
ObjectCreate("TS_txtArrow2" + l_index_20, OBJ_LABEL, WindowFind("Trend Strength"), 0, 0);
ObjectSetText("TS_txtArrow2" + l_index_20, CharToStr(232), 12, "Wingdings", C'0x1E,0x1E,0x1E');
ObjectSet("TS_txtArrow2" + l_index_20, OBJPROP_CORNER, 0);
ObjectSet("TS_txtArrow2" + l_index_20, OBJPROP_XDISTANCE, l_index_20 * gi_388 + gi_400);
ObjectSet("TS_txtArrow2" + l_index_20, OBJPROP_YDISTANCE, g_y_404 + gi_392 * 2);
}
ObjectCreate("TS_txtUp", OBJ_LABEL, WindowFind("Trend Strength"), 0, 0);
ObjectSetText("TS_txtUp", "Up Trend", 8, "Tahoma", Lime);
ObjectSet("TS_txtUp", OBJPROP_CORNER, 0);
ObjectSet("TS_txtUp", OBJPROP_XDISTANCE, gi_400 - 60);
ObjectSet("TS_txtUp", OBJPROP_YDISTANCE, g_y_404 + 1 * gi_392);
ObjectCreate("TS_txtDn", OBJ_LABEL, WindowFind("Trend Strength"), 0, 0);
ObjectSetText("TS_txtDn", "Down Trend", 8, "Tahoma", Fuchsia);
ObjectSet("TS_txtDn", OBJPROP_CORNER, 0);
ObjectSet("TS_txtDn", OBJPROP_XDISTANCE, gi_400 - 60);
ObjectSet("TS_txtDn", OBJPROP_YDISTANCE, g_y_404 + gi_392 * 2);
g_irsi_428 = iRSI(NULL, 0, g_period_140, g_applied_price_148, gi_396);
g_irsi_436 = iRSI(NULL, 0, g_period_140, g_applied_price_148, gi_396 + 1);
if (g_irsi_428 >= gi_144) ld_4 += 1.0;
if (g_irsi_428 < gi_144) ld_12 += 1.0;
g_icci_444 = iCCI(NULL, 0, g_period_168, g_applied_price_172, gi_396);
g_icci_452 = iCCI(NULL, 0, g_period_168, g_applied_price_172, gi_396 + 1);
if (g_icci_444 >= gi_176) ld_4 += 1.0;
if (g_icci_444 < gi_176) ld_12 += 1.0;
g_iadx_460 = iADX(NULL, 0, g_period_196, g_applied_price_200, MODE_MAIN, gi_396);
g_iadx_468 = iADX(NULL, 0, g_period_196, g_applied_price_200, MODE_PLUSDI, gi_396);
g_iadx_476 = iADX(NULL, 0, g_period_196, g_applied_price_200, MODE_MINUSDI, gi_396);
if (g_iadx_460 > g_iadx_468 && g_iadx_460 > g_iadx_476 && g_iadx_468 >= g_iadx_476) ld_4 += 1.0;
if (g_iadx_460 > g_iadx_468 && g_iadx_460 > g_iadx_476 && g_iadx_468 < g_iadx_476) ld_12 += 1.0;
g_istochastic_484 = iStochastic(NULL, 0, g_period_108, g_period_112, g_slowing_116, MODE_SMA, g_price_field_128, MODE_MAIN, gi_396);
g_istochastic_492 = iStochastic(NULL, 0, g_period_108, g_period_112, g_slowing_116, MODE_SMA, g_price_field_128, MODE_SIGNAL, gi_396);
if (g_istochastic_484 >= g_istochastic_492) ld_4 += 1.0;
if (g_istochastic_484 < g_istochastic_492) ld_12 += 1.0;
g_imomentum_500 = iMomentum(NULL, 0, g_period_272, g_applied_price_276, gi_396);
if (g_imomentum_500 >= gi_280) ld_4 += 1.0;
if (g_imomentum_500 < gi_280) ld_12 += 1.0;
g_imacd_508 = iMACD(NULL, 0, g_period_84, g_period_88, g_period_92, g_applied_price_96, MODE_MAIN, gi_396);
g_imacd_516 = iMACD(NULL, 0, g_period_84, g_period_88, g_period_92, g_applied_price_96, MODE_SIGNAL, gi_396);
if (g_imacd_508 >= g_imacd_516) ld_4 += 1.0;
if (g_imacd_508 < g_imacd_516) ld_12 += 1.0;
g_irvi_524 = iRVI(NULL, 0, g_period_292, MODE_MAIN, gi_396);
g_irvi_532 = iRVI(NULL, 0, g_period_292, MODE_SIGNAL, gi_396);
if (g_irvi_524 >= g_irvi_532) ld_4 += 1.0;
if (g_irvi_524 < g_irvi_532) ld_12 += 1.0;
g_iforce_540 = iForce(NULL, 0, g_period_312, g_ma_method_324, g_applied_price_316, gi_396);
if (g_iforce_540 >= gi_320) ld_4 += 1.0;
if (g_iforce_540 < gi_320) ld_12 += 1.0;
g_ibullspower_556 = iBullsPower(NULL, 0, g_period_336, g_applied_price_340, gi_396);
if (g_ibullspower_556 >= gi_344) ld_4 += 1.0;
if (g_ibullspower_556 < gi_344) ld_12 += 1.0;
g_ibearspower_572 = iBearsPower(NULL, 0, g_period_356, g_applied_price_360, gi_396);
if (g_ibearspower_572 > gi_364) ld_4 += 1.0;
if (g_ibearspower_572 < gi_364) ld_12 += 1.0;
DrawUpArrow(ld_4);
DrawDnArrow(ld_12);
return (0);
}

void DrawUpArrow(double ad_0) {
if (ad_0 > 9.0) ObjectSet("TS_txtArrow19", OBJPROP_COLOR, LawnGreen);
if (ad_0 > 8.0) ObjectSet("TS_txtArrow18", OBJPROP_COLOR, LawnGreen);
if (ad_0 > 7.0) ObjectSet("TS_txtArrow17", OBJPROP_COLOR, Chartreuse);
if (ad_0 > 6.0) ObjectSet("TS_txtArrow16", OBJPROP_COLOR, Lime);
if (ad_0 > 5.0) ObjectSet("TS_txtArrow15", OBJPROP_COLOR, LimeGreen);
if (ad_0 > 4.0) ObjectSet("TS_txtArrow14", OBJPROP_COLOR, ForestGreen);
if (ad_0 > 3.0) ObjectSet("TS_txtArrow13", OBJPROP_COLOR, ForestGreen);
if (ad_0 > 2.0) ObjectSet("TS_txtArrow12", OBJPROP_COLOR, Green);
if (ad_0 > 1.0) ObjectSet("TS_txtArrow11", OBJPROP_COLOR, Green);
ObjectSet("TS_txtArrow10", OBJPROP_COLOR, DarkGreen);
}

void DrawDnArrow(double ad_0) {
if (ad_0 > 9.0) ObjectSet("TS_txtArrow29", OBJPROP_COLOR, OrangeRed);
if (ad_0 > 8.0) ObjectSet("TS_txtArrow28", OBJPROP_COLOR, OrangeRed);
if (ad_0 > 7.0) ObjectSet("TS_txtArrow27", OBJPROP_COLOR, Red);
if (ad_0 > 6.0) ObjectSet("TS_txtArrow26", OBJPROP_COLOR, Red);
if (ad_0 > 5.0) ObjectSet("TS_txtArrow25", OBJPROP_COLOR, Crimson);
if (ad_0 > 4.0) ObjectSet("TS_txtArrow24", OBJPROP_COLOR, Crimson);
if (ad_0 > 3.0) ObjectSet("TS_txtArrow23", OBJPROP_COLOR, FireBrick);
if (ad_0 > 2.0) ObjectSet("TS_txtArrow22", OBJPROP_COLOR, FireBrick);
if (ad_0 > 1.0) ObjectSet("TS_txtArrow21", OBJPROP_COLOR, Maroon);
ObjectSet("TS_txtArrow20", OBJPROP_COLOR, Maroon);
}
 

Similar threads