Jump to content

REQ Super ADX


Recommended Posts

Inputs: WavePeriod(10)

,OverSold(- 60)

,OverBought(60)

,uptrigger(- 50)

,dntrigger(53)

,Greendot(4)

,RedDot(5)

,upcolour(2)

,downcolour(6)

,colourDeltaBar(1)

,FastLength(12)

,SlowLength(26)

,MACDLength(9)

,WhiteBarSpacing(10)

,color1(2)

,color2(7)

,color3(6)

,HIALERT1(35)

,LOALERT1(20)

,LOALERT2(10)

;

{ ***** VARs Section ***** }

 

Vars: Var1(21)

,Var2(0)

,Var3(0)

,Var4(0)

,Var5(0)

,Var6(0)

,Var7(0)

,Var8(FALSE)

,Var9(0)

,Var10(0)

,Var11(0)

,Var12(FALSE)

,Var13(0)

,Var14(" ")

,Var15(0)

,Var16(FALSE)

,Var17(0)

,Var18(0)

,Var19(0)

,Var20(FALSE)

,Var21(FALSE)

;

{ ***** ARRAYs Section *****}

{ ***** CODE Section ***** }

#EVENTS OnDestroy = EasyLanguageRtlOnDestroy ;

#END ;

 

if CurrentBar = 1 then

begin

Var13 = GetAppInfo (1) ;

end ;

 

if Var18 = 1 then

begin

{if ok2tradeMatrix then}

Var18 = 0 ;

end ;

 

if Var18 = 0 then

begin

 

Var2 = (HIGH+LOW+CLOSE)/3 ;

Var3 = xaverage (Var2, WavePeriod) ;

Var4 = xaverage (AbsValue (Var2-Var3), WavePeriod) ;

 

if Var4 > 0 then

Var5 = (Var2-Var3)/(0.015000*Var4) ;

 

Var6 = xaverage (Var5, Var1) ;

Var7 = average (Var6, 4) ;

Var8 = FALSE ;

 

if Var6 CROSS OVER Var7 AND Var6 < uptrigger then

Var8 = TRUE ;

 

if Var7 CROSS OVER Var6 AND Var6 > dntrigger then

Var8 = TRUE ;

 

Var9 = MACD (CLOSE, FastLength, SlowLength) ;

Var10 = XAverage (Var9, MACDLength) ;

Var11 = Var9-Var10 ;

Var12 = FALSE ;

 

if (Var9 > Var10 AND Var9[1] < Var10[1]) OR (Var9 < Var10 AND Var9[1] > Var10[1]) then

Var12 = TRUE ;

 

Var19 = ADX (14) ;

Var20 = Var19[1] > HIALERT1 AND Var19 < Var19[1] AND Var19[1] > Var19[2] ;

 

if (Var20) then

begin

if (Var15 = 0) then

begin

Var15 = 1 ;

Var17 = CurrentBar ;

end ELSE if (CurrentBar-Var17 <= WhiteBarSpacing) then

begin

Var15 = Var15+1 ;

Var17 = CurrentBar ;

end ;

end ELSE if (CurrentBar-Var17 > WhiteBarSpacing) then

Var15 = 0 ;

 

Var21 = Var19 < LOALERT2 AND Var19 > Var19[1] AND Var19[1] < Var19[2] ;

 

if Var13 = 1 then

begin

if Var20 then if Var8 then

PLOT7 (Var19*2.500000, "WaveTrend", 7) ;

 

if Var20 then if Var12 then

PLOT1 (Var19*1.500000, "Dn Reversal", 12) ELSE PLOT1 (Var19*1.500000, "Dn Reversal", 8) ;

 

if (Var15 >= 3) then

begin

 

if (Var17 = CurrentBar) then

begin

PLOT2 (Var19*2, "Close Bars", 5) ;

 

if CHECKALERT then

ALERT ("3 White Bars") ;

Var16 = TRUE ;

end ;

end ;

 

if Var21 then

PLOT3 (Var19*3, "Up Reverse 2", 6) ;

 

if Var20 = FALSE AND Var21 = FALSE then

PLOT4 (Var19, "ADX", 1) ;

 

if CHECKALERT then

begin

if Var21 then ALERT ("ADX Turn Alert") ;

end ;

end ;

 

if Var13 > 1 then

begin

PLOT10 (Var19, "ADX", 7) ;

 

if Var20 then

begin

Var14 = "DownReversal" ;

SETPLOTBGCOLOR (11, 8) ;

[Legacycolorvalue = True]

end ELSE if (Var15 >= 3) then

begin

if (Var17 = CurrentBar) then

begin

Var14 = "3 White Bars" ;

SETPLOTBGCOLOR (11, 5) ;

Var16 = TRUE ;

end ;

 

end ELSE if Var21 then

begin

Var14 = "Big Move" ;

SETPLOTBGCOLOR (11, 6) ;

end ELSE if Var21 then

begin

Var14 = "ADX Turn Alert" ;

SETPLOTBGCOLOR (11, 7) ;

end ELSE

begin

Var14 = " " ;

SETPLOTBGCOLOR (11, 1) ;

PLOT11 (Var14, "ADX Status", 1) ;

end ;

end ;

end ;

Link to comment
Share on other sites

Above is this mt4 from Dennis Jordan. He sends to all good lucks! Steve matrix make for all to share. He no longer wants to make money selling this. So I am post mt4 version for you too share with all. All you must make is change out the supporting indies for the regular. (ie: "supportingADX" change to "ADX"). He think he is smooth operator! like in old song...YES! SMOOOOOTH operator....

 

 

 

#property indicator_separate_window

#property indicator_buffers 5

#property indicator_color1 Yellow

#property indicator_color2 Magenta

#property indicator_color3 Red

#property indicator_color4 DarkOrange

#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, "DarkOrange 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);

SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 4);

SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 4);

SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 4);

SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 4);

/*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

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;

li_4 = IndicatorCounted();

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];

}

}

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...