Dax adaptable strategy Breackout/Mean reversion
Forums › ProRealTime English forum › ProOrder support › Dax adaptable strategy Breackout/Mean reversion
- This topic has 82 replies, 13 voices, and was last updated 3 years ago by xburrex.
-
-
06/01/2017 at 7:52 AM #37185
Hello,
I didn’t saw before but short positions are more profitable than long positions. Do you find same results?
I tried to add stoploss at breakeven but results are not much better.
Good point is that demo and backtest results are more or less the same.
I’ll try to code automatic closing position after x candles because i have the impression that most of the point are win during the first candles.
Regards.
06/04/2017 at 9:18 AM #37367Hi Noisette, I also found that the results for the backtest and live are more or less the same too. Also short positions tend to be more profitable too.
Have you tried to optimise this strategy for other markets? I have tried with little success so far
1 user thanked author for this post.
06/04/2017 at 7:07 PM #37396Hi kg6450 ,
I didn’t try so far with other markets. It could be interesting with CAC to have lower leverage.
But because DAX is nervous compare with CAC, it is probably difficult to find same result.
I also should try to find wich of the conditions are the more profitable.
Regards.
I also try M15 timeframe but not good so far.
1 user thanked author for this post.
06/04/2017 at 9:03 PM #37404Thanks a lot Noisette and kg6450, I have tried with other markets too and I find something more or less nice with EUR/USD, but not as good as with DAX 30mina nd Dax 1hr
06/06/2017 at 8:32 AM #37539I have tried to optimise it for BUND, FTSE and the S&P500 on the 1hr timeframe and while they all end in profit, none of the strategies are feasible enough to run over the long term.
I am running the optimiser for the original version of the DAX1hrMNandBK strategy that you posted earlier, is that the correct one?
I will test a few more markets today too
06/06/2017 at 9:36 AM #37548Hi kg6450, yes, that’s the one, many thanks for your help!
06/06/2017 at 12:44 PM #3760706/06/2017 at 1:35 PM #37622kg 6450, you can try by adding seasonality parameters pathfinder style if the strategy is good enough without.
on the dax I did try it and this is the code, you could try to do the same for the dow hopefully you will get a nicer result.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194//-------------------------------------------------------------------------// Main code : Dax1hrMNandBreakwithseas//-------------------------------------------------------------------------// dax - IG MARKETS// TIME FRAME 1H// SPREAD 1.0 PIPSDEFPARAM CumulateOrders = False//DEFPARAM FLATBEFORE = 090000//DEFPARAM FLATAFTER = 210000timestart = 070000timeend = 200000timeenterbefore = time <= timeendtimeenterafter = time >= timestart//highvolume = average[30](volume)<=volume////lowvolume = average[30](volume)>=volumeadxperiod = 14atrperiod = 14indicator1 = adx[adxperiod]atr = AverageTrueRange[atrperiod]//exitafternbars = 1//// OPTIMIZED VARIABLES/////k = 5y = 6adxval = 18atrmin = 25m = 3 // high vol coefficient for mean reversionn = 2 //high vol coefficient for brekoutm1 = m-1 // low vol coefficient for mean reversionn1 = n// low vol coefficient for breakoutpr = k*atrpl = y *atr///////////////////////////////////////positionlong = saisonalpatternmultiplier*round(100/atr/2.1666)//define sixe of long tradespositionshort = round(100/atr)// define size of short trade//a=5lowvolenvironment = atr<atrmin //define lowvol environment use m1 and n1 as coefficient of movementhighvolenvironment = atr> atrmin //define highvol environment use m and n as coefficient of movementmeanrevertingenv = indicator1< adxval //define meanreverting environmenttrendenv = indicator1 > adxval// define trendy environment//////description of the possible combinationssellhighvolmeanreverting = abs(open-close) > (atr*m) and close > open and meanrevertingenv and highvolenvironmentbuyhighvolmeanreverting = abs(open-close) > (atr*m) and close < open and meanrevertingenv and highvolenvironmentbuyhighvoltrendy = abs(open-close) > (atr*n) and close > open and close> DOPEN(1) and trendenv and highvolenvironmentsellhighvoltrendy = abs(open-close) > (atr*n) and close < open and close< DOPEN(1) and trendenv and highvolenvironmentselllowvolmeanreverting = abs(open-close) > (atr*m1) and close > open and meanrevertingenv and lowvolenvironmentbuylowvolmeanreverting = abs(open-close) > (atr*m1) and close < open and meanrevertingenv and lowvolenvironmentbuylowvoltrendy = abs(open-close) > (atr*n1) and close > open and trendenv and lowvolenvironmentselllowvoltrendy = abs(open-close) > (atr*n1) and close < open and trendenv and lowvolenvironment////////////////////////////////////////////////////////// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 3 //0 risk(3)ONCE January2 = 0 //3 okONCE February1 = 3 //3 okONCE February2 = 3 //0 risk(3)ONCE March1 = 3 //0 risk(3)ONCE March2 = 2 //3 okONCE April1 = 3 //3 okONCE April2 = 3 //3 okONCE May1 = 1 //0 risk(1)ONCE May2 = 1 //0 risk(1)ONCE June1 = 1 //1 ok 2ONCE June2 = 2 //3 okONCE July1 = 3 //1 chanceONCE July2 = 2 //3 okONCE August1 = 2 //1 chance 1ONCE August2 = 3 //3 okONCE September1 = 3 //0 risk(3)ONCE September2 = 0 //0 okONCE October1 = 3 //0 risk(3)ONCE October2 = 2 //3 okONCE November1 = 1 //1 okONCE November2 = 3 //3 okONCE December1 = 3 // 1 chanceONCE December2 = 2 //3 ok// set saisonal multipliercurrentDayOfTheMonth = DaymidOfMonth = 15IF CurrentMonth = 1 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = January1ELSEsaisonalPatternMultiplier = January2ENDIFELSIF CurrentMonth = 2 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = February1ELSEsaisonalPatternMultiplier = February2ENDIFELSIF CurrentMonth = 3 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = March1ELSEsaisonalPatternMultiplier = March2ENDIFELSIF CurrentMonth = 4 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = April1ELSEsaisonalPatternMultiplier = April2ENDIFELSIF CurrentMonth = 5 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = May1ELSEsaisonalPatternMultiplier = May2ENDIFELSIF CurrentMonth = 6 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = June1ELSEsaisonalPatternMultiplier = June2ENDIFELSIF CurrentMonth = 7 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = July1ELSEsaisonalPatternMultiplier = July2ENDIFELSIF CurrentMonth = 8 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = August1ELSEsaisonalPatternMultiplier = August2ENDIFELSIF CurrentMonth = 9 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = September1ELSEsaisonalPatternMultiplier = September2ENDIFELSIF CurrentMonth = 10 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = October1ELSEsaisonalPatternMultiplier = October2ENDIFELSIF CurrentMonth = 11 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = November1ELSEsaisonalPatternMultiplier = November2ENDIFELSIF CurrentMonth = 12 THENIF currentDayOfTheMonth <= midOfMonth THENsaisonalPatternMultiplier = December1ELSEsaisonalPatternMultiplier = December2ENDIFendif//longIF (buyhighvolmeanreverting or buyhighvoltrendy or buylowvolmeanreverting or buylowvoltrendy ) and timeenterbefore and timeenterafter THENbuy positionlong CONTRACTS AT MARKETENDIFif longonmarket and time = timeend thensell at marketendif// shortIF (sellhighvolmeanreverting or sellhighvoltrendy or selllowvolmeanreverting or selllowvoltrendy) and timeenterbefore and timeenterafter THENsellshort positionshort CONTRACTS AT MARKETendifif shortonmarket and time = timeend thenexitshort at marketendifset target pprofit prset stop ploss pl06/06/2017 at 10:43 PM #37673Ok thanks I will add that and see how it goes, is the seasonality the same for both the DOW and the DAX though?
I tested on some currency pairs and single position for EURUSD looks promising. The equity curve could do with a bit of smoothing though
06/06/2017 at 10:48 PM #37675Hi, no I dont think so, we should retrieve them from the pathfinder discussions somewhere, Ill see if I can find them tomorrow, good job for the EURUSD, I have been tried that as well before and I confirm it looked promising, but your equity looks a bit better than mine, do you mind sharing your version of the code?
Best
06/06/2017 at 11:11 PM #37677Ok I’ll have a look there.
Here is the code for EURUSD with a 0.6 spread
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879// EUR/USD(mini) - IG MARKETS// TIME FRAME 1H// SPREAD 0.6 PIPSDEFPARAM CumulateOrders = FalseDEFPARAM FLATBEFORE =080000DEFPARAM FLATAFTER =210000adxperiod = 14atrperiod = 14indicator1 = adx[adxperiod]atr = AverageTrueRange[atrperiod]adxval = 22atrmin = 35position = 1 //round(100/atr)m = 3n = 1m1 = 2n1 = 2if atr>atrmin thenc1 = indicator1 <adxvalc2 = indicator1 >adxvalif c1 then// shortIF (abs(open-close) > (atr*m) and close > open) THENsellshort position CONTRACTS AT MARKETENDIF//longIF (abs(open-close) > (atr*m) and close < open) THENbuy position CONTRACTS AT MARKETENDIFendifif c2 then// longIF (abs(open-close) > (atr*n) and close > open and close> DOPEN(1)) THENbuy position CONTRACTS AT MARKETENDIF//shortIF (abs(open-close) > (atr*n) and close < open and close< DOPEN(1)) THENsellshort position CONTRACTS AT MARKETENDIFendifendifif atr<atrmin thenc1 = indicator1 <adxvalc2 = indicator1 >adxvalif c1 then// shortIF (abs(open-close) > (atr*m1) and close > open) THENsellshort position CONTRACTS AT MARKETENDIF//longIF (abs(open-close) > (atr*m1) and close < open) THENbuy position CONTRACTS AT MARKETENDIFendifif c2 then// longIF (abs(open-close) > (atr*n1) and close > open ) THENbuy position CONTRACTS AT MARKETENDIF//shortIF (abs(open-close) > (atr*n1) and close < open) THENsellshort position CONTRACTS AT MARKETENDIFendifendifThe parameters that were optimised for were m, n, m1, n1, atrmin and adxmin
06/07/2017 at 11:00 AM #37729great thanks
here are the seasonals for the dow as per pathfinder
12345678910111213141516171819202122232425// define saisonal position multiplier for each month 1-15 / 16-31 (>0 - long / <0 - short / 0 no trade)ONCE January1 = 0//0 ok 1ONCE January2 = 3//2 chanceONCE February1 = 2//1 chanceONCE February2 = 2//0 risk(2)ONCE March1 = 2//0 risk(2) 0ONCE March2 = 3//2 chanceONCE April1 = 3//3 okONCE April2 = 3//3 okONCE May1 = 0//3 okONCE May2 = 0//0 okONCE June1 = 2//0 risk(2) 3ONCE June2 = 2//0 risk(2) 3ONCE July1 = 3//1 chance ok 1ONCE July2 = 1//1 okONCE August1 = 0// okONCE August2 = 0// okONCE September1 = 3//0 risk(3)ONCE September2 = 3//0 risk(3)ONCE October1 = 0//0 okONCE October2 = 3//3 okONCE November1 = 0//0 okONCE November2 = 3//3 okONCE December1 = 3//3 okONCE December2 = 3//2 chance1 user thanked author for this post.
06/08/2017 at 6:25 AM #37790Hello,
Interesting code with seasonality.
I tried another way: as I saw with my previous code that monday is the most profitable, friday the less, and about same results for other 3 days then I applied different parameters for these 3 cases.
I have to try another idea and i’ll send the code.
Regards.
06/08/2017 at 6:01 PM #37842looking forward for it Noisette 🙂
06/08/2017 at 11:48 PM #37857OK.
I still have to do some tests because today in demo mode, position was closed after the time that it was suppose to do (23h40 so not logic with M30 strategy and “flatafter = 200000) and the code stop after.
And for my previous code, code stopped without any position.
Do you have this reliability problem with demo mode?
-
AuthorPosts
Find exclusive trading pro-tools on