TP sur Bollinger Middle
Forums › ProRealTime forum Français › Support ProOrder › TP sur Bollinger Middle
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by juju333.
-
-
02/16/2020 at 10:59 AM #119724
Bonjour,
J’ai honte de demander de l’aide sur ce sujet, j’arrive à faire ce genre de choses tout seul normalement, mais là je ne comprends pas pourquoi ça ne fonctionne pas !
Voir sur le schéma ci-joint et le code ci-dessous, très simple :
Admettons que j’entre short sur la bougie rouge qui suit la blanche qui a cloturé au-dessus de la Bollinger supérieure, je cherche tout simplement à définir mon tp auto sur la Bollinger middle (soit la MM20), et mon SL équivalent à 2 fois ce TP (je sais, RR pas beau, mais c’est pour l’exemple). Je fais donc la différence entre tradeprice et MM20 pour avoir mon TP en points, que je multiplie par 2 pour avoir mon SL en points. Proorder se comporte comme si mon TP n’était jamais atteint.
Je précise que je suis sur le forex, alors j’ai essayé avec *pipsize, *pointsize, mais sans succès. Un grand merci pour votre aide, ça doit être très facile pour la plupart d’entre vous ^^
12345678910111213141516171819202122bollUp = BollingerUp[20](Close)bollDown = BollingerDown[20] (Close)bollMid = Average[20](Close)signalShort = Close < bollUpsignalLong = Close > bollDown//achatIF signalLong THENBUY 1 CONTRACT AT MARKETTPlong = (bollMid - tradeprice) * pipsizeset STOP pLOSS 2*TPLongset TARGET pPROFIT TPlongENDIF//venteIF signalShort THENSELLSHORT 1 CONTRACT AT MARKETTPshort = (tradeprice - bollMid) *pipsizeset STOP pLOSS 2*TPshortset TARGET pPROFIT TPshortENDIF02/16/2020 at 11:31 AM #11972712345678910111213141516171819202122bollUp = BollingerUp[20](Close)bollDown = BollingerDown[20] (Close)bollMid = Average[20](Close)signalShort = Close < bollUpsignalLong = Close > bollDown//achatIF signalLong THENBUY 1 CONTRACT AT MARKETTPlong = (bollMid - tradeprice)/ pipsizeset STOP pLOSS 2*TPLongset TARGET pPROFIT TPlongENDIF//venteIF signalShort THENSELLSHORT 1 CONTRACT AT MARKETTPshort = (tradeprice - bollMid) /pipsizeset STOP pLOSS 2*TPshortset TARGET pPROFIT TPshortENDIFbonjour,
essayer comme ecrit si dessus
quand tu additionne de nombre a virgule . pour avoir un nombre entier tu les divises par pointsize1 user thanked author for this post.
02/16/2020 at 4:56 PM #11974002/16/2020 at 5:13 PM #11974202/16/2020 at 5:15 PM #11974302/16/2020 at 5:19 PM #11974402/16/2020 at 9:16 PM #11974602/16/2020 at 10:22 PM #119750Merci pour ton aide fifi, en effet avec le close et en gérant mieux l’ordre des instructions ça marche !
Voici le code, une fois qu’on a défini ce qui déclenche le signal long ou short :
1234567891011121314151617// ACHATIF not onmarket AND signalLong THENSLlong = (Average[20] - Close) * 2.5 / pipsizeTPlong = (Average[20] - Close) / pipsizeBUY 1 CONTRACT AT MARKETset STOP pLOSS SLlongset TARGET pPROFIT TPlongENDIF// venteIF not onmarket AND signalShort THENTPshort = (Close - Average[20]) / pipsizeSLshort = (Close - Average[20]) * 2.5 / pipsizeSELLSHORT 1 CONTRACT AT MARKETset STOP pLOSS SLshortset TARGET pPROFIT TPshortENDIF1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on