Conversion indicateur Snake Force de mt4
Forums › ProRealTime forum Français › Support ProBuilder › Conversion indicateur Snake Force de mt4
- This topic has 6 replies, 4 voices, and was last updated 4 years ago by JC_Bywan.
-
-
05/02/2019 at 7:02 PM #97571
Bonjour,
est-ce qu’il serait possible de convertir ce code vers Prorealcode svp? J’èspere qu’il ne manque pas d’info?
Merci beaucoupSnake Force123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467//+------------------------------------------------------------------+//| SnakeInBorders.mq4 |//| "ÈÍÄÈÊÀÒÎÐÛ ÄËß ÑÀÌÎÎÁÌÀÍÀ" |//| Bookkeeper, 2006, yuzefovich@gmail.com |//+------------------------------------------------------------------+#property copyright ""#property link ""//+------------------------------------------------------------------+#property indicator_separate_window#property indicator_buffers 4#property indicator_color1 Lime#property indicator_color2 Red#property indicator_color3 Lime#property indicator_color4 Red//----extern int cPeriod=24;//----double ForceUp[];double ForceDown[];double ResistanceUp[];double ResistanceDown[];double Mart[];//----double Snake_Sum, Snake_Weight, Snake_Sum_Minus, Snake_Sum_Plus;//----int init(){int draw_begin;double indperiod,val1,val2;string CommentStr;draw_begin=3*cPeriod;IndicatorBuffers(5);SetIndexBuffer(0,ForceUp);SetIndexBuffer(1,ForceDown);SetIndexBuffer(2,ResistanceUp);SetIndexBuffer(3,ResistanceDown);SetIndexBuffer(4,Mart);SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,2);SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,2);SetIndexStyle(2,DRAW_HISTOGRAM);SetIndexStyle(3,DRAW_HISTOGRAM);SetIndexStyle(4,DRAW_NONE);SetIndexLabel(2,NULL);SetIndexLabel(3,NULL);SetIndexLabel(4,NULL);SetIndexDrawBegin(0,draw_begin);SetIndexDrawBegin(1,draw_begin);SetIndexDrawBegin(2,draw_begin);SetIndexDrawBegin(3,draw_begin);SetIndexDrawBegin(4,draw_begin);indperiod=1.0*cPeriod*Period();if(indperiod<60){CommentStr=DoubleToStr(indperiod,0);CommentStr=" M"+CommentStr+", FORCE UP -DOWN ";}else{indperiod=indperiod/60;if(indperiod>=24){val1=MathAbs(MathRound(indperiod/24)-indperiod/24);if(val1<0.01){CommentStr=DoubleToStr(indperiod/24,0);CommentStr=" D"+CommentStr+", FORCE UP -DOWN ";}else{CommentStr=DoubleToStr(indperiod/24,1);CommentStr=" D"+CommentStr+", FORCE UP -DOWN ";}}else{val1=MathAbs(MathRound(indperiod)-indperiod);if(val1<0.01){CommentStr=DoubleToStr(indperiod,0);CommentStr=" H"+CommentStr+", FORCE UP -DOWN ";}else{CommentStr=DoubleToStr(indperiod,1);CommentStr=" H"+CommentStr+", FORCE UP -DOWN ";}}}IndicatorShortName("SnakeInBorders"+CommentStr);return(0);}//----void deinit(){}//----int start(){int FirstPos, ExtCountedBars=0,i;if(Bars<=50) return(0);if(cPeriod<21) return(0);ExtCountedBars=IndicatorCounted();if (ExtCountedBars<0) return(-1);if (ExtCountedBars>0) ExtCountedBars--;FirstPos=Bars-ExtCountedBars-1;if(FirstPos>Bars-cPeriod-7){FirstPos=Bars-cPeriod-7;Mart[FirstPos+cPeriod]=SnakeFirstCalc(FirstPos+cPeriod);for(i=FirstPos+cPeriod-1;i>FirstPos;i--) SnakeNextCalc(i);}Snake(FirstPos);return(0);}//----void Snake(int Pos){int i;if(Pos<6) Pos=6;Mart[Pos]=SnakeFirstCalc(Pos);Drawing(Pos);Pos--;while(Pos>=5){Mart[Pos]=SnakeNextCalc(Pos);Drawing(Pos);Pos--;}while(Pos>0){Mart[Pos]=SnakeFirstCalc(Pos);Drawing(Pos);Pos--;}if(Pos==0){// Mart[Pos]=iMA(NULL,0,6,0,MODE_LWMA,PRICE_TYPICAL,0);Mart[Pos]=iMA(NULL,0,6,0,MODE_LWMA,PRICE_CLOSE,0);Drawing(Pos);}return;}//----double SnakePrice(int Shift){// return((2*Close[shift]+High[shift]+Low[shift])/4);return(Close[shift]);}//----double SnakeFirstCalc(int Shift){int i, j, w;Snake_Sum=0.0;if(Shift<5){Snake_Weight=0.0;i=0;w=Shift+5;while(w>=Shift){i++;Snake_Sum=Snake_Sum+i*SnakePrice(w);Snake_Weight=Snake_Weight+i;w--;}while(w>=0){i--;Snake_Sum=Snake_Sum+i*SnakePrice(w);Snake_Weight=Snake_Weight+i;w--;}}else{Snake_Sum_Minus=0.0;Snake_Sum_Plus=0.0;for(j=Shift-5,i=Shift+5,w=1; w<=5; j++,i--,w++){Snake_Sum=Snake_Sum+w*(SnakePrice(i)+SnakePrice(j));Snake_Sum_Minus=Snake_Sum_Minus+SnakePrice(i);Snake_Sum_Plus=Snake_Sum_Plus+SnakePrice(j);}Snake_Sum=Snake_Sum+6*SnakePrice(Shift);Snake_Sum_Minus=Snake_Sum_Minus+SnakePrice(Shift);Snake_Weight=36;}return(Snake_Sum/Snake_Weight);}//----double SnakeNextCalc(int Shift){Snake_Sum_Plus=Snake_Sum_Plus+SnakePrice(Shift-5);Snake_Sum=Snake_Sum-Snake_Sum_Minus+Snake_Sum_Plus;Snake_Sum_Minus=Snake_Sum_Minus-SnakePrice(Shift+6)+SnakePrice(Shift);Snake_Sum_Plus=Snake_Sum_Plus-SnakePrice(Shift);return(Snake_Sum/Snake_Weight);}//----void Drawing(int Shift){double val,Dval,val1,val2,val11,val22,val3;val= 5*(Mart[shift]-Mart[ArrayMinimum(Mart,cPeriod,Shift)])/9;Dval=5*(Mart[shift]-Mart[shift+1]+Mart[ArrayMinimum(Mart,cPeriod,Shift+1)]-Mart[ArrayMinimum(Mart,cPeriod,Shift)] )/9;if(Dval>0){ForceUp[shift]=val;ResistanceUp[shift]=0;}else{ForceUp[shift]=0;ResistanceUp[shift]=val;}val= 5*(Mart[shift]-Mart[ArrayMaximum(Mart,cPeriod,Shift)])/9;Dval=5*(Mart[shift]-Mart[shift+1]+Mart[ArrayMaximum(Mart,cPeriod,Shift+1)]-Mart[ArrayMaximum(Mart,cPeriod,Shift)] )/9;if(Dval<0){ForceDown[shift]=val;ResistanceDown[shift]=0;}else{ForceDown[shift]=0;ResistanceDown[shift]=val;}return;}05/09/2019 at 12:15 PM #9806005/10/2019 at 3:42 AM #9811505/10/2019 at 1:18 PM #9816910/29/2020 at 8:09 AM #14885310/29/2020 at 8:29 AM #148862I have added a screen shot and a description as required:
BUY:
- Snake Body is down touching the Canal
2. The Path became visible again behind the Snake body because the Snake start rising
3. Snake Force down is off
SELL:
- Snake Body is high touching the Canal
2. The Path became visible again behind the Snake body because the Snake start fall
3. Snake Force oscillator high is off
10/29/2020 at 8:44 AM #148866@october bonjour,
merci de respecter les règles de publication dans le grand cadre jaune ci-dessous, en particulier écrire dans la même langue que le forum auquel on participe
(translation: thanks for respecting the forum rules in the big yellow box below, in particular using the same language as the forum you contribute to, using automatic translator if needed)
-
AuthorPosts
Find exclusive trading pro-tools on