Hello, I have been using this automated system for over a year, with a couple of changes but overall useful and profitable on the DAX. It enters at Frankfurt market opening.
I want to share this with the community as I have been benefited too from the knowledge and good systems shared on the page.
Please feel free to test it and any improvements are very welcome.
N parameter can be used with 1.5 to 5.5
Also if anyone can perform the 200000 bar test as well, please do it so and share the results.
Many thanks
//ALPHA - Autor: David Somogyi
// Definición de los parámetros del código
DEFPARAM CumulateOrders = False // Acumulación de posiciones desactivada
// El sistema anulará todas las órdenes pendientes y cerrará todas las posiciones a las 0:00. No se permitirá ninguna nueva orden ni posición después de la hora "FLATBEFORE".
DEFPARAM FLATBEFORE = 090000
// Anular todas las órdenes pendientes y cerrar todas las posiciones a la hora "FLATAFTER"
DEFPARAM FLATAFTER = 140000
// Dias de la semana
IF DayOfWeek = 0 OR Dayofweek = 6 THEN
tradeok = 0
ELSE
tradeok = 1
endif
// Impide al sistema crear nuevas órdenes para entrar al mercado a aumentar el tamaño de la posición antes de una hora precisa
timeEnterBefore = time = 090000
timeEnterAfter = time <= 093000
//FDI (fractal dimension index) de 1.5 //
//N = 1.5
once fdi=undefined
if barindex >= n-1 then
diff=0
length = 0
pdiff = 0
hh=0
ll=0
FDI=0
HH = highest[N](close)
LL = lowest[N](close)
for Period = 1 to N-1 do
if (HH - LL) > 0 then
diff = (customclose[Period] - LL) / (HH - LL)
if Period > 1 then
length = length + SQRT(SQUARE(diff - pdiff) + (1 / SQUARE(N)))
endif
pdiff = diff
endif
next
if length > 0 then
FDI = 1 + (LOG(length) + LOG(2)) / LOG(2 * (N))
else
FDI = 0
endif
//First trade whatever conditions
// Condiciones para entrada de posiciones largas
MSLOW = ExponentialAverage[1](Momentum[2](close))
c1 = (Momentum[2] > MSLOW[1])
//Impulse = ROC[12](close)>0
c2 = (Close > PSAR)
PSAR = SAR[0.03,0.03,0.2]
//PSARlongtrendstop = PSAR < PSAR[1] and PSAR[2] < PSAR[1]
//Condiciones de entrada de posiciones cortas
//c3 = (Momentum[2] < MSLOW[1])
//c4 = (Close < PSAR[1])
positionsize = 3
IF not onmarket and (c1 AND c2) AND timeEnterBefore and timeenterafter and FDI<1.55 and tradeok =1 THEN
BUY positionsize CONTRACT AT MARKET
ENDIF
//IF not onmarket and (c3 AND c4) AND timeEnterBefore and timeenterafter and FDI<1.5 THEN
//SELLSHORT positionsize CONTRACT AT MARKET
// Condiciones de salida de posiciones largas
//IF longonmarket and BARINDEX-TRADEPRICE = 10 THEN
//sell at market
//ENDIF
//ENDIF
// Stops y objetivos
//
//SET target profit 30
SET stop ploss 54
endif
You must be logged in to post a comment.
Hi, One year trades since Alpha running. https://imgur.com/a/TCK4kJH Hopefully it will continue working on the future. Trade safe everyone
Hello Nicolas, thanks for the support. N variable can be optimized from 0 to 50 if you would like. Same for fdi parameter which is the fractal dimension index indicator that watches de volatility at market opening. This what Genetic optimization works for. Momentum indicator as well. Like i've said, I have used this bot for a year and more and it has performed well. I have placed different stop losses and even a take profit can be set too. I did not know about the 200k test, that is why I have asked for it. As Nicolas said, everyone can do their homework and maybe share some upgrades. This is a system with lots of potential IMO, so any improvement is very welcome.
Im not sure what u mean Nicolas, maybe i have the wrong time-settings? Ive tried to optimize and tbh my optimizer window isa saying its the exact same results with N = 2-3.5 and almost same results for anything from 1.5 -> 5.5 am i missing something here? Results from 2016-2018 looks good but 2011 -> 2016 looks like crap.
you still use tihs one David?