ajustement variables à différentes bougies
Forums › ProRealTime forum Français › Support ProOrder › ajustement variables à différentes bougies
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by Nicolas.
-
-
10/04/2021 at 9:12 AM #178992
Bonjour Nicolas
j’ai crée un un petit algorythme basé sur l’amplitude des bougies et qui utilise la fonction ci-jointe.
Pour l’instant les variables lm et lm1 agissent sur l’ensemble de mes bougies. Je n’arrive pas à appliquer des variables différentes à chaque Bougie. Pour essayer d’être plus précis, je voudrais que chaque bougie puisse avoir un réglage des variables
lm et lm1 différentes.
Merci d’avance pour ton aide
cordialement
jp Saccucci
If longonmarket and close < positionprice and (barindex-tradeindex) > lm or bull=2 Then
Sell at market
endifIf longonmarket and close > positionprice and (barindex-tradeindex) >lm1 Then
Sell 0.8 contract at market
endif10/04/2021 at 1:41 PM #17900610/04/2021 at 3:03 PM #179007Bonjour Nicolas
apparemment non??
J’ai joins un bout de code. Dans ce code toutes les bougies vertes fermeront sur les variables lm,lm1 et lm2.Toutes les rouges sur sm,sm1 et sm2.J’ai à peu près 50 bougies vertes et 60 bougies rouges. Je souhaiterais que pour chaque bougie pouvoir lui donner des variables différentes des autres bougies.
Je veux pouvoir dire . la bougie verte numéro1 va fermer lorsque le close > positionprice and (barindex-tradeindex) >5. La seconde > 8, la troisième supérieur à 10 etc etc.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395a=2b=11c=2d=7fa=4fb=5bv1= (corps>=a*pipsize and verte) and (MecheSup >= c*pipsize and verte )and (MecheInf >= fa*pipsize and verte)bv2= (corps<=b*pipsize and verte) and (MecheSup <=d*pipsize and verte ) and (MecheInf <= fb*pipsize and verte )bv3=bv1 and bv2if bv3 thenbull=1//AAendife= 9//9f=11//11g=0//0i=26//26j=5//5k=29//29bv4= (corps>=e*pipsize and verte) and (MecheSup >= g*pipsize and verte )and (MecheInf >= j*pipsize and verte)bv5= (corps<=f*pipsize and verte) and (MecheSup <=i*pipsize and verte ) and (MecheInf <= k*pipsize and verte )bv6=bv4 and bv5if bv6 thenbull=1//ABendifl=15m=18la=1lb=2lc=2ld=3bv7= (corps>=l*pipsize and verte) and (MecheSup >= la*pipsize and verte )and (MecheInf >= lc*pipsize and verte)bv8= (corps<=m*pipsize and verte) and (MecheSup <=lb*pipsize and verte ) and (MecheInf <= ld*pipsize and verte )bv9=bv7 and bv8if bv9 thenbull=1//ACendifo=2//2p=4//6q=3//1r=3//5s=9//2t=10//14bv10= (corps>=o*pipsize and verte) and (MecheSup >= q*pipsize and verte )and (MecheInf >= s*pipsize and verte)bv11= (corps<=p*pipsize and verte) and (MecheSup <=r*pipsize and verte ) and (MecheInf <= t*pipsize and verte )bv12=bv10 and bv11if bv12 thenbull=1//adendifu=18v=18w=3x=4Y=0z=0bv13= (corps>=u*pipsize and verte) and (MecheSup >= w*pipsize and verte )and (MecheInf >= y*pipsize and verte)bv14= (corps<=v*pipsize and verte) and (MecheSup <=x*pipsize and verte ) and (MecheInf <= z*pipsize and verte )bv15=bv13 and bv14if bv15 thenbull=1//AEendifca=12cb=12cc=0cd=1ce=3cf=3bv16= (corps>=ca*pipsize and verte) and (MecheSup >= cc*pipsize and verte )and (MecheInf >= ce*pipsize and verte)bv17= (corps<=cb*pipsize and verte) and (MecheSup <=cd*pipsize and verte ) and (MecheInf <= cf*pipsize and verte )bv18=bv16 and bv17if bv18 thenbull=1//AFendifcg=5ch=6ci=2cj=2ck=2cl=3bv19= (corps>=cg*pipsize and verte) and (MecheSup >= ci*pipsize and verte )and (MecheInf >= ck*pipsize and verte)bv20= (corps<=ch*pipsize and verte) and (MecheSup <=cj*pipsize and verte ) and (MecheInf <= cl*pipsize and verte )bv21=bv19 and bv20if bv21 thenbull=1//AGendifea=33eb=33ec=4ed=5ef=0eg=0bv22= (corps>=ea*pipsize and verte) and (MecheSup >= ec*pipsize and verte )and (MecheInf >= ef*pipsize and verte)bv23= (corps<=eb*pipsize and verte) and (MecheSup <=ed*pipsize and verte ) and (MecheInf <= eg*pipsize and verte )bv24=bv22 and bv23if bv24 thenbull=1//AHendifeh=16ei=17ej=1ek=1el=4em=4bv25= (corps>=eh*pipsize and verte) and (MecheSup >= ej*pipsize and verte )and (MecheInf >= el*pipsize and verte)bv26= (corps<=ei*pipsize and verte) and (MecheSup <=ek*pipsize and verte ) and (MecheInf <= em*pipsize and verte )bv27=bv25 and bv26if bv27 thenbull=1//AIendifen=10eo=11ep=0eq=0er=0es=1bv28= (corps>=en*pipsize and verte) and (MecheSup >= ep*pipsize and verte )and (MecheInf >= er*pipsize and verte)bv29= (corps<=eo*pipsize and verte) and (MecheSup <=eq*pipsize and verte ) and (MecheInf <= es*pipsize and verte )bv30=bv28 and bv29if bv30 thenbull=1//AJendifet=4eu=5ev=2ew=2ex=3ey=3bv31= (corps>=et*pipsize and verte) and (MecheSup >= ev*pipsize and verte )and (MecheInf >= ex*pipsize and verte)bv32= (corps<=eu*pipsize and verte) and (MecheSup <=ew*pipsize and verte ) and (MecheInf <= ey*pipsize and verte )bv33=bv31 and bv32if bv33 thenbull=1//AKendifkm=6kn=6ko=13kp=14kq=2kr=3ab31=(corps>=km*pipsize and verte) and (MecheSup >=ko*pipsize and verte )and (MecheInf >=kq*pipsize and verte)ab32=(corps<=kn*pipsize and verte) and (MecheSup <=kp*pipsize and verte ) and (MecheInf <=kr*pipsize and verte )ab33=ab31 and ab32if ab33 thenbull=1//ALendifkg=8kh=8ki=0kj=0kk=3kl=3ab28=(corps>=kg*pipsize and verte) and (MecheSup >=ki*pipsize and verte )and (MecheInf >=kk*pipsize and verte)ab29=(corps<=kh*pipsize and verte) and (MecheSup <=kj*pipsize and verte ) and (MecheInf <=kl*pipsize and verte )ab30=ab28 and ab29if ab30 thenbull=1//AMendifLA=4lb=5lc=0ld=0le=8lf=9ab34=(corps>=la*pipsize and verte) and (MecheSup >=lc*pipsize and verte )and (MecheInf >=le*pipsize and verte)ab35=(corps<=lb*pipsize and verte) and (MecheSup <=ld*pipsize and verte ) and (MecheInf <=lf*pipsize and verte )ab36=ab34 and ab35if ab36 thenbull=1//ANendifks=18kt=18ku=13kv=13kw=11kx=11ab34=(corps>=ks*pipsize and verte) and (MecheSup >=ku*pipsize and verte )and (MecheInf >=kw*pipsize and verte)ab35=(corps<=kt*pipsize and verte) and (MecheSup <=kv*pipsize and verte ) and (MecheInf <=kx*pipsize and verte )ab36=ab34 and ab35if ab36 thenbull=1//ALendifka1=21ka2=22ka3=0ka4=1ka5=0ka6=1ab37=(corps>=ka1*pipsize and verte) and (MecheSup >=ka3*pipsize and verte )and (MecheInf >=ka5*pipsize and verte)ab38=(corps<=ka2*pipsize and verte) and (MecheSup <=ka4*pipsize and verte ) and (MecheInf <=ka6*pipsize and verte )ab39=ab37 and ab38if ab39 thenbull=1//AMendifka7=3ka8=3ka9=0ka10=0ka11=3ka12=3ab40=(corps>=ka7*pipsize and verte) and (MecheSup >=ka9*pipsize and verte )and (MecheInf >=ka11*pipsize and verte)ab41=(corps<=ka8*pipsize and verte) and (MecheSup <=ka10*pipsize and verte ) and (MecheInf <=ka12*pipsize and verte )ab42=ab40 and ab40if ab42 then//bull=1//ANendifLA1=4lb2=7lc3=0ld4=0le5=4lf6=40ab40=(corps>=la1*pipsize and verte) and (MecheSup >=lc3*pipsize and verte )and (MecheInf >=le5*pipsize and verte)ab41=(corps<=lb2*pipsize and verte) and (MecheSup <=ld4*pipsize and verte ) and (MecheInf <=lf6*pipsize and verte )ab42=ab40 and ab41if ab42 thenbull=1//APendifNt=2nu=2nv=0nw=1nx=25ny=27br33=(corps>=nt*pipsize and rouge) and(MecheSup >=nv*pipsize and rouge ) and (MecheInf >= nx*pipsize and rouge)//2br34=(corps<=nu*pipsize and rouge)and (MecheSup <=nw*pipsize and rouge ) and (MecheInf <= ny*pipsize and rouge )//5br35=br33 and br34if br35 thenbull=1//VI attention bougie rouge dans achat c'est normalendif//___________________________________________________________________________________________________________________________ab=7 //7ac=29//29ad=5//5ae=31//31af=1//1ag=34//34br1=(corps>=ab*pipsize and rouge) and(MecheSup >=ad*pipsize and rouge ) and (MecheInf >= af*pipsize and rouge)//2br2=(corps<=ac*pipsize and rouge)and (MecheSup <ae*pipsize and rouge ) and (MecheInf <= ag*pipsize and rouge )//5br3=br1 and br2if br3 thenbull=2//VAendifah=15ai=17aj=4ak=6al=4am=6//7br4=(corps>=ah*pipsize and rouge) and(MecheSup >=aj*pipsize and rouge ) and (MecheInf >= al*pipsize and rouge)//2br5=(corps<=ai*pipsize and rouge)and (MecheSup <ak*pipsize and rouge ) and (MecheInf <= am*pipsize and rouge )//5br6=br4 and br5if br6 thenbull=2//VBendifan=5ao=16ap=4aq=16ar=1au=16br7= (corps>=an*pipsize and rouge) and(MecheSup >=ap*pipsize and rouge ) and (MecheInf >= ar*pipsize and rouge)//2br8= (corps<=ao*pipsize and rouge)and (MecheSup <aq*pipsize and rouge ) and (MecheInf <= au*pipsize and rouge )//5br9=br7 and br8if br9 thenbull=2//VCendifaa1=6aa2=7aa3=1aa4=2aa5=4aa6=6br10= (corps>=aa1*pipsize and rouge) and(MecheSup >=aa3*pipsize and rouge ) and (MecheInf >= aa5*pipsize and rouge)//2br11= (corps<=aa2*pipsize and rouge)and (MecheSup <aa4*pipsize and rouge ) and (MecheInf <= aa6*pipsize and rouge )//5br12=br10 and br11if br12 thenbull=2//VDendifNB=8nc=9nd=3ne=4nf=0ng=1br14=(corps>=nb*pipsize and rouge) and(MecheSup >=nd*pipsize and rouge ) and (MecheInf >= nf*pipsize and rouge)//2br15=(corps<=nc*pipsize and rouge)and (MecheSup <=ne*pipsize and rouge ) and (MecheInf <= ng*pipsize and rouge )//5br16=br14 and br15if br16 thenBULL=2//VEendifPA=15PB=16pc=3pd=4pe=0pf=0bd30=(corps>=pa*pipsize and rouge) and(MecheSup >=pc*pipsize and rouge ) and (MecheInf >= pe*pipsize and rouge)//2bd31=(corps<=pb*pipsize and rouge)and (MecheSup <=pd*pipsize and rouge ) and (MecheInf <= pf*pipsize and rouge )//5bd32=bd30 and bd31if bd32 then//bull=2//VIendifNh=8ni=9nj=3nk=4nl=20nm=21br17=(corps>=nh*pipsize and rouge) and(MecheSup >=nj*pipsize and rouge ) and (MecheInf >= nl*pipsize and rouge)//2br18=(corps<=ni*pipsize and rouge)and (MecheSup <=nk*pipsize and rouge ) and (MecheInf <= nm*pipsize and rouge )//5br19=br17 and br18if br19 then//bull=2//VHendiflm=18//coupure net//10lm1=3// coupure partielle 1//6lm2=4//coupure partielle 2//5sm=3// coupure partielle 1//8sm1=5// coupure partielle 2//10sm2=11//coupure net short//11If longonmarket and close < positionprice and (barindex-tradeindex) > lm ThenSell at marketendifIf longonmarket and close > positionprice and (barindex-tradeindex) >lm1 ThenSell 0.6 contract at marketendifIf longonmarket and close > positionprice and (barindex-tradeindex) > lm2 ThenSell 0.3 contract at marketendifIf shortonmarket and close < positionprice and (barindex-tradeindex) >sm Thenexitshort 0.6 contract at marketendifIf shortonmarket and close < positionprice and (barindex-tradeindex) > sm1 Thenexitshort 0.3 contract at marketendifIf shortonmarket and close > positionprice and (barindex-tradeindex) > sm2 Thenexitshort at marketendifIF NOT LONGONMARKET AND bull=1 THENBUY 1 CONTRACT AT MARKETSET STOP ptrailing 38set target pprofit 58ELSIF not SHORTONMARKET and bull=2 THENSELLSHORT 1 CONTRACT AT MARKETSET STOP ptrailing 45set target pprofit 50ENDIF//graph bull=1 coloured(0,0,255)//graph bull=2 coloured(255,0,0)10/05/2021 at 7:50 AM #179052Entre les lignes 359 et 380, pour les fermetures des ordres, il n’y a pas de test de bougie rouge ou verte mais uniquement si le prix est supérieur à son entrée, même si c’est le cas, la bougie peut très bien être rouge.
12verte = close>openrouge = close<open -
AuthorPosts
Find exclusive trading pro-tools on