SuperADX MQ4 indicator.......can anyone convert this to amibroker afl.......HELP

#1
The SuperADX Can Tell You When to Get Out By Calling Market Tops and Bottoms. It Also Does a Very Good Job of Not Giving Back Much Profit By Marking Tops/Bottoms Accurately! After that White Bar Plotted on the Above
Chart, Price Dropped Like a Rock.

Found this indicator file in a forum.......can anyone please convert this to afl......










/*
Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
Website: http://purebeam.biz
E-mail : [email protected]
*/

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Fuchsia
#property indicator_color3 Red
#property indicator_color4 White
#property indicator_color5 DarkViolet

/*#import "MT4.SuperADX_Indicator.dll"
bool Activate(int a0, int a1, string a2);
string GetLastErrorDescription();
#import*/

//extern string License = "Enter License key here";
extern int WhiteBarTrigger = 35;
extern int RedBarTrigger = 10;
extern int WavePeriod = 10;
extern int AvgPeriod = 21;
extern bool SoundAlert = FALSE;
extern bool EmailAlert = FALSE;
extern int NumberOfBarsToUse = 500;
double g_ibuf_112[];
double g_ibuf_116[];
double g_ibuf_120[];
double g_ibuf_124[];
double g_ibuf_128[];
double gda_132[];
double gda_136[];
double gda_140[];
double gda_144[];
double gda_148[];
double gda_152[];
double gda_156[];
double gda_160[];
int gi_164 = -50;
int gi_168 = 53;
int gi_172;
bool gi_176 = FALSE;
bool gi_180 = FALSE;
string gs_184;

int init() {
int li_8;
string ls_0 = "!SuperADX";
IndicatorShortName(ls_0);
ArrayResize(gda_140, Bars);
ArrayResize(gda_152, Bars);
ArrayResize(gda_144, Bars);
ArrayResize(gda_148, Bars);
ArrayResize(gda_132, Bars);
ArrayResize(gda_136, Bars);
ArrayResize(gda_156, Bars);
ArrayResize(gda_160, Bars);
SetIndexBuffer(0, g_ibuf_124);
SetIndexBuffer(1, g_ibuf_120);
SetIndexBuffer(2, g_ibuf_116);
SetIndexBuffer(3, g_ibuf_112);
SetIndexBuffer(4, g_ibuf_128);
SetIndexLabel(0, "Yellow Bar 53");
SetIndexLabel(1, "Magenta Bar 53");
SetIndexLabel(2, "Red Bar 53");
SetIndexLabel(3, "White Bar 53");
SetIndexLabel(4, "DarkViolet Bar 53");
SetIndexEmptyValue(0, 0);
SetIndexEmptyValue(0, 1);
SetIndexEmptyValue(0, 2);
SetIndexEmptyValue(0, 3);
SetIndexEmptyValue(0, 4);
SetIndexDrawBegin(0, 1);
SetIndexDrawBegin(1, 1);
SetIndexDrawBegin(2, 1);
SetIndexDrawBegin(3, 1);
SetIndexDrawBegin(4, 1);
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 4, Yellow);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 4, Fuchsia);
SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 4, Red);
SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 4, White);
SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 4, DarkViolet);
/*if (IsDemo()) li_8 = 1;
else li_8 = 2;
if (AccountNumber() == 0) gi_176 = TRUE;
gi_180 = Activate(AccountNumber(), li_8, License);
gs_184 = GetLastErrorDescription();*/
return (0);
}

int deinit() {
return (0);
}

int start() {
int li_unused_0;
int li_4;
double l_ima_on_arr_8;
int li_16;
bool li_48;
bool l_bool_52;
bool l_bool_56;
/*if (gi_176) {
if (AccountNumber() == 0) {
Comment("Connecting to server...");
return (0);
}
gi_176 = FALSE;
if (IsDemo()) li_unused_0 = 1;
else li_unused_0 = 2;
gi_180 = TRUE;
gs_184 = GetLastErrorDescription();
li_4 = 0;
} else li_4 = IndicatorCounted();
if (gi_180 == FALSE) {
Comment(gs_184);
return (0);
}
Comment("License Activated");*/
double l_icustom_20 = 0;
double l_icustom_28 = 0;
double l_icustom_36 = 0;
if (li_4 < 0) return (-1);
if (li_4 > 0) li_4--;
if (NumberOfBarsToUse == 0) li_16 = Bars - 1;
else li_16 = NumberOfBarsToUse;
for (int li_44 = li_16; li_44 > 0; li_44--) {
gda_140[li_44] = iMA(NULL, 0, WavePeriod, 0, MODE_EMA, PRICE_TYPICAL, li_44);
ArraySetAsSeries(gda_140, TRUE);
}
for (li_44 = li_16; li_44 > 0; li_44--) {
gda_152[li_44] = MathAbs((iHigh(NULL, 0, li_44) + iClose(NULL, 0, li_44) + iLow(NULL, 0, li_44)) / 3.0 - gda_140[li_44]);
ArraySetAsSeries(gda_152, TRUE);
}
for (li_44 = li_16; li_44 > 0; li_44--) {
l_ima_on_arr_8 = iMAOnArray(gda_152, 0, WavePeriod, 0, MODE_EMA, li_44);
gda_144[li_44] = l_ima_on_arr_8;
ArraySetAsSeries(gda_144, TRUE);
}
for (li_44 = li_16; li_44 > 0; li_44--) {
if (gda_144[li_44] > 0.0) gda_148[li_44] = ((iHigh(NULL, 0, li_44) + iClose(NULL, 0, li_44) + iLow(NULL, 0, li_44)) / 3.0 - gda_140[li_44]) / (0.015 * gda_144[li_44]);
else gda_148[li_44] = 0;
ArraySetAsSeries(gda_148, TRUE);
}
for (li_44 = li_16; li_44 > 0; li_44--) {
l_ima_on_arr_8 = iMAOnArray(gda_148, 0, AvgPeriod, 0, MODE_EMA, li_44);
gda_132[li_44] = l_ima_on_arr_8;
ArraySetAsSeries(gda_132, TRUE);
}
for (li_44 = li_16; li_44 > 0; li_44--) {
l_ima_on_arr_8 = iMAOnArray(gda_132, 0, 4, 0, MODE_SMA, li_44);
gda_136[li_44] = l_ima_on_arr_8;
ArraySetAsSeries(gda_136, TRUE);
}
for (li_44 = li_16 - 1; li_44 > 0; li_44--) {
if (gda_132[li_44] >= gda_136[li_44] && gda_132[li_44 + 1] <= gda_136[li_44 + 1] && gda_132[li_44] <= gi_164) gda_156[li_44] = 1;
else gda_156[li_44] = 0;
if (gda_132[li_44] <= gda_136[li_44] && gda_132[li_44 + 1] >= gda_136[li_44 + 1] && gda_132[li_44] >= gi_168) gda_160[li_44] = 1;
else gda_160[li_44] = 0;
}
for (li_44 = li_16 - 2; li_44 > 0; li_44--) {
l_icustom_20 = iCustom(NULL, 0, "SupportingADX", 14, NumberOfBarsToUse, 0, li_44);
l_icustom_28 = iCustom(NULL, 0, "SupportingADX", 14, NumberOfBarsToUse, 0, li_44 + 1);
l_icustom_36 = iCustom(NULL, 0, "SupportingADX", 14, NumberOfBarsToUse, 0, li_44 + 2);
li_48 = MACDSignal(li_44);
l_bool_52 = l_icustom_28 > WhiteBarTrigger && l_icustom_20 < l_icustom_28 && l_icustom_28 > l_icustom_36;
l_bool_56 = l_icustom_20 < RedBarTrigger && l_icustom_20 > l_icustom_28 && l_icustom_28 < l_icustom_36;
g_ibuf_112[li_44] = 0;
g_ibuf_120[li_44] = 0;
g_ibuf_128[li_44] = 0;
g_ibuf_124[li_44] = 0;
if (l_bool_52 && gda_156[li_44] != 0.0 || gda_160[li_44] != 0.0) {
g_ibuf_124[li_44] = 2.5 * l_icustom_20;
if (li_44 == 1) SendAlert("yb");
}
if (l_bool_52) {
if (li_48) {
g_ibuf_128[li_44] = 1.5 * l_icustom_20;
if (li_44 == 1) SendAlert("wbmacd");
} else {
g_ibuf_112[li_44] = 1.5 * l_icustom_20;
if (li_44 == 1) SendAlert("wb");
}
}
if (ThreeBars(li_44) && l_bool_52) {
g_ibuf_120[li_44] = 2.0 * l_icustom_20;
if (li_44 == 1) SendAlert("tb");
}
if (l_bool_56) {
g_ibuf_116[li_44] = 2.0 * l_icustom_20;
if (li_44 == 1) SendAlert("rb");
} else g_ibuf_116[li_44] = 0;
}
return (0);
}

int MACDSignal(int ai_0) {
double l_icustom_4 = iCustom(Symbol(), 0, "SupportingMACD", 12, 26, 9, 0, ai_0);
double l_icustom_12 = iCustom(Symbol(), 0, "SupportingMACD", 12, 26, 9, 0, ai_0 + 1);
double l_icustom_20 = iCustom(Symbol(), 0, "SupportingMACD", 12, 26, 9, 1, ai_0);
double l_icustom_28 = iCustom(Symbol(), 0, "SupportingMACD", 12, 26, 9, 1, ai_0 + 1);
if (l_icustom_4 > l_icustom_20 && l_icustom_12 <= l_icustom_28) return (1);
if (l_icustom_4 < l_icustom_20 && l_icustom_12 >= l_icustom_28) return (1);
return (0);
}

int ThreeBars(int ai_0) {
int l_count_4 = 0;
for (int l_count_8 = 0; l_count_8 < 16; l_count_8++)
if (g_ibuf_112[ai_0 + l_count_8] != 0.0 || g_ibuf_128[ai_0 + l_count_8] != 0.0) l_count_4++;
if (l_count_4 > 2) return (1);
return (0);
}

void SendAlert(string as_0) {
if (Time[1] != gi_172) {
if (SoundAlert) {
if (as_0 == "wb") Alert(Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " white bar");
if (as_0 == "wbmacd") Alert(Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " white bar + macd");
if (as_0 == "rb") Alert(Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " red bar");
if (as_0 == "tb") Alert(Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " three bars");
if (as_0 == "yb") Alert(Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " whitebar + trendwave");
}
if (EmailAlert) {
if (as_0 == "wb") SendMail("!SuperADX Alert", Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " white bar");
if (as_0 == "wbmacd") SendMail("!SuperADX Alert", Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " white bar + macd");
if (as_0 == "rb") SendMail("!SuperADX Alert", Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " red bar");
if (as_0 == "tb") SendMail("!SuperADX Alert", Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " three bars");
if (as_0 == "yb") SendMail("!SuperADX Alert", Symbol() + " => TF: " + Period() + "M => " + TimeToStr(TimeCurrent()) + " whitebar + trendwave");
}
gi_172 = Time[1];
}
}
 
#4
i think ,its very complicated in mt4 but its used macd,rsi, so that nothing special in this indicater..
happy smile...
if thers nothing special why is the mq formula so complicated........need to try and backtest to know if it useful or useless................hoping someone could help me and convert this formula to afl.
 
#6
I somehow found the complete pack along with the instructions manual but this is for MT4.........code looks extremely attractive and could be of great support for trading..........MT4 users can download the pack and have fun.....but it would be of great help if someone can convert the MONEYLINE AND SUPERADX codes for AMIBROKER AFL format..................a very huge thanks in advance if someone can help me.........






Plz someone convert this code for amibroker.......


praveen bhai did u use this indicator in gci mt4 demo version

www.gcitrading.com
 
#10
but I dont want to use MT4........but I want to use superadx in my amibroker.
mt4 platform par MCX aur nse ke data bhi available hai shayad ....maine kafi post padi hai ...tj par bhi aur google par bhi search kiya hai...

par mujhe mil nahi hai
woh mil jaaye to indian mkt ke data mt4 terminal par bhi dekh payenge agar aapko mile to mujhe bhi batana
 

Similar threads