Compréhension stop
Forums › ProRealTime forum Français › Support ProOrder › Compréhension stop
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by @Dax30T.
-
-
06/24/2020 at 12:05 PM #137010
Bonjour, j’ai un petit souci sur un algo et je ne comprends pas . c’est sur le stop win, qui est prévue à 100 points. il se met bien en clôture( algo en m1) seulement si sur exemple d’une vente le prix baisse le stop s’adapte toutes les minutes, MAIS, si le prix remonte, le stop remonte aussi. il arrive même qu’il se replace au stop d’origine, après le 1 er BE, si les prix remonte soit a moins de 100 points, je me retrouve avec un trade non protéger. j’aimerait juste comprendre mon erreur. Merci
06/24/2020 at 1:29 PM #137023Je ne connais pas le code ni le comportement du trailing stop / breakeven que tu utilises, mais je dirai que ça ressemble à une modification du niveau de sortie peu importe où il se situe actuellement. Je pense qu’il doit manquer quelquepart un test qui permet de ne pas autoriser la modification du niveau de stop si le nouveau niveau n’est pas favorable (comme dans le cas de ta vente où tu ne souhaites bien sûr pas qu’il remonte).
06/24/2020 at 1:35 PM #137024123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 3000daysForbiddenEntry = OpenDayOfWeek = 2TIMEFRAME (DEFAULT)//(15 minutes)indicator1 = CALL "992-GT3-RSR-SIGNAL"(close)c1 = (indicator1 > 0.5)indicator2 = AverageTrueRange[14](close)c2 = (indicator2 >= 10)TIMEFRAME (20 minutes)dGreen, dRed, dGrey = Call "992-SPYDER-COLOR-ind"(close)d1green = dGreend1red = dRedd1grey = dGreyd1red=d1redd1grey=d1greyTIMEFRAME (15 minutes)IF (c1 AND c2 ) AND dgreen and d1green and not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIFTIMEFRAME (15 minutes)indicator4 = CALL "R-992-RS"c4 = (close < indicator4)IF c4 THENSELL AT MARKETENDIFindicator5 = CALL "992-GT3-RSR-SIGNAL"(close)c5 = (indicator5 <= -0.5)indicator6 = AverageTrueRange[14](close)c6 = (indicator6 >= 12)TIMEFRAME(15 minutes)IF (c5 AND c6 ) AND dRed and d1red AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIFTIMEFRAME(15 minutes)indicator8 = CALL "R-992-RS"c8 = (close > indicator8)IF c8 THENEXITSHORT AT MARKETENDIF//*****************************************IF Not OnMarket THENTrailStart = 100//BreakEven après TRAILSTART (en Pips)BasePerCent = 0.100//20.0% verrouiller bénéficesStepSize = 1 //10 STOP suiveur % PipsPerCentInc = 0.100 //10.0% PerCent increment after each StepSize chunkRoundTO = -0.5 //-0.5 rounds always to Lower integer, +0.4 rounds always to Higher integer, 0 defaults PRT behaviourPriceDistance = 30 * pipsize //12 minimun distance from current pricey1 = 0 //reset to 0y2 = 0 //reset to 0ProfitPerCent = BasePerCent //reset to desired default valueELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN //LONG positionsx1 = (close - tradeprice) / pipsize //convert price to pipsIF x1 >= TrailStart THEN // go ahead only if N+ pipsDiff1 = abs(TrailStart - x1) //difference from current profit and TrailStartChunks1 = max(0,round((Diff1 / StepSize) + RoundTO)) //number of STEPSIZE chunksProfitPerCent = BasePerCent + (BasePerCent * (Chunks1 * PerCentInc)) //compute new size of ProfitPerCentProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent)) //make sure ProfitPerCent doess not exceed 100%y1 = max(x1 * ProfitPerCent, y1) //y1 = % of max profitENDIFELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN //SHORT positionsx2 = (tradeprice - close) / pipsize //convert price to pipsIF x2 >= TrailStart THEN // go ahead only if N+ pipsDiff2 = abs(TrailStart - x2) //difference from current profit and TrailStartChunks2 = max(0,round((Diff2 / StepSize) + RoundTO)) //number of STEPSIZE chunksProfitPerCent = BasePerCent + (BasePerCent * (Chunks2 * PerCentInc)) //compute new size of ProfitPerCentProfitPerCent = max(ProfitPerCent[1],min(100,ProfitPerCent)) //make sure ProfitPerCent doess not exceed 100%y2 = max(x2 * ProfitPerCent, y2) //y2 = % of max profitENDIFENDIFIF y1 THEN //Place pending STOP order when y1 > 0 (LONG positions)SellPrice = Tradeprice + (y1 * pipsize) //convert pips to price//// check the minimun distance between ExitPrice and current price//IF abs(close - SellPrice) > PriceDistance THEN//// place either a LIMIT or STOP pending order according to current price positioning//IF close >= SellPrice THENSELL AT SellPrice STOPELSESELL AT SellPrice LIMITENDIFELSE////sell AT MARKET when EXITPRICE does not meet the broker's minimun distance from current price//SELL AT MarketENDIFENDIFIF y2 THEN //Place pending STOP order when y2 > 0 (SHORT positions)ExitPrice = Tradeprice - (y2 * pipsize) //convert pips to price//// check the minimun distance between ExitPrice and current price//IF abs(close - ExitPrice) > PriceDistance THEN//// place either a LIMIT or STOP pending order according to current price positioning//IF close <= ExitPrice THENEXITSHORT AT ExitPrice STOPELSEEXITSHORT AT ExitPrice LIMITENDIFELSE////ExitShort AT MARKET when EXITPRICE does not meet the broker's minimun distance from current price//EXITSHORT AT MarketENDIFendifif close[0] crosses under average[200] and BARINDEX-TRADEINDEX(1)<5 thensell at market//35//150endifIF longonmarket THENIF OpenDayOfWeek = 5 AND time >= 210000 THENsell at marketENDIFENDIFSET STOP %LOSS 1.4//1.7SET TARGET %PROFIT 3.1//2.1IF shortonmarket THENIF OpenDayOfWeek = 5 AND time >= 210000 THENexitshort at marketENDIFENDIFj espère que j ai bien ajouté le code, Merci Nicolas
-
AuthorPosts
Find exclusive trading pro-tools on