Trading the 5 Min Bar
Forums › ProRealTime English forum › ProOrder support › Trading the 5 Min Bar
- This topic has 66 replies, 8 voices, and was last updated 6 years ago by Gertrade.
-
-
02/18/2018 at 7:56 PM #63057
Hi Grahal,
I’m just searching for a winning strategy in live! and for the moment I found nothing… So here is the backtest in 5mn TF with your proposition of TP 5 and SL 15. I’ve tried an optimisation with lots of other variables but no configuration brings gain. I will test other possibilities and post here if i find something good. But I am very careful, because all the promising backtests I’ve seen have lead to losses in demo or real.
02/18/2018 at 8:13 PM #63061Hi Aloysius the TP 5 and SL 15 I proposed were relevant only for the period I displayed / optimised over … 10,000 bars (and maybe going forward for weeks / months until there is an observed deviation from % winning trades and Gain to Loss ratio etc following optimisation)
Also if you backtested Gertrade version then you have backtested a 28 Sec TF version over 200,00 bars @ 5 Min TF?
Attached results of original Roberto 5 Min version over 100,000 bars @ £1 per point. I have only optimised TP, SL and the Trailing Stop Variables as below.
I am considering that Algos on this Thread may need optimising every 3 months / 5000 bars.
Cheers
GraHal123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081//-------------------------------------------------------------------------// Klinger-Rvi-Lsma DAX 5 min//-------------------------------------------------------------------------DEFPARAM CumulateOrders = FalseDEFPARAM FlatBefore = 090000 //no trades before 09:00:00DEFPARAM FlatAfter = 213000 //no trades after 21:30:00ONCE nLots = 1 //number of LOTs tradedONCE TP = 20 //23 pips Take ProfitONCE SL = 16 //16 pips Stop LossRviVal, RviSignal = CALL "RVI by John Ehlers"[7] //7KlingerVal, KlingerTrigger = CALL "Klinger oscillator"[25,44,55,1] //25,44,55,1 (ema)LeastSquareEMA = CALL "ELSMA - Least Square EMA"[11,4] //11,4//***************************************************************************************IF LongOnMarket THENIF close < LeastSquareEMA THENSELL AT MARKET //Exit LONGs when MACD reverses southwardsENDIFENDIFIF ShortOnMarket THENIF close > LeastSquareEMA THENEXITSHORT AT MARKET //Exit SHORTs when MACD reverses northwardsENDIFENDIF//***************************************************************************************trailingstart = 20//10 trailing will start @trailinstart points profittrailingstep = 2 //13 trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//***************************************************************************************// LONG trades//***************************************************************************************a1 = close > open //BULLish bara2 = KlingerTrigger CROSSES OVER KlingerVal //Klinger trigger is going northa3 = RviSignal CROSSES OVER RviVal //RVI long signal occurredIF a1 AND a2 AND a3 THENBUY nLots CONTRACT AT MARKETENDIF//***************************************************************************************// SHORT trades//***************************************************************************************b1 = close < open //BEARish barb2 = KlingerTrigger CROSSES UNDER KlingerVal //Klinger trigger is going southb3 = RviSignal CROSSES UNDER RviVal //RVI short signal occurredIF b1 AND b2 AND b3 THENSELLSHORT nLots CONTRACT AT MARKETENDIF//SET TARGET PPROFIT TPSET STOP PLOSS SL02/19/2018 at 12:01 AM #63075@ Grahal,
I realized the importance of history, I recognize that 20,000 units of history on the TF below the minute, it seems to me insufficient to validate a strategy. Right now, I’m doing tests on a TF 1 min, but I’m facing a major problem, how is it possible to make optimizations of variables of a complete strategy on 100,000 units? My PC is not powerful enough for that.
02/19/2018 at 10:08 AM #63111I Grahal,
Yes I backtested Gertrade version for 28s, in 5mn TF, because you announced good results in this configuration. But your answer shows we have not the same approach of backtests: when a backtest is good for a little period it has been optimised for, and loosing at other periods, I don’t trust it and don’t think it will be good for some weeks. Anyway, here is the 200 000 bars backtest for Roberto code in 5mn, in the version you just posted: it looks promising, thank you.
1 user thanked author for this post.
02/19/2018 at 10:46 AM #63117@Gertrade you say … how is it possible to make optimizations of variables of a complete strategy on 100,000 units? My PC is not powerful enough for that … is your PC seeming to do nothing for ages then a quick spurt of results in the optimisation table then nothing then spurt … etc? If Yes then we all have that issue not matter how powerful our PCs … its due to optimise processing happening on the remote PRT Server.
If No to above, then what symptoms are you getting that makes you think you PC is not powerful enough?
GraHal
PS @Aloysius I do think same as you re not trusting if loose over longer Out of Sample / OOS period. Thank you for posting the 200,000 bar results.1 user thanked author for this post.
02/19/2018 at 3:13 PM #63171@gertrade having said above re a spurt then a few results show in the Table then wait then another spurt etc … I have just backtested / optimised another Algo over 100,000 bars @ 5 Min TF and it completes in around 30 seconds with a lot less wait and a lot faster spurts.
So speed of optimising / backtest does depend on how complex the code is and if there any ‘ Indicator Calls’ (the code I’m checking doesn’t have any Calls).
GraHal
1 user thanked author for this post.
02/19/2018 at 11:08 PM #63227… its due to optimise processing happening on the remote PRT Server
That reassures me, I thought my PC was partly involved.
I’m able to strategize on up to 120 trades.
Beyond that, I get impatient, it becomes difficult to optimize each variable. -
AuthorPosts
Find exclusive trading pro-tools on