intraday DAX strategy 5min mini1€ spread 1
Forums › ProRealTime English forum › ProOrder support › intraday DAX strategy 5min mini1€ spread 1
- This topic has 502 replies, 34 voices, and was last updated 4 years ago by Asteriks.
-
-
02/12/2017 at 7:28 PM #2490102/12/2017 at 8:08 PM #24902
I discussed the problem last Thursday with the PRT development team. Having the exact same behavior as the IG server trailing stop is quite difficult. I know they are working hard to make it more realistic, thanks to the feedback from members.
4 users thanked author for this post.
02/12/2017 at 8:48 PM #2490802/13/2017 at 4:46 PM #2498502/13/2017 at 7:37 PM #2499302/14/2017 at 9:04 PM #25091Here are Live vs Backtest results for a 1s timeframe. Overall it throws up more questions than answers. As this is being run on a 1s TF the manually coded trailing stop should update quickly and keep up with the market movement (I hope). However there are a few problems:
1)Only one trade is taken in Live on the 8th, after that, no further trades are executed in Live for the next week which is really strange.
2) The trades for the 8th don’t match up – but that could be because for some reason the backtest takes multiple positions (opening and closing) starting from 08.05 whereas Live only takes 1 position.
3) The last trade on the 8th – exit @ 080602- matches up perfectly. But that could be a coincidence.
There is still some problem with the tick by tick backtest engine it seems unless someone can spot what the problem is.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112// Definición de los parámetros del códigoDEFPARAM CumulateOrders = false // Acumulación de posiciones desactivada// La posición se cierra a las 17:29 p.m. si no toca ni stop ni take.DEFPARAM FlatAfter =163000once ordersize=1// No se abren nuevas posiciones después de la vela que se cierra a las 09:06if time=080000 thenval0800=closeendifif time=080500 thenval0805=closeendifHoraEntradaLimite = 080559//080600// El análisis de mercado empieza en la vela de 5 minutos que cierra a las 09:05HoraInicio = 080500// Órdenes máximasif Ordersize>18 thenOrdersize=18endif// Riesgo, multiplicador de contratos.n=4//6// Condiciones para el analisis.if Time >= HoraInicio and time <= HoraEntradaLimite then// Condiciones de entrada de posiciones largas.c1 = val0800 < val0805-1//open < close-1if not onmarket thenIF c1 THENIF PositionPerf(1) < 0 THENOrderSize = OrderSize/2//+1if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize =OrderSize+2endif// Si la primera barra del día de 5 min es positiva, compramos.buy ordersize*n shares at marketendif// Condiciones de entrada de posiciones cortas.c2= val0800 > val0805-1//open > close-1if not onmarket thenIF c2 THENiF PositionPerf(1) < 0 THENOrderSize = OrderSize/2//+1if ordersize<1 thenordersize=1ENDIFELSIF PositionPerf(1) > 0 THENOrderSize =OrderSize+2ENDIF// Si la primera barra del día de 5 min es negativa, vendemos.sellshort ordersize*n shares at marketendifendifendifendif//trailing stop functiontrailingstart = 5 //trailing will start @trailinstart points profittrailingstep = 1 //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 STOPENDIFSET STOP PLOSS 5.502/15/2017 at 7:21 PM #25194FYI, some modifications have been made to the backtest engine and are already available in the current platform version. The fix about the accuracy of backtests and the IG trailing stop should come in March.
1 user thanked author for this post.
02/15/2017 at 8:59 PM #2521802/16/2017 at 9:20 AM #2525102/19/2017 at 9:45 PM #25654does anybody trades this strategie in dax in live ?
what is your minimum stop distance ? does it works well ?
In france we have 18 point distance stop in live and 5 point distance stop in demo ….
in demo everything is working very well but i dont know if it will works in live ….
i would know if your distance is more than 5 point if the strategy works well in live .
02/19/2017 at 9:58 PM #25655maybe we have to code our own code to replicate classic Trailling stop
https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/
02/19/2017 at 11:32 PM #25664@ Paris. Hi – I have been running the 1s strategy live for a while now. The last few days it has worked well and performed as it should with the trailing stop updating 1 point at a time as in the code. However, it does still have some issues that I’ve still not got to the bottom of. It will need a couple of weeks more data before I can pass judgement as to how effective it is. I will post updates once I have a more fuller set of results.
1 user thanked author for this post.
02/19/2017 at 11:50 PM #2566802/19/2017 at 11:58 PM #2566902/20/2017 at 12:54 AM #25670 -
AuthorPosts
Find exclusive trading pro-tools on