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.
-
-
10/07/2017 at 3:57 PM #4855910/07/2017 at 4:10 PM #4856010/07/2017 at 5:32 PM #4856810/07/2017 at 5:35 PM #48569
Thanks for that Ronny. It seems that the ATR based Stoploss and TakeProfit although profitable may not necessarily be an improvement on fixed SL and TP levels. Early on there is a big drawdown which is what I always fear with short period ATR based decisions. A big candle can leave you vulnerable with a big stoploss calculated from it. Pity really as markets are changing animals and ATR always seems to be a good way to stay in tune with the market but unfortunately ATR can be too spiky or too laggy depending how fast or slow you set it – just like any MA.
Out of interest how did you decide on the fixed levels for SL and TP that you chose – was it an optimization backtest?
10/08/2017 at 7:35 AM #48585in resume, you have this code?
because on backtest, they are a problem
//EURUSD(DFB) – IG MARKET
// TIME FRAME 1H
// PROBACKTEST TICK by TICK
// SPREAD 0.9 PIP
// ALE – KASPER – VONASIDEFPARAM CumulateOrders = false
CP = 101 //Fractal Period
RSINum = 2
Ave = 7 //AverageTrueRange Period
TGLMult = 0.6 //ATR multipier for TGL
STPMult = 1.8 //ATR multiplier for StopLoss
AddOn = 1.1 //Added to STPMult for TakeProfit
RSIHighLevel = 80RSILowLevel = 100 – RSIHighLevel
//KASPER CODE OF REINVESTMENT
Reinvest=1
if reinvest then
Capital = 5000
Risk = 1//0.1//in % pr position
StopLoss = AverageTrueRange[Ave] * STPMult
TakeProfit = AverageTrueRange[Ave] * STPMult + AddOnREM Calculate contracts
equity = Capital + StrategyProfit
maxrisk = (equity*(Risk/100))
MAXpositionsize=5
MINpositionsize=1
Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(((maxrisk/StopLoss)))))
else
Positionsize=1
StopLoss = AverageTrueRange[Ave] * STPMult
TakeProfit = AverageTrueRange[Ave] * STPMult + AddOn
Endif///BILL WILLIAM FRACTAL INDICATOR
if Close[cp] >= highest[2*cp+1](Close) then
LH = 1
else
LH = 0
endif
if Close[cp] <= lowest[2*cp+1](Close) then
LL = -1
else
LL = 0
endif
if LH = 1 then
HIL = Close[cp]
endif
if LL = -1 then
LOL = Close[cp]
endif//CumulativeRSI2
RSI2 = (SUMMATION[RSINum](RSI[RSINum](Close)))/RSINum
RSILow = RSI2 < RSILowLevel
RSIHigh = RSI2 > RSIHighLevel//LONG and SHORT CONDITIONS
if (time >=100000 and time < 230000) then
C1 = (close CROSSES OVER HIL)
D1 = (close CROSSES UNDER LOL)IF c1 and NOT ShortOnMarket and RSIHigh THEN
PositionMultiple = (RSI2/100) + 1//Increase PositionSize depending on CumRSI2 level
PositionSize = (PositionSize/((RSIHighLevel/100)+1)) * PositionMultiple
PositionSize = Round(PositionSize * 100)
PositionSize = PositionSize / 100
BUY positionsize CONTRACT AT MARKET
ENDIFIF D1 and NOT LongOnMarket and RSILow THEN
PositionMultiple = ((100-RSI2)/100) + 1//Increase PositionSize depending on CumRSI2 level
PositionSize = (PositionSize/((RSIHighLevel/100)+1)) * PositionMultiple
PositionSize = Round(PositionSize * 100)
PositionSize = PositionSize / 100
SELLSHORT positionsize CONTRACT AT MARKET
ENDIF
ENDIF//TRAILING STOP
TGL = AverageTrueRange[Ave] * TGLMult
TGS = TGL
if not onmarket then
MAXPRICE = 0
MINPRICE = close
PriceExit = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
PriceExit = MAXPRICE-TGL*pointsize
ENDIF
ENDIF
if shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*pointsize then
PriceExit = MINPRICE+TGS*pointsize
ENDIF
ENDIF
if onmarket and PriceExit>0 then
EXITSHORT AT PriceExit STOP
SELL AT PriceExit STOP
ENDIFset target profit TakeProfit
set stop ploss stoploss10/08/2017 at 9:50 AM #48607I kind of agree with the ATR-way of setting TP and SL. But I feel I lose control with the risk managment, and ususally prefer to use the fixed ones. The values I used in the backtest is from the top of my head at the time. I have now run a WF-test which returned a takeprofit of 50 and stoploss at 75… Every trader has his own risk profile 🙂 The results from the testing of this strategy seems to return too good of values, it’s easy to think overfit. But as I said, the results of live trading a similar strategy returns good results (but not in significant numbers yet).
Yes, there’s something wrong with the reinvest code. I don’t know what.
10/08/2017 at 4:00 PM #48630Thanks for doing that test Ronny. Interesting that your off the top of your head numbers had higher TP than SL but the WF test gave higher SL than TP. What was the win rate and returns like compared to your numbers? I prefer at least 1:1 Risk to Reward as even by tossing a coin I can be right 50% of the time – although give me a strategy with an almost certain 100% win rate and I’ll obviously take a worse R/R ratio!
Is the strategy that you say you are testing live ALE’s original strategy or another one that you have – if another one would you be able to share it for comparison purposes?
10/08/2017 at 4:15 PM #48631The higher the stoploss is the higher win percentage you will have, as you say. And often much better results. The problem is the DD that will occur, that can wipe us out. I agree with you that RR of 1:1 is minimal. For that reason I’m a bit hesitant to let the optimalization “decide” this values. I’ll try with some values I’ll like to live with, and run OOS without any optimalization. For the TP and SL.
Here’s the code running live since May:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115//-------------------------------------------------------------------------// Main code : PRC - FBS_EURUSD_60M_V2//-------------------------------------------------------------------------//EURUSD(-) - IG MARKET// TIME FRAME 1H// PROBACKTEST TICK by TICK - 200.000 bars// SPREAD 0.6 PIP// ALEDEFPARAM CumulateOrders = falseDC=20// period of Donchian StopTGL=5//Trailing Stop pip distanceTGS=5TP=30//SLIF LONGONMARKET THENDC=20// period of Donchian StopTGL=5//Trailing Stop pip distanceTP=30//take profit//SL=50// stop lossELSIF SHORTONMARKET THENDC=20// period of Donchian StopTGS=5TP=30//SL=50ENDIF//KASPER CODE OF REINVESTMENTReinvest=0if reinvest thenCapital = 10000Risk = 1//0.1//in % pr positionStopLoss = 40REM Calculate contractsequity = Capital + StrategyProfitmaxrisk = round(equity*(Risk/100))MAXpositionsize=5000MINpositionsize=1Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))elsePositionsize=1StopLoss = 40Endif///BILL WILLIAM FRACTAL INDICATOR MODIFIEDCPL=80//period of superior fractal levelCPS=100//period of inferior fractal levelif close[CPL] >= highest[2*CPL+1](close) thenLH = 1elseLH=0endifif LH=1 thenHIL = close[CPL]endifif close[CPS] <= lowest[2*CPS+1](close) thenLL= -1elseLL=0endifif LL = -1 thenLOL=close[CPS]endif//LONG and SHORT CONDITIONSRL=0 // range long candlesRS=0 // range short candlesif (time >=100000 and time < 230000) thenA1 = (close CROSSES OVER HIL)A2 = (close CROSSES UNDER LOL)FL= (CLOSE-OPEN)>=RL*POINTSIZEFS= (CLOSE-OPEN)<=-RS*POINTSIZEIF A1 and not shortonmarket AND FL THENBUY positionsize CONTRACT AT MARKETENDIFIF A2 and not longonmarket AND FS THENSELLSHORT positionsize CONTRACT AT MARKETENDIFENDIF//TRAILING STOPif 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 STOPf=Lowest[DC](low)e= Highest[DC](high)if longonmarket thenlaststop = f[1]endifif shortonmarket thenlaststop = e[1]endifif onmarket thensell at laststop stopexitshort at laststop stopendifSET STOP PLOSS StopLossSET TARGET PPROFIT TP10/08/2017 at 5:33 PM #4864210/08/2017 at 7:59 PM #4866210/08/2017 at 8:51 PM #48665Thanks for sharing that Ronny. It looks very similar to what ALE first posted on this thread except with different fractal look back periods for upper and lower fractals and also with a candle body size condition that is not used. My quick backtest of it shows that it performed better in the past than recently which makes me think it may be a little over fitted. Different periods for upper and lower fractals rings alarm bells for fitting. The fractal period is my major concern with this strategy as it is the most likely thing to be fitted to past market movements. Having said that a wide range of cp numbers result in profit of some sort or other so it does still seem to be a method worth progressing with.
Can I ask where you got that strategy from? Is there an old thread that I missed that I could read?
10/08/2017 at 9:50 PM #4866910/08/2017 at 11:24 PM #4867710/13/2017 at 10:21 AM #49247Bonjour à tous, Quelqu’un at-il eu la dernière version du code FBS qui fonctionne avec IG PRT.
there are many different version. which is the most optimized? Thank you for your answers
10/14/2017 at 10:23 AM #49348Here is a GBPUSD 15M LONG
version of the strategy (100,000 bars, backtest tick by tick, 2 point spread)With the reinvestment version with the Kasper code, in my example the risk per position is 2%
Can you tell me what you think?
If somebody would have time to do it with the version 200.000 bars this would be well. thank you -
AuthorPosts