Ordre BREAKEN ne fonctionne pas
Forums › ProRealTime forum Français › Support ProOrder › Ordre BREAKEN ne fonctionne pas
- This topic has 5 replies, 3 voices, and was last updated 1 week ago by
PRC_2021.
-
-
06/04/2025 at 1:43 PM #247877
Bonjour,
Je me retrouve avec beaucoup de SL ou de TP à100 alors que j’ai mis un BREAKEVEN ainsi qu’une clôture partielle à 50% => donc je de vrait jamais avoir de TP complet (à 100) mais seulement à 50 max.
Voici le code. Merci pour votre aide.
12345678910111213141516171819202122232425262728293031/SECURISATION//Ordre AchatIF achat and Not OnMarket THENBUY 1 CONTRACT AT MARKETSLFinance = 0ENDIF//StopLoss financé à x points en coupant la moitié de la positionif longonmarket and close-tradeprice>=25 and SLFinance = 0 thensell COUNTOFPOSITION/2 CONTRACTS AT MARKETset stop BREAKEVEN //////////////////////////////////////////////////////////////SLFinance = 1endif//Ordre VenteIF vente and Not OnMarket THENSELLSHORT 1 CONTRACT AT MARKETSLFinance = 0ENDIF//StopLoss financé à x points en coupant la moitié de la positionIf shortonmarket and tradeprice-close>=25 and SLFinance = 0 thenBUY COUNTOFPOSITION/2 CONTRACTS AT MARKETset stop BREAKEVEN //////////////////////////////////////////////////////////////SLFinance = 1endif// Stops and targetsSET STOP pLOSS 25SET TARGET pPROFIT 10006/04/2025 at 4:07 PM #247893Sur les lignes 12 et 23, il est préférable d’ajouter /PipSize, sinon 25 risque de ne pas être converti correctement en différence de prix :
123if longonmarket and close-tradeprice>=25/PipSize and SLFinance = 0 thenIf shortonmarket and tradeprice-close>=25/PipSize and SLFinance = 0 thenUtilisez EXITSHORT pour quitter une position courte :
1EXITSHORTUtilisez ABS() avec CountOfPosition, car il renvoie une valeur négative pour les opérations courtes :
1EXITSHORT abs(COUNTOFPOSITION)/2 CONTRACTS AT MARKET1 user thanked author for this post.
06/04/2025 at 7:23 PM #24790706/04/2025 at 7:42 PM #247909Le problème est que la commande
Set Stop BreakEven
à la ligne 13 et à la ligne 25 est écrasée par la commandeSet Stop pLoss 25
à la ligne 30…Par conséquent, le
BreakEven
n’est jamais activé…3 users thanked author for this post.
06/05/2025 at 7:36 AM #247918JS a raison, voici le code mis à jour :
12345678910111213141516171819202122232425262728293031//SECURISATION//Ordre AchatIF achat and Not OnMarket THENBUY 1 CONTRACT AT MARKETSLFinance = 0SET STOP pLOSS 25SET TARGET pPROFIT 100ENDIF//StopLoss financé à x points en coupant la moitié de la positionif longonmarket and close-tradeprice>=25/PipSize and SLFinance = 0 thensell COUNTOFPOSITION/2 CONTRACTS AT MARKETset stop BREAKEVEN //////////////////////////////////////////////////////////////SLFinance = 1endif//Ordre VenteIF vente and Not OnMarket THENSELLSHORT 1 CONTRACT AT MARKETSLFinance = 0SET STOP pLOSS 25SET TARGET pPROFIT 100ENDIF//StopLoss financé à x points en coupant la moitié de la positionIf shortonmarket and tradeprice-close>=25/PipSize and SLFinance = 0 thenEXITSHORT abs(COUNTOFPOSITION)/2 CONTRACTS AT MARKETset stop BREAKEVEN //////////////////////////////////////////////////////////////SLFinance = 1endif06/05/2025 at 7:39 PM #247973Merci à tout les 2. Ca avance 🙂
2 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on