Fractal breakout intraday Strategy EUR/USD 1H –
Forums › ProRealTime English forum › ProOrder support › Fractal breakout intraday Strategy EUR/USD 1H –
- This topic has 359 replies, 1 voice, and was last updated 1 year ago by RandyG.
-
-
04/16/2017 at 9:44 AM #32137
Hello guys We can discuss about the strategy here, we can help together to develop the strategy . This is the strategy posted in the Library there : https://www.prorealcode.com/prorealtime-trading-strategies/fractal-breakout-intraday-strategy-eurusd-1h/ Below you can find 3 screenshot with explanation of the stop, and levels used in this strategy.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182// EURUSD(-) - IG MARKET// TIME FRAME 1H// PROBACKTEST TICK by TICK - 200.000 bars// SPREAD 0.6 PIP// ALEDEFPARAM CumulateOrders = false///BILL WILLIAM FRACTAL INDICATOR//CP=PERIODCP=113if close[cp] >= highest[2*cp+1](close) thenLH = 1elseLH=0endifif close[cp] <= lowest[2*cp+1](close) thenLL= -1elseLL=0endifif LH=1 thenHIL = close[cp]endifif LL = -1 thenLOL=close[cp]endif//LONG and SHORT CONDITIONSPositionsize=1if (time >=100000 and time < 230000) thenC1 = (close CROSSES OVER HIL)D1 = (close CROSSES UNDER LOL)IF c1 and not shortonmarket THENBUY positionsize CONTRACT AT MARKETENDIFIF D1 and not longonmarket THENSELLSHORT positionsize CONTRACT AT MARKETENDIFENDIF//TRAILING STOPTGL =5TGS=5if not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenPREZZOUSCITA = MINPRICE+TGS*pointsizeENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIF// DONCHIAN STOPDC=20e= Highest[DC](high)f=Lowest[DC](low)if longonmarket thenlaststop = f[1]endifif shortonmarket thenlaststop = e[1]endifif onmarket thensell at laststop stopexitshort at laststop stopendifset target pprofit 30This trading sistem can be used with other currency pairs. To find the values of variables suitable for other currency pairs, you must use WF, to avoid an overfitted values: if the WF will be done on bars 200,000 may be divided into two halves, the first test will be carried out with a large range value starting with the value in the attached picture below, the second test will have a range around the variables choices during the first test. IN THE LAST YEAR THE OPTIMIZATION OF TRAILING STOP SUGGEST THIS VALUE: TGL=9 TGS=10 … THIS MEAN ABOUT 10 PIP FOR BOTH
Total of 19 users thanked author for this post. Here are last 10 listed.
04/16/2017 at 10:16 AM #32141This the reinvestment version of Kasper, in his example him stressed the strategy with 5000 lots:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102//EURUSD(-) - IG MARKET// TIME FRAME 1H// PROBACKTEST TICK by TICK - 200.000 bars// SPREAD 0.6 PIP// ALE - KASPERDEFPARAM CumulateOrders = false//KASPER CODE OF REINVESTMENTReinvest=1if reinvest thenCapital = 10000Risk = 1//0.1//in % pr positionStopLoss = 48REM Calculate contractsequity = Capital + StrategyProfitmaxrisk = round(equity*(Risk/100))MAXpositionsize=5000MINpositionsize=1Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))elsePositionsize=1StopLoss = 48Endif///BILL WILLIAM FRACTAL INDICATOR//CP=PERIODCP=113if close[cp] >= highest[2*cp+1](close) thenLH = 1elseLH=0endifif close[cp] <= lowest[2*cp+1](close) thenLL= -1elseLL=0endifif LH=1 thenHIL = close[cp]endifif LL = -1 thenLOL=close[cp]endif// RETURN, HIL COLOURED(0,200,0) AS "BREAKOUT LEVEL LONG",HIL COLOURED(200,0,0) AS "BREAKOUT LEVEL SHORT"//LONG and SHORT CONDITIONS//Positionsize=1if (time >=100000 and time < 230000) thenC1 = (close CROSSES OVER HIL)D1 = (close CROSSES UNDER LOL)IF c1 and not shortonmarket THENBUY positionsize CONTRACT AT MARKETENDIFIF D1 and not longonmarket THENSELLSHORT positionsize CONTRACT AT MARKETENDIFENDIF//TRAILING STOPTGL =5TGS=5if not onmarket thenMAXPRICE = 0MINPRICE = closePREZZOUSCITA = 0ENDIFif longonmarket thenMAXPRICE = MAX(MAXPRICE,close)if MAXPRICE-tradeprice(1)>=TGL*pointsize thenPREZZOUSCITA = MAXPRICE-TGL*pointsizeENDIFENDIFif shortonmarket thenMINPRICE = MIN(MINPRICE,close)if tradeprice(1)-MINPRICE>=TGS*pointsize thenPREZZOUSCITA = MINPRICE+TGS*pointsizeENDIFENDIFif onmarket and PREZZOUSCITA>0 thenEXITSHORT AT PREZZOUSCITA STOPSELL AT PREZZOUSCITA STOPENDIF// DONCHIAN STOPDC=20e= Highest[DC](high)f=Lowest[DC](low)if longonmarket thenlaststop = f[1]endifif shortonmarket thenlaststop = e[1]endifif onmarket thensell at laststop stopexitshort at laststop stopendifset target pprofit 30set stop loss stoploss*pointsize@kasper could you comment it?
04/16/2017 at 11:11 AM #32146Great idea Ale 🙂 how does the stoploss 48 do in the 200000 units and walk forward?
edit: I see you already did it :). Ill take a look later when on the pc
cheers Kasper
1 user thanked author for this post.
04/16/2017 at 11:30 AM #3214704/16/2017 at 11:51 AM #32148tick by tick backtest? trailingstop 5?
This is the MFE trailing stop, exit levels are only update once per bar at each calculation.
Please find attached the pictures of my own WF test with the first version of the strategy (200.000 bars, ticks mode, 1 point spread) over 10 Out Of Sample iterations.
I think that to suit the strategy for over forex pairs, the best solution would be to enlarge the fractals period (‘cp’ variable) minimum and maximum for the optimisation. That would adapt the high/low fractals for each pair behaviour. Since WF optimisation take ages, I encourage anyone willing to help to test if this rough idea could be relevant and to continue explore other possibilities of improvements. Thanks.
1 user thanked author for this post.
04/16/2017 at 2:28 PM #3218504/16/2017 at 2:50 PM #32188Hi Ale, that is just crazy numbers 🙂 I don’t have the premium version- but for 1 H data back to 1999, that is a valid test. I would like to help optimize but the data I have is only back to Jan. 2013
Please add this Graph code- to see how much you are risking at each trade.
1graph (((tradeprice-(tradeprice-((tradeprice*stoploss)/100)))*positionsize*pointvalue*100)/(equity))*100 COLOURED(0,0,0) AS "MAXRISK"04/16/2017 at 3:32 PM #3218904/16/2017 at 3:46 PM #3219004/16/2017 at 4:29 PM #32194Thanks Ale. if you use in the reinvestment code, it should very soon stabilize around 1% risk
04/16/2017 at 4:34 PM #3219504/16/2017 at 4:35 PM #3219804/16/2017 at 5:46 PM #3220204/16/2017 at 6:12 PM #3220504/16/2017 at 6:31 PM #32209 -
AuthorPosts