Mettre SL plus court PUIS Breackeven
Forums › ProRealTime forum Français › Support ProOrder › Mettre SL plus court PUIS Breackeven
- This topic has 3 replies, 2 voices, and was last updated 4 months ago by teshmi9z.
-
-
07/31/2024 at 2:11 PM #235969
bonjour, j’ai codé un strategie simple pour faire des test ( ZLEMA cross MM)
mon soucis est que j’aimerais mettre des palier de prix pour proteger mon trade, je mexpliqueCondition achat (ZLEMA 20 cross UP MM50) Target 200 SL 100:
Si Trade price + 60 point Alors on remonte le SL de 50 pts PUIS
si Trade price + 120 point Alors Breackeven
ca ne fonction pas dans mon code j’ai tous essayé mais impossible pour moi.
Si quelqu’un sais pourquoi seul la première condition marche (SL a 50) ?merci d’avance
123456789101112131415161718192021222324252627defparam CUMULATEORDERS = false// test de validation du BE avec un simple cross de MMmm20 = ZLEMA[20](close)mm50 = average[50]signalU = mm20 CROSSES OVER mm50signalD= mm20 CROSSES UNDER mm50if signalU thenbuy 1 contract at marketSET TARGET pPROFIT 200set stop loss 100endifif longonmarket thenif high-tradeprice >= 60*pointsize thenset stop loss 50slUp=1endifif high-tradeprice >=120*pointsize THENset stop BREAKEVENendifif signalD THENsell at marketendifendif07/31/2024 at 3:42 PM #235980Bonjour, il a légèrement modifié et ajouté un stoploss variable pour que vous puissiez l'actualiser.
12345678910111213141516171819202122232425262728293031323334defparam CUMULATEORDERS = false// test de validation du BE avec un simple cross de MMmm20 = ZLEMA[20](close)mm50 = average[50]signalU = mm20 CROSSES OVER mm50signalD= mm20 CROSSES UNDER mm50if signalU thenbuy 1 contract at marketSET TARGET pPROFIT 200set stop ploss 100endifif longonmarket thenif not longonmarket[1] thenstoploss=tradeprice-100*pointsize*pointvalueendifif high-tradeprice >= 60*pointsize thenstoploss=tradeprice-50*pointsize*pointvalueset stop ploss 50slUp=1endifif high-tradeprice >=120*pointsize*pointvalue THENstoploss=tradepriceset stop BREAKEVENendifif signalD THENsell at marketendifendifgraphonprice stoploss coloured("red")08/01/2024 at 7:56 AM #235994merci de ta réponse, du coup de mon coté j’avais continué a développer un système à 3 postions de réglages:
1: décalage du SL2 et 3 : modification du STOP WIN
le système me parait fonctionnel
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889defparam CUMULATEORDERS = true// test de validation du BE avec un simple cross de MMmm20 = ZLEMA[20](close)mm50 = average[50](close)//conditions OrdersignalU = mm20 CROSSES OVER mm50signalD= mm20 CROSSES UNDER mm50////////// Trade mangement/////////////////BUYBuyTP1=60 // Target pour monter le SLBuySL1=50 // Nouveau SLBuyBE1=100 // Seuil BE 1BBE1=20 // Trade price + pointsBuyBE2=120 // Seuil BE 2BBE2= 60 // trade price + Pointif signalU thenbuy 1 contract at marketSET TARGET pPROFIT 220set stop loss 100endifif signalD thensellshort 1 contract at marketset target profit 200set stop loss 80endif//LONG CONDITIONif not onmarket thenbe=0endifif longonmarket and close-tradeprice>=BuyBE1 *pointsize thenbe=1endifif be=1 thensell at tradeprice+BBE1*pointsize stopendifif not onmarket thenbee=0endifif longonmarket and close-tradeprice>=BuyBE2*pointsize thenbee=1endifif bee=1 thensell at tradeprice+BBE2*pointsize stopendifSL1=high-tradeprice >= BuyTP1 *pointsizeif longonmarket thenif SL1 thenset stop loss BuySL1endifendif//SHORTSellTP1=50 // Target pour descendre le SLSELLSL1=50 // Nouveau SLSellBE1=80 // Seuil BE 1SBE1=20 // Trade price + pointsSellBE2=150 // Seuil BE 2SBE2= 50 // trade price + Pointif not onmarket thenSbe=0endifif SHORTONMARKET and tradeprice-close>=SellBE1 *pointsize thenSbe=1endifif Sbe=1 thenexitshort at tradeprice-SBE1*pointsize stopendifif not onmarket thenSbee=0endifif SHORTONMARKET and tradeprice-close>=SellBE2*pointsize thenSbee=1endifif Sbee=1 thenexitshort at tradeprice-SBE2*pointsize stopendif//SL2=high-tradeprice <= SellTP1 *pointsizeif SHORTONMARKET THENif SL2 thenset stop loss SELLSL1endifendif08/04/2024 at 8:11 AM #236116voici une version ameliorer par Mistral Ia
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889defparam CUMULATEORDERS = true// Calcul des moyennes mobilesmm20 = ZLEMA[20](close)mm50 = average[50](close)// Conditions de croisementsignalU = mm20 CROSSES OVER mm50signalD = mm20 CROSSES UNDER mm50// Paramètres de gestion des tradesBuyTP1 = 60 // Target pour monter le SLBuySL1 = 50 // Nouveau SLBuyBE1 = 100 // Seuil BE 1BBE1 = 20 // Trade price + pointsBuyBE2 = 120 // Seuil BE 2BBE2 = 60 // Trade price + pointsSellTP1 = 50 // Target pour descendre le SLSELLSL1 = 50 // Nouveau SLSellBE1 = 80 // Seuil BE 1SBE1 = 20 // Trade price + pointsSellBE2 = 150 // Seuil BE 2SBE2 = 50 // Trade price + points// Entrée en positionif signalU thenbuy 1 contract at marketset target profit 220set stop loss 100endifif signalD thensellshort 1 contract at marketset target profit 200set stop loss 80endif// Gestion des positions longuesif not onmarket thenbe = 0bee = 0endifif longonmarket thenif close - tradeprice >= BuyBE1 * pointsize thenbe = 1endifif be = 1 thensell at tradeprice + BBE1 * pointsize stopendifif close - tradeprice >= BuyBE2 * pointsize thenbee = 1endifif bee = 1 thensell at tradeprice + BBE2 * pointsize stopendifif high - tradeprice >= BuyTP1 * pointsize thenset stop loss BuySL1endifendif// Gestion des positions courtesif not onmarket thenSbe = 0Sbee = 0endifif SHORTONMARKET thenif tradeprice - close >= SellBE1 * pointsize thenSbe = 1endifif Sbe = 1 thenexitshort at tradeprice - SBE1 * pointsize stopendifif tradeprice - close >= SellBE2 * pointsize thenSbee = 1endifif Sbee = 1 thenexitshort at tradeprice - SBE2 * pointsize stopendifif tradeprice - high >= SellTP1 * pointsize thenset stop loss SELLSL1endifendif1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on