Hello again!
I share this robot that I have been testing for several months and it completely matches the backtest with reality.
It is very simple, simply fulfilling 4 conditions of several indicators.
Maybe this too prepared and suffers from being over optimized, I have practically a year following it in demo and is equal to the backtest.
I share so that you can probe with 200,000 new bars and new ideas and improve it for the good of all.
Look at the backtest that even if you put a number of bars 0, it is not, they are when you touch the take profit.
To see what it seems.
Thank you very much Raul. I’m in. About testing overfitting, I have access to a new tool in my beta VIP version. I’ll give news about it when I can talk about it.
I think you should add this strategy into the library too to drain more people, that’s why you get many feedback in the other thread. I could make it for you, but I need a short description of the strategy at least.
Hi Nicolas, I already added it
Thanks Raul. Will take a look at it tonight 🙂 Fun fact – Hora means prostitute in swedish, gonna look a bit strange in the autotrading column 😀
Cheers!
Oh sorry Raul 🙂
I’ll review it hopefully this weekend. Have a nice evening.
Thanks for this Raul. I attach the 200,000 units results. It seems fairly consistent with the exception of 2010 and 2011 which were bad years. The drawdown is too big at 42% for 5k of capital so you would need at least twice this amount to run with this strategy. I have run it in tick by tick mode but I do notice something strange about the zero bar trades P&L and entry trades timelog in general. I took an example of the 10/02/16 – 18/02/16 opening and closing trades :
The Orders list suggest they were opened on the 10th (5 trades total) and they were closed on the 17th and 18th (5 trades total). This can be confirmed by the chart as well. However, on the closed positions list the last exit trade on the 18th 5am shows as zero bar indicating that it was opened and closed in the same hour (but it wasn;t as the entry trade was made on the 10th)….. The same incorrect entry trade time errors are also present on the other non zero bar closing trades (which were opened in the 10th not the 17th as stated in the closing list). Strange, needs some more looking into….. but thanks again for sharing. Looks promising so far.
Charts attached.
PS – Sorry I could not find this post in the library section at the time.
Hey.
Since your conditions are met so many time during the same position it sometimes takes heaps of contracts av you can see in my added picture.
I´ve made it more conservative för my own test period with the code change: DEFPARAM CumulateOrders = false. But still 5 contracts.
I think that it´s better to have a MM-system than a script that cumulate orders. See added picture.
Hello! If I already have it tested, without accumulating orders, in ig, the minimum position for s & p500 is 5 contracts, ideally I would accumulate orders but from there, instead of 5 in 5, I get only 1 each time Meets the condition, thus maintaining the percentage and ratio
I’m also modifying it to work with the dow, I’ll share it shortly
Ok I didn´t realise that the minimum position size was 5 contract. I still think that it would be better with a mm system instead of accumulation. I mean 120 contract at once. That’s a big position!
Edit: Looking forward to see your dow code
Good work but be careful a strategy to purchase over a bullish period.
Same problem with Pathfinder.
However the years up are ended
Thus introduces the first operation of the minimum of 5 contracts and from there it is getting one by one.
// Definición de los parámetros del código
DEFPARAM CumulateOrders = true // Acumulación de posiciones desactivada
sl=100
n=5
if countofposition > 1 then
n=1
endif
if countofposition < 50 then
// Condiciones para entrada de posiciones largas
indicator1 = ExponentialAverage[24](MACDline[21,44,24](close))
indicator2 = MACDline[21,44,24](close)
c1 = (indicator1 <= indicator2)
indicator3 = Stochastic[28,8](close)
indicator4 = Average[22](Stochastic[28,8](close))
c2 = (indicator3 >= indicator4)
indicator8 = close + 5
ignored, ignored, indicator9 = CALL "MiIndicador(3)"(close)
c6 = (indicator8 <= indicator9)
indicator11 = close
indicator21 = ExponentialAverage[43](close)
c11 = (indicator11 >= indicator21)
IF c1 AND c2 AND c6 and c11 THEN
BUY n CONTRACT AT MARKET
ENDIF
endif
// Condiciones de salida de posiciones largas
ignored, indicator10, ignored = CALL "MiIndicador(3)"(close)
c7 = (close CROSSES under indicator10)
IF c7 THEN
SELL AT MARKET
ENDIF
SET STOP pLOSS sl
SET TARGET pPROFIT 60
The code is now available in the library: https://www.prorealcode.com/prorealtime-trading-strategies/sp500-automated-trading-strategy-eeuu-500-mini-1e-1hora/
I would suggest to make optimisation with In Sample and Out Of Sample period to validate a bit what the optimiser has found to be the best periods for your indicators. Otherwise, you’ll be kind of overfit, but you already know that 🙂
CNParticipant
Senior
Hey guys,
@raul thanks for a great system as allways. The fear I have is that this is a long only system and that we at this time in the market are at an ATH of being overbought… A decline should me iminent, that’s why I fear such a system.
Anyone that shares my fears or am I being a big baby?