Hi, busy day today. Haven’t had a chance to take a look at 200k. Equity curve looks very similar to the original…
Are any of your WF OOS variables hitting your optimisations min and max values?
Hi Cosmic, unfortunately I did not take note of the optimized variables of the wf test and it took few hours to run it. Im going to check again but Im travelling until tuesday. Maybe I could work on it tomorrow afternoon.
Regards
Francesco
No worries. You can drag those results to an excel spreadsheet. It does not drag the variables used though. You have to input those manually to Excel for each OOS sample. Just hover over the x with your mouse.
Also best to take a screen shot of your optimise window so you know what you were optimising and the min and max variables you were using for them.
I tend to run 1 pass at 70/30 to begin with especially for the bigger time frames / limited amount of trades.
Hi,
very interesting strategy. Please can you indicate the latest version, with the indication of the best TF, in order to try to develope it in other instruments ?
Thanks
Hi Emanuele,
thank you for your interests in the strategy.
Sure, I attach the latest 2 version on the DAX. TIme frame 1hr and 30 mins.
I have added stoplosses and profit taking, that are optimized on the basis of a multiplier to the ATR.
Would be extremely good to know if the strategy could work on other instruments, I had a look to EUR/USD with nice results, FTSE100 and CAC40 too might be promising .
Regards
Grazie Francesco,
testero’ la strategia e provero’ su altri strumenti. Sono italiano rispondo solo questa volta in italiano e seguiranno commenti in inglese a supporto di tutti.
Grazie
Grazie a te! Speriamo che esca fuori qualcosa di interessante!
hi,
You also have a version without seasonality. I wanted to make tests with only one contract and then evaluate the introduction of seasonality or something else. If you do not have the season-free version I can change it. Thank you
There you go. I dont know if the optimizaiton works well also for the case with fixed sizes. Regards
// dax - IG MARKETS
// TIME FRAME 30min
// SPREAD 1.0 PIPS
DEFPARAM CumulateOrders = False
//DEFPARAM FLATBEFORE = 090000
//DEFPARAM FLATAFTER = 210000
timestart = 080000
timeend = 200000
timeenterbefore = time <= timeend
timeenterafter = time >= timestart
//highvolume = average[30](volume)<=volume//
//lowvolume = average[30](volume)>=volume
adxperiod = 15
atrperiod = 17
indicator1 = adx[adxperiod]
atr = AverageTrueRange[atrperiod]
//exitafternbars = 1
//// OPTIMIZED VARIABLES/////
k = 8
y = 5
adxval = 20
atrmin = 19
m = 3 // high vol coefficient for mean reversion
n = 2 //high vol coefficient for brekout
m1 = m-1 // low vol coefficient for mean reversion
n1 = n// low vol coefficient for breakout
pr = k*atr
pl = y *atr
///////////////////////////////////////
positionlong = 1//define sixe of long trades
positionshort = 1// define size of short trade
//a=5
lowvolenvironment = atr<atrmin //define lowvol environment use m1 and n1 as coefficient of movement
highvolenvironment = atr> atrmin //define highvol environment use m and n as coefficient of movement
meanrevertingenv = indicator1< adxval //define meanreverting environment
trendenv = indicator1 > adxval// define trendy environment
//////description of the possible combinations
sellhighvolmeanreverting = abs(open-close) > (atr*m) and close > open and meanrevertingenv and highvolenvironment
buyhighvolmeanreverting = abs(open-close) > (atr*m) and close < open and meanrevertingenv and highvolenvironment
buyhighvoltrendy = abs(open-close) > (atr*n) and close > open and close> DOPEN(1) and trendenv and highvolenvironment
sellhighvoltrendy = abs(open-close) > (atr*n) and close < open and close< DOPEN(1) and trendenv and highvolenvironment
selllowvolmeanreverting = abs(open-close) > (atr*m1) and close > open and meanrevertingenv and lowvolenvironment
buylowvolmeanreverting = abs(open-close) > (atr*m1) and close < open and meanrevertingenv and lowvolenvironment
buylowvoltrendy = abs(open-close) > (atr*n1) and close > open and trendenv and lowvolenvironment
selllowvoltrendy = abs(open-close) > (atr*n1) and close < open and trendenv and lowvolenvironment
////////////////////////////////////////////////////////
//long
IF (buyhighvolmeanreverting or buyhighvoltrendy or buylowvolmeanreverting or buylowvoltrendy ) and timeenterbefore and timeenterafter THEN
buy positionlong CONTRACTS AT MARKET
ENDIF
if longonmarket and time = timeend then
sell at market
endif
// short
IF (sellhighvolmeanreverting or sellhighvoltrendy or selllowvolmeanreverting or selllowvoltrendy) and timeenterbefore and timeenterafter THEN
sellshort positionshort CONTRACTS AT MARKET
endif
if shortonmarket and time = timeend then
exitshort at market
endif
set target pprofit pr
set stop ploss pl
This is such a great strategy, I have been running it for a while now and I really like the look of it.
It is really interesting because it takes one direction in the morning, and when that is in profit it somehow reverses the position the otherway and takes profit in that direction too.
Has anyone tried optimising it for other indices like FTSE or DOW? I am currently at work at the moment but when I get home I will see what results I can get on those.
Once again great work @Francesco78 !!
Thank you kg6450! 🙂
Out of curiosity, have you run any of the version in real account?
Best
Francesco
Thanks a lot Francesco for your work to improve this strategy. I’d like to help and might have a look at your code this week-end.
Thanks a lot Nicolas,that’s very kind of you.
Regards
Francesco
I made cleanup in the code for my understanding. Just launched a walk forward optimisation through 200k bars on the variables that should be adjusted overtime IMO. So your assumption about mean reverting, for a long order for instance, is : a low volatility (ATR) + no trend (with ADX criteria) and the actual candlestick is bearish?
Salut Nicolas, thanks a lot for your support.
Yes that is correct . But to be precise, I have define two vols scenarios. In both case the strategy is the same ( mean reverting or breakout depending on the adx) but in the 2 cases the condition to enter into a trade differs in the sense that the multiplier are differents. M and N in case of high vol and m1 and n1 in case of low vol.
I hope I calrified.
Regards
Francesco