Stratégie manuelle MT4 conversion vers PRT (supply and demand)
Forums › ProRealTime forum Français › Support ProBuilder › Stratégie manuelle MT4 conversion vers PRT (supply and demand)
- This topic has 27 replies, 6 voices, and was last updated 5 years ago by Nicolas.
-
-
10/09/2017 at 12:00 AM #48678
Bonjour à tous,
Voici une petite strat sur MT4 qui pourrait être assez pratique sur PRT, pour ceux qui auraient la possibilité de convertir les indicateurs mt4 vers prt.
La strat est composée de 3 indicateurs. Comme vous pouvez le voir sur la capture, il y a des zones d’achat et vente sur le prix et sur le RSi-Sto, et le 3ème indicateur laisse apparaitre un comptage. lorsqu’il y a 9 et 13 (en rouge ou bleu foncé) on peut considérer un retournement prochain avec validation si cours et RSI-STO dans une des zones.
Voici le code mt4 du SupDem
SupDem123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341#property indicator_chart_window#property indicator_buffers 2extern int forced_tf = 0;extern bool use_narrow_bands = false;extern bool kill_retouch = true;extern color TopColor = Maroon;extern color BotColor = DarkBlue;extern int Price_Width = 1;double BuferUp[];double BuferDn[];double iPeriod=13;int Dev=8;int Step=5;datetime t1,t2;double p1,p2;string pair;double point;int digits;int tf;string TAG;double up_cur,dn_cur;int init(){SetIndexBuffer(1,BuferUp);SetIndexEmptyValue(1,0.0);SetIndexStyle(1,DRAW_NONE);SetIndexBuffer(0,BuferDn);SetIndexEmptyValue(0,0.0);SetIndexStyle(0,DRAW_NONE);if(forced_tf != 0) tf = forced_tf;else tf = Period();point = Point;digits = Digits;if(digits == 3 || digits == 5) point*=10;TAG = "II_SupDem"+tf;return(0);}int deinit(){ObDeleteObjectsByPrefix(TAG);Comment("");return(0);}int start(){if(NewBar()==true){CountZZ(BuferUp,BuferDn,iPeriod,Dev,Step);GetValid();Draw();}return(0);}void Draw(){int i;string s;ObDeleteObjectsByPrefix(TAG);for(i=0;i<iBars(pair,tf);i++){if(BuferDn[i] > 0.0){t1 = iTime(pair,tf,i);t2 = Time[0];if(use_narrow_bands) p2 = MathMax(iClose(pair,tf,i),iOpen(pair,tf,i));else p2 = MathMin(iClose(pair,tf,i),iOpen(pair,tf,i));p2 = MathMax(p2,MathMax(iLow(pair,tf,i-1),iLow(pair,tf,i+1)));s = TAG+"UPAR"+tf+i;ObjectCreate(s,OBJ_ARROW,0,0,0);ObjectSet(s,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);ObjectSet(s, OBJPROP_TIME1, t2);ObjectSet(s, OBJPROP_PRICE1, p2);ObjectSet(s,OBJPROP_COLOR,TopColor);ObjectSet(s,OBJPROP_WIDTH,Price_Width);s = TAG+"UPFILL"+tf+i;ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);ObjectSet(s,OBJPROP_TIME1,t1);ObjectSet(s,OBJPROP_PRICE1,BuferDn[i]);ObjectSet(s,OBJPROP_TIME2,t2);ObjectSet(s,OBJPROP_PRICE2,p2);ObjectSet(s,OBJPROP_COLOR,TopColor);}if(BuferUp[i] > 0.0){t1 = iTime(pair,tf,i);t2 = Time[0];if(use_narrow_bands) p2 = MathMin(iClose(pair,tf,i),iOpen(pair,tf,i));else p2 = MathMax(iClose(pair,tf,i),iOpen(pair,tf,i));if(i>0) p2 = MathMin(p2,MathMin(iHigh(pair,tf,i+1),iHigh(pair,tf,i-1)));s = TAG+"DNAR"+tf+i;ObjectCreate(s,OBJ_ARROW,0,0,0);ObjectSet(s,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);ObjectSet(s, OBJPROP_TIME1, t2);ObjectSet(s, OBJPROP_PRICE1, p2);ObjectSet(s,OBJPROP_COLOR,BotColor);ObjectSet(s,OBJPROP_WIDTH,Price_Width);s = TAG+"DNFILL"+tf+i;ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);ObjectSet(s,OBJPROP_TIME1,t1);ObjectSet(s,OBJPROP_PRICE1,p2);ObjectSet(s,OBJPROP_TIME2,t2);ObjectSet(s,OBJPROP_PRICE2,BuferUp[i]);ObjectSet(s,OBJPROP_COLOR,BotColor);}}}bool NewBar() {static datetime LastTime = 0;if (iTime(pair,tf,0) != LastTime) {LastTime = iTime(pair,tf,0);return (true);} elsereturn (false);}void ObDeleteObjectsByPrefix(string Prefix){int L = StringLen(Prefix);int i = 0;while(i < ObjectsTotal()){string ObjName = ObjectName(i);if(StringSubstr(ObjName, 0, L) != Prefix){i++;continue;}ObjectDelete(ObjName);}}void CountZZ( double& ExtMapBuffer[], double& ExtMapBuffer2[], int ExtDepth, int ExtDeviation, int ExtBackstep ){int shift, back,lasthighpos,lastlowpos;double val,res;double curlow,curhigh,lasthigh,lastlow;int count = iBars(pair,tf)-ExtDepth;for(shift=count; shift>=0; shift--){val = iLow(pair,tf,iLowest(pair,tf,MODE_LOW,ExtDepth,shift));if(val==lastlow) val=0.0;else{lastlow=val;if((iLow(pair,tf,shift)-val)>(ExtDeviation*Point)) val=0.0;else{for(back=1; back<=ExtBackstep; back++){res=ExtMapBuffer[shift+back];if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0;}}}ExtMapBuffer[shift]=val;//--- highval=iHigh(pair,tf,iHighest(pair,tf,MODE_HIGH,ExtDepth,shift));if(val==lasthigh) val=0.0;else{lasthigh=val;if((val-iHigh(pair,tf,shift))>(ExtDeviation*Point)) val=0.0;else{for(back=1; back<=ExtBackstep; back++){res=ExtMapBuffer2[shift+back];if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0;}}}ExtMapBuffer2[shift]=val;}// final cuttinglasthigh=-1; lasthighpos=-1;lastlow=-1; lastlowpos=-1;for(shift=count; shift>=0; shift--){curlow=ExtMapBuffer[shift];curhigh=ExtMapBuffer2[shift];if((curlow==0)&&(curhigh==0)) continue;//---if(curhigh!=0){if(lasthigh>0){if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;else ExtMapBuffer2[shift]=0;}//---if(lasthigh<curhigh || lasthigh<0){lasthigh=curhigh;lasthighpos=shift;}lastlow=-1;}//----if(curlow!=0){if(lastlow>0){if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;else ExtMapBuffer[shift]=0;}//---if((curlow<lastlow)||(lastlow<0)){lastlow=curlow;lastlowpos=shift;}lasthigh=-1;}}for(shift=iBars(pair,tf)-1; shift>=0; shift--){if(shift>=count) ExtMapBuffer[shift]=0.0;else{res=ExtMapBuffer2[shift];if(res!=0.0) ExtMapBuffer2[shift]=res;}}}void GetValid(){up_cur = 0;int upbar = 0;dn_cur = 0;int dnbar = 0;double cur_hi = 0;double cur_lo = 0;double last_up = 0;double last_dn = 0;double low_dn = 0;double hi_up = 0;int i;for(i=0;i<iBars(pair,tf);i++){if(BuferUp[i] > 0){up_cur = BuferUp[i];cur_lo = BuferUp[i];last_up = cur_lo;break;}}for(i=0;i<iBars(pair,tf);i++){if(BuferDn[i] > 0){dn_cur = BuferDn[i];cur_hi = BuferDn[i];last_dn = cur_hi;break;}}for(i=0;i<iBars(pair,tf);i++) // remove higher lows and lower highs{if(BuferDn[i] >= last_dn){last_dn = BuferDn[i];dnbar = i;}else BuferDn[i] = 0.0;if(BuferDn[i] <= dn_cur && BuferUp[i] > 0.0) BuferDn[i] = 0.0;if(BuferUp[i] <= last_up && BuferUp[i] > 0){last_up = BuferUp[i];upbar = i;}else BuferUp[i] = 0.0;if(BuferUp[i] > up_cur) BuferUp[i] = 0.0;}if(kill_retouch){if(use_narrow_bands){low_dn = MathMax(iOpen(pair,tf,dnbar),iClose(pair,tf,dnbar));hi_up = MathMin(iOpen(pair,tf,upbar),iClose(pair,tf,upbar));}else{low_dn = MathMin(iOpen(pair,tf,dnbar),iClose(pair,tf,dnbar));hi_up = MathMax(iOpen(pair,tf,upbar),iClose(pair,tf,upbar));}for(i=MathMax(upbar,dnbar);i>=0;i--) // work back to zero and remove reentries into s/d{if(BuferDn[i] > low_dn && BuferDn[i] != last_dn) BuferDn[i] = 0.0;else if(use_narrow_bands && BuferDn[i] > 0){low_dn = MathMax(iOpen(pair,tf,i),iClose(pair,tf,i));last_dn = BuferDn[i];}else if(BuferDn[i] > 0){low_dn = MathMin(iOpen(pair,tf,i),iClose(pair,tf,i));last_dn = BuferDn[i];}if(BuferUp[i] <= hi_up && BuferUp[i] > 0 && BuferUp[i] != last_up) BuferUp[i] = 0.0;else if(use_narrow_bands && BuferUp[i] > 0){hi_up = MathMin(iOpen(pair,tf,i),iClose(pair,tf,i));last_up = BuferUp[i];}else if(BuferUp[i] > 0){hi_up = MathMax(iOpen(pair,tf,i),iClose(pair,tf,i));last_up = BuferUp[i];}}}}Voici le code du STO-RSI-WPR OBOS zone
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341#property indicator_chart_window#property indicator_buffers 2extern int forced_tf = 0;extern bool use_narrow_bands = false;extern bool kill_retouch = true;extern color TopColor = Maroon;extern color BotColor = DarkBlue;extern int Price_Width = 1;double BuferUp[];double BuferDn[];double iPeriod=13;int Dev=8;int Step=5;datetime t1,t2;double p1,p2;string pair;double point;int digits;int tf;string TAG;double up_cur,dn_cur;int init(){SetIndexBuffer(1,BuferUp);SetIndexEmptyValue(1,0.0);SetIndexStyle(1,DRAW_NONE);SetIndexBuffer(0,BuferDn);SetIndexEmptyValue(0,0.0);SetIndexStyle(0,DRAW_NONE);if(forced_tf != 0) tf = forced_tf;else tf = Period();point = Point;digits = Digits;if(digits == 3 || digits == 5) point*=10;TAG = "II_SupDem"+tf;return(0);}int deinit(){ObDeleteObjectsByPrefix(TAG);Comment("");return(0);}int start(){if(NewBar()==true){CountZZ(BuferUp,BuferDn,iPeriod,Dev,Step);GetValid();Draw();}return(0);}void Draw(){int i;string s;ObDeleteObjectsByPrefix(TAG);for(i=0;i<iBars(pair,tf);i++){if(BuferDn[i] > 0.0){t1 = iTime(pair,tf,i);t2 = Time[0];if(use_narrow_bands) p2 = MathMax(iClose(pair,tf,i),iOpen(pair,tf,i));else p2 = MathMin(iClose(pair,tf,i),iOpen(pair,tf,i));p2 = MathMax(p2,MathMax(iLow(pair,tf,i-1),iLow(pair,tf,i+1)));s = TAG+"UPAR"+tf+i;ObjectCreate(s,OBJ_ARROW,0,0,0);ObjectSet(s,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);ObjectSet(s, OBJPROP_TIME1, t2);ObjectSet(s, OBJPROP_PRICE1, p2);ObjectSet(s,OBJPROP_COLOR,TopColor);ObjectSet(s,OBJPROP_WIDTH,Price_Width);s = TAG+"UPFILL"+tf+i;ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);ObjectSet(s,OBJPROP_TIME1,t1);ObjectSet(s,OBJPROP_PRICE1,BuferDn[i]);ObjectSet(s,OBJPROP_TIME2,t2);ObjectSet(s,OBJPROP_PRICE2,p2);ObjectSet(s,OBJPROP_COLOR,TopColor);}if(BuferUp[i] > 0.0){t1 = iTime(pair,tf,i);t2 = Time[0];if(use_narrow_bands) p2 = MathMin(iClose(pair,tf,i),iOpen(pair,tf,i));else p2 = MathMax(iClose(pair,tf,i),iOpen(pair,tf,i));if(i>0) p2 = MathMin(p2,MathMin(iHigh(pair,tf,i+1),iHigh(pair,tf,i-1)));s = TAG+"DNAR"+tf+i;ObjectCreate(s,OBJ_ARROW,0,0,0);ObjectSet(s,OBJPROP_ARROWCODE,SYMBOL_RIGHTPRICE);ObjectSet(s, OBJPROP_TIME1, t2);ObjectSet(s, OBJPROP_PRICE1, p2);ObjectSet(s,OBJPROP_COLOR,BotColor);ObjectSet(s,OBJPROP_WIDTH,Price_Width);s = TAG+"DNFILL"+tf+i;ObjectCreate(s,OBJ_RECTANGLE,0,0,0,0,0);ObjectSet(s,OBJPROP_TIME1,t1);ObjectSet(s,OBJPROP_PRICE1,p2);ObjectSet(s,OBJPROP_TIME2,t2);ObjectSet(s,OBJPROP_PRICE2,BuferUp[i]);ObjectSet(s,OBJPROP_COLOR,BotColor);}}}bool NewBar() {static datetime LastTime = 0;if (iTime(pair,tf,0) != LastTime) {LastTime = iTime(pair,tf,0);return (true);} elsereturn (false);}void ObDeleteObjectsByPrefix(string Prefix){int L = StringLen(Prefix);int i = 0;while(i < ObjectsTotal()){string ObjName = ObjectName(i);if(StringSubstr(ObjName, 0, L) != Prefix){i++;continue;}ObjectDelete(ObjName);}}void CountZZ( double& ExtMapBuffer[], double& ExtMapBuffer2[], int ExtDepth, int ExtDeviation, int ExtBackstep ){int shift, back,lasthighpos,lastlowpos;double val,res;double curlow,curhigh,lasthigh,lastlow;int count = iBars(pair,tf)-ExtDepth;for(shift=count; shift>=0; shift--){val = iLow(pair,tf,iLowest(pair,tf,MODE_LOW,ExtDepth,shift));if(val==lastlow) val=0.0;else{lastlow=val;if((iLow(pair,tf,shift)-val)>(ExtDeviation*Point)) val=0.0;else{for(back=1; back<=ExtBackstep; back++){res=ExtMapBuffer[shift+back];if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0;}}}ExtMapBuffer[shift]=val;//--- highval=iHigh(pair,tf,iHighest(pair,tf,MODE_HIGH,ExtDepth,shift));if(val==lasthigh) val=0.0;else{lasthigh=val;if((val-iHigh(pair,tf,shift))>(ExtDeviation*Point)) val=0.0;else{for(back=1; back<=ExtBackstep; back++){res=ExtMapBuffer2[shift+back];if((res!=0)&&(res<val)) ExtMapBuffer2[shift+back]=0.0;}}}ExtMapBuffer2[shift]=val;}// final cuttinglasthigh=-1; lasthighpos=-1;lastlow=-1; lastlowpos=-1;for(shift=count; shift>=0; shift--){curlow=ExtMapBuffer[shift];curhigh=ExtMapBuffer2[shift];if((curlow==0)&&(curhigh==0)) continue;//---if(curhigh!=0){if(lasthigh>0){if(lasthigh<curhigh) ExtMapBuffer2[lasthighpos]=0;else ExtMapBuffer2[shift]=0;}//---if(lasthigh<curhigh || lasthigh<0){lasthigh=curhigh;lasthighpos=shift;}lastlow=-1;}//----if(curlow!=0){if(lastlow>0){if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0;else ExtMapBuffer[shift]=0;}//---if((curlow<lastlow)||(lastlow<0)){lastlow=curlow;lastlowpos=shift;}lasthigh=-1;}}for(shift=iBars(pair,tf)-1; shift>=0; shift--){if(shift>=count) ExtMapBuffer[shift]=0.0;else{res=ExtMapBuffer2[shift];if(res!=0.0) ExtMapBuffer2[shift]=res;}}}void GetValid(){up_cur = 0;int upbar = 0;dn_cur = 0;int dnbar = 0;double cur_hi = 0;double cur_lo = 0;double last_up = 0;double last_dn = 0;double low_dn = 0;double hi_up = 0;int i;for(i=0;i<iBars(pair,tf);i++){if(BuferUp[i] > 0){up_cur = BuferUp[i];cur_lo = BuferUp[i];last_up = cur_lo;break;}}for(i=0;i<iBars(pair,tf);i++){if(BuferDn[i] > 0){dn_cur = BuferDn[i];cur_hi = BuferDn[i];last_dn = cur_hi;break;}}for(i=0;i<iBars(pair,tf);i++) // remove higher lows and lower highs{if(BuferDn[i] >= last_dn){last_dn = BuferDn[i];dnbar = i;}else BuferDn[i] = 0.0;if(BuferDn[i] <= dn_cur && BuferUp[i] > 0.0) BuferDn[i] = 0.0;if(BuferUp[i] <= last_up && BuferUp[i] > 0){last_up = BuferUp[i];upbar = i;}else BuferUp[i] = 0.0;if(BuferUp[i] > up_cur) BuferUp[i] = 0.0;}if(kill_retouch){if(use_narrow_bands){low_dn = MathMax(iOpen(pair,tf,dnbar),iClose(pair,tf,dnbar));hi_up = MathMin(iOpen(pair,tf,upbar),iClose(pair,tf,upbar));}else{low_dn = MathMin(iOpen(pair,tf,dnbar),iClose(pair,tf,dnbar));hi_up = MathMax(iOpen(pair,tf,upbar),iClose(pair,tf,upbar));}for(i=MathMax(upbar,dnbar);i>=0;i--) // work back to zero and remove reentries into s/d{if(BuferDn[i] > low_dn && BuferDn[i] != last_dn) BuferDn[i] = 0.0;else if(use_narrow_bands && BuferDn[i] > 0){low_dn = MathMax(iOpen(pair,tf,i),iClose(pair,tf,i));last_dn = BuferDn[i];}else if(BuferDn[i] > 0){low_dn = MathMin(iOpen(pair,tf,i),iClose(pair,tf,i));last_dn = BuferDn[i];}if(BuferUp[i] <= hi_up && BuferUp[i] > 0 && BuferUp[i] != last_up) BuferUp[i] = 0.0;else if(use_narrow_bands && BuferUp[i] > 0){hi_up = MathMin(iOpen(pair,tf,i),iClose(pair,tf,i));last_up = BuferUp[i];}else if(BuferUp[i] > 0){hi_up = MathMax(iOpen(pair,tf,i),iClose(pair,tf,i));last_up = BuferUp[i];}}}}Et le dernier MM count
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260//+------------------------------------------------------------------+//| Momo Counts.mq4 |//| Copyright © 2008, TradingSytemForex |//| http://www.tradingsystemforex.com |//+------------------------------------------------------------------+#property copyright "Copyright © 2008, TradingSytemForex"#property link "http://www.tradingsystemforex.com"#property indicator_chart_window#property indicator_buffers 4#property indicator_color1 SkyBlue#property indicator_color2 LightSalmon#property indicator_color3 Blue#property indicator_color4 Red//|---------indicator settingsextern color First=Black;extern color Sell=LightSalmon;extern color Buy=SkyBlue;extern color PerfectSell=Red;extern color PerfectBuy=Blue;extern bool ShowNumbers=true;extern bool ShowArrows=false;extern bool UseAlerts=false;//|---------indicator buffersdouble CrossUp[];double CrossDown[];double CrossPUp[];double CrossPDown[];double prevtime;double Range,AvgRange;//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int init(){SetIndexStyle(0,DRAW_ARROW,EMPTY,1);SetIndexArrow(0,233);SetIndexBuffer(0,CrossUp);SetIndexStyle(1,DRAW_ARROW,EMPTY,1);SetIndexArrow(1,234);SetIndexBuffer(1,CrossDown);SetIndexStyle(2,DRAW_ARROW,EMPTY,1);SetIndexArrow(2,233);SetIndexBuffer(2,CrossPUp);SetIndexStyle(3,DRAW_ARROW,EMPTY,1);SetIndexArrow(3,234);SetIndexBuffer(3,CrossPDown);return(0);}//+------------------------------------------------------------------+//| Custom indicator deinitialization function |//+------------------------------------------------------------------+int deinit(){for(int i=0;i<Bars;i++){ObjectDelete("first"+i);ObjectDelete("fifth"+i);ObjectDelete("nineth"+i);ObjectDelete("thirteenth"+i);}return(0);}//+------------------------------------------------------------------+//| Mm Counts |//+------------------------------------------------------------------+int start(){int iadu;int iadd;double ru=0.5,rd=0.25;if(Period()==PERIOD_M1){iadu=1;iadd=3;}if(Period()==PERIOD_M5){iadu=2;iadd=7;}if(Period()==PERIOD_M15){iadu=2;iadd=12;}if(Period()==PERIOD_M30){iadu=2;iadd=20;}if(Period()==PERIOD_H1){iadu=4;iadd=25;}if(Period()==PERIOD_H4){iadu=8;iadd=60;}if(Period()==PERIOD_D1){iadu=8;iadd=80;}double adu=Point*iadu;double add=Point*iadd;if(ShowNumbers==false){adu=0;add=0;ru=0.5;rd=0.5;}int limit,counter;int counted_bars=IndicatorCounted();if(counted_bars<0)return(-1);if(counted_bars>0)counted_bars--;limit=Bars-counted_bars+10;for(int i=limit;i>0;i--){counter=i;Range=0;AvgRange=0;for(counter=i;counter<=i+9;counter++){AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);}Range=AvgRange/10;//|---------buyif(Close[i]<Close[i+4] && Close[i+1]>Close[i+5]){if(ShowNumbers){ObjectCreate("first"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("first"+i,""+1,10,"Arial",First);}}if(Close[i]<Close[i+4] && Close[i+1]<Close[i+5] && Close[i+2]<Close[i+6] && Close[i+3]<Close[i+7] && Close[i+4]<Close[i+8] && Close[i+5]>Close[i+9]){if(ShowArrows||UseAlerts)CrossUp[i]=Low[i]-adu-Range*ru;if(ShowNumbers){ObjectCreate("fifth"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("fifth"+i,""+5,14,"Arial",Buy);}}if(Close[i]<Close[i+4] && Close[i+1]<Close[i+5] && Close[i+2]<Close[i+6] && Close[i+3]<Close[i+7] && Close[i+4]<Close[i+8] && Close[i+5]<Close[i+9] && Close[i+6]<Close[i+10] && Close[i+7]<Close[i+11] && Close[i+8]<Close[i+12] && Close[i+9]>Close[i+13] && !((Low[i]<Low[i+3] && Low[i]<Low[i+4])||(Low[i+1]<Low[i+3] && Low[i+1]<Low[i+4]))){if(ShowArrows||UseAlerts)CrossUp[i]=Low[i]-adu-Range*ru;if(ShowNumbers){ObjectCreate("nineth"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("nineth"+i,""+9,14,"Arial",Buy);}}if(Close[i]<Close[i+4] && Close[i+1]<Close[i+5] && Close[i+2]<Close[i+6] && Close[i+3]<Close[i+7] && Close[i+4]<Close[i+8] && Close[i+5]<Close[i+9] && Close[i+6]<Close[i+10] && Close[i+7]<Close[i+11] && Close[i+8]<Close[i+12] && Close[i+9]>Close[i+13] && ((Low[i]<Low[i+3] && Low[i]<Low[i+4])||(Low[i+1]<Low[i+3] && Low[i+1]<Low[i+4]))){if(ShowArrows||UseAlerts)CrossPUp[i]=Low[i]-adu-Range*ru;if(ShowNumbers){ObjectCreate("nineth"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("nineth"+i,""+9,14,"Arial",PerfectBuy);}}if(Close[i]<=High[i+2] && Close[i+1]<=High[i+3] && Close[i+2]<=High[i+4] && Close[i+3]<=High[i+5] && Close[i+4]<=High[i+6] && Close[i+5]<=High[i+7] && Close[i+6]<=High[i+8] && Close[i+7]<=High[i+9] && Close[i+8]<=High[i+10] && Close[i+9]<=High[i+11] && Close[i+10]<=High[i+12] && Close[i+11]<=High[i+13] && Close[i+12]<=High[i+14] && Close[i+13]>High[i+15] && !(Low[i]<=Close[i+5])){if(ShowArrows||UseAlerts)CrossUp[i]=Low[i]-adu-Range*ru;if(ShowNumbers){ObjectCreate("thirteenth"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("thirteenth"+i,""+13,14,"Arial",Buy);}}if(Close[i]<=High[i+2] && Close[i+1]<=High[i+3] && Close[i+2]<=High[i+4] && Close[i+3]<=High[i+5] && Close[i+4]<=High[i+6] && Close[i+5]<=High[i+7] && Close[i+6]<=High[i+8] && Close[i+7]<=High[i+9] && Close[i+8]<=High[i+10] && Close[i+9]<=High[i+11] && Close[i+10]<=High[i+12] && Close[i+11]<=High[i+13] && Close[i+12]<=High[i+14] && Close[i+13]>High[i+15] && Low[i]<=Close[i+5]){if(ShowArrows||UseAlerts)CrossPUp[i]=Low[i]-adu-Range*ru;if(ShowNumbers){ObjectCreate("thirteenth"+i,OBJ_TEXT,0,Time[i],Low[i]-adu);ObjectSetText("thirteenth"+i,""+13,14,"Arial",PerfectBuy);}}//|---------sellif(Close[i]>Close[i+4] && Close[i+1]<Close[i+5]){if(ShowNumbers){ObjectCreate("first"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("first"+i,""+1,10,"Arial",First);}}if(Close[i]>Close[i+4] && Close[i+1]>Close[i+5] && Close[i+2]>Close[i+6] && Close[i+3]>Close[i+7] && Close[i+4]>Close[i+8] && Close[i+5]<Close[i+9]){if(ShowArrows||UseAlerts)CrossDown[i]=High[i]+add+Range*rd;if(ShowNumbers){ObjectCreate("fifth"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("fifth"+i,""+5,14,"Arial",Sell);}}if(Close[i]>Close[i+4] && Close[i+1]>Close[i+5] && Close[i+2]>Close[i+6] && Close[i+3]>Close[i+7] && Close[i+4]>Close[i+8] && Close[i+5]>Close[i+9] && Close[i+6]>Close[i+10] && Close[i+7]>Close[i+11] && Close[i+8]>Close[i+12] && Close[i+9]<Close[i+13] && !((High[i]>High[i+3] && High[i]>High[i+4])||(High[i+1]>High[i+3] && High[i+1]>High[i+4]))){if(ShowArrows||UseAlerts)CrossDown[i]=High[i]+add+Range*rd;if(ShowNumbers){ObjectCreate("nineth"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("nineth"+i,""+9,14,"Arial",Sell);}}if(Close[i]>Close[i+4] && Close[i+1]>Close[i+5] && Close[i+2]>Close[i+6] && Close[i+3]>Close[i+7] && Close[i+4]>Close[i+8] && Close[i+5]>Close[i+9] && Close[i+6]>Close[i+10] && Close[i+7]>Close[i+11] && Close[i+8]>Close[i+12] && Close[i+9]<Close[i+13] && ((High[i]>High[i+3] && High[i]>High[i+4])||(High[i+1]>High[i+3] && High[i+1]>High[i+4]))){if(ShowArrows||UseAlerts)CrossPDown[i]=High[i]+add+Range*rd;if(ShowNumbers){ObjectCreate("nineth"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("nineth"+i,""+9,14,"Arial",PerfectSell);}}if(Close[i]>=Low[i+2] && Close[i+1]>=Low[i+3] && Close[i+2]>=Low[i+4] && Close[i+3]>=Low[i+5] && Close[i+4]>=Low[i+6] && Close[i+5]>=Low[i+7] && Close[i+6]>=Low[i+8] && Close[i+7]>=Low[i+9] && Close[i+8]>=Low[i+10] && Close[i+9]>=Low[i+11] && Close[i+10]>=Low[i+12] && Close[i+11]>=Low[i+13] && Close[i+12]>=Low[i+14] && Close[i+13]<Low[i+15] && !(High[i]>=Close[i+5])){if(ShowArrows||UseAlerts)CrossDown[i]=High[i]+add+Range*rd;if(ShowNumbers){ObjectCreate("thirteenth"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("thirteenth"+i,""+13,14,"Arial",Sell);}}if(Close[i]>=Low[i+2] && Close[i+1]>=Low[i+3] && Close[i+2]>=Low[i+4] && Close[i+3]>=Low[i+5] && Close[i+4]>=Low[i+6] && Close[i+5]>=Low[i+7] && Close[i+6]>=Low[i+8] && Close[i+7]>=Low[i+9] && Close[i+8]>=Low[i+10] && Close[i+9]>=Low[i+11] && Close[i+10]>=Low[i+12] && Close[i+11]>=Low[i+13] && Close[i+12]>=Low[i+14] && Close[i+13]<Low[i+15] && High[i]>=Close[i+5]){if(ShowArrows||UseAlerts)CrossPDown[i]=High[i]+add+Range*rd;if(ShowNumbers){ObjectCreate("thirteenth"+i,OBJ_TEXT,0,Time[i],High[i]+add);ObjectSetText("thirteenth"+i,""+13,14,"Arial",PerfectSell);}}//|---------alertsif((CrossUp[0]>2000) && (CrossDown[0]>2000) && (CrossPUp[0]>2000) && (CrossPDown[0]>2000)){prevtime=0;}if((CrossUp[0]==Low[i]-adu-Range*ru) && (prevtime!=Time[0]) && UseAlerts){prevtime=Time[0];Alert(Symbol()," Mm Counts Up @ Hour ",Hour()," Minute ",Minute());PlaySound("alert.wav");SendMail(" Mm Counts Alert "," Signal Up, Symbol=" +Symbol()+ ", Period="+Period());}if((CrossDown[0]==High[i]+add+Range*rd) && (prevtime!=Time[0]) && UseAlerts){prevtime=Time[0];Alert(Symbol()," Mm Counts Down @ Hour ",Hour()," Minute ",Minute());PlaySound("alert.wav");SendMail(" Mm Counts Alert "," Signal Down, Symbol="+Symbol()+", Period="+Period());}if((CrossPUp[0]==Low[i]-adu-Range*ru) && (prevtime!=Time[0]) && UseAlerts){prevtime=Time[0];Alert(Symbol()," Mm Counts Perfect Up @ Hour ",Hour()," Minute ",Minute());PlaySound("alert.wav");SendMail(" Mm Counts Alert "," Perfect Signal Up, Symbol="+Symbol()+", Period="+Period());}if((CrossPDown[0]==High[i]+add+Range*rd) && (prevtime!=Time[0]) && UseAlerts){prevtime=Time[0];Alert(Symbol()," Mm Counts Perfect Down @ Hour ",Hour()," Minute ",Minute());PlaySound("alert.wav");SendMail(" Mm Counts Alert "," Perfect Signal Down, Symbol="+Symbol()+", Period="+Period());}}return(0);}//+------------------------------------------------------------------+Et enfin une capture pour visualiser la strat.
Ca serait merveilleux de pouvoir transcrire ces indicateurs sous PRT.
Un grand merci par avance à celui qui réussira cette prouesse.
10/09/2017 at 9:00 AM #48706Merci pour les prochaines demandes, de ne poster uniquement que les fichiers .mq4 accompagné d’un ou plusieurs screenshots. Il me semble que tu t’es trompé dans tes copier/coller, le premier indicateur est le même que le second, prière de fournir les fichiers sources, ce sera bien plus simple ! 😀
10/09/2017 at 10:09 AM #48723Bonjour Nicolas
Désolé pour l’erreur d’inattention.
Voici les fichiers MQ4 ainsi qu’une autre capture.
Je me sers de ces indicateurs comme support/resistance. Lorsque le cours arrive dans l’une des deux zones je prends en sens inverse.
10/10/2017 at 7:42 AM #48857Le Supdem est à mon sens le meilleur indicateur sur MT4.
On peut trader avec lui uniquement. On peut le voir comme un outil de S&R dynamique… si on prend une position inverse, le SL est très facile à poser (bord opposé du rectangle + x pips)… et on peut attendre que le cours touche un nouveau SR Supdem en TP.
Si une solution est trouvée pour le créer sur PRT…. je suis très preneur 😉10/10/2017 at 12:51 PM #48902Pour l’indicateur SupDem, cela semble très compliqué sans tableau de données .. désolé. On pourrait sans doute faire quelquechose qui s’en rapproche, car ça n’est qu’un traçage de ZigZag validé par un algorithme qui fait un choix selon des critères (qu’il me reste à comprendre toutefois).
Pour MmCounts, pas de problème à signaler.
Pour le dernier, ça n’est que le RSI, stochastique et WPR dans la même fenêtre pour info, toujours utile de le convertir ? 🙂
10/10/2017 at 1:16 PM #48905Bonjour Nicolas,
En effet pour le dernier, si ce n’est juste que RSI Sto et WPR dans la même fenêtre pas besoin de le convertir.
Pour le SupDem, si ce n’est qu’un traçage de ZigZag peut-être n’est-il pas non plus obligatoire d’en faire un indicateur alors.
Je te remercie en tout cas.
10/10/2017 at 3:03 PM #48928Les zigzag sont utilisés pour trouver les pics et les creux du prix, il n’y a pas 100 façons de le faire et c’est l’indicateur le plus simple et pertinent à ce propos, c’est pour cette raison qu’on l’utilise dans un peu tout comme pour les figures harmoniques par exemple, pour le chartisme, loi de Dow, vagues de toutes sortes… bref.
Pour Mm-Counts-v102.mq4, je m’en occupe donc ?
10/10/2017 at 3:24 PM #4893410/10/2017 at 4:13 PM #4894910/16/2017 at 12:20 PM #4954810/16/2017 at 1:32 PM #49567Désolé, cet indicateur en question utilise également des tableaux de données, impossible donc de faire exactement pareil.
Je vois ce qu’il est possible de faire : utiliser un zig zag et en testant le prix courant vis à vis de sa position avec les derniers pics et creux testés sur X périodes du zigzag, valider ou non des zones de supports et résistances. En ce sens cet indicateur ressemblera beaucoup à ce qui a déjà été posté ici : supports et résistance indicateur intraday
Je vais regarder à ça cette après midi, je vous tient informé.
10/16/2017 at 2:24 PM #49568J’ai réussi à faire ça rapidement, c’est dynamique, c’est à dire que les zones s’affichent en fonction du prix actuel et des positions des derniers ‘peaks and valleys’ du zigzag.
Par contre, il n’y a pas de confrontation entre une zone qui existe et une nouvelle détecté. C’est là où il faudrait creuser ..
10/16/2017 at 2:27 PM #49571Exemple dramatique sur le DAX en 1 heure, certes avec des zigzag de 0.5 percent seulement. On remarque bien la superposition des zones de supports et résistances, je suppose que je devrai faire 2 boucles, une pour rassembler mes données de zones et une autre pour valider ou non leurs tracements et éviter de retracer toutes ces zones si elles se chevauchent.. bref ça n’est que visuel finalement .. à voir !
10/16/2017 at 2:33 PM #4957510/16/2017 at 3:26 PM #49583 -
AuthorPosts
Find exclusive trading pro-tools on