Discussing Matriciel EURUSD Dhigh Dlow
Forums › ProRealTime English forum › ProOrder support › Discussing Matriciel EURUSD Dhigh Dlow
- This topic has 118 replies, 33 voices, and was last updated 3 years ago by nonetheless.
-
-
01/30/2020 at 8:14 AM #118239
Check this out – by splitting into 2 strategies for long and short then re-optimizing each individually gives an extra 60% gain with combined win rate of 97% (4 losses out of 122).
More trades, more wins, lower drawdown, better best trade, better average gain, better gain/loss.
Left hand image is the combined strategy, based on Paul’s EURCAD-DhighDlow-v1p position size =1
Hi guys,
It is true that the gains are better by optimizing each strategy, long and short. However, limited risk accounts do not allow two opposite positions to be opened simultaneously as this can happen by putting these two strategies on the market.01/30/2020 at 9:30 AM #118246limited risk accounts do not allow two opposite positions
Yes, that is something to be aware of. But in that case I would be inclined to run this one long-only – almost the same return with 98% wins.
I’m on a standard account so it’s not a problem. I’ve been reviewing all my algos that run both ways and in every case they’re better off split. To me this makes total sense, as each one then has one task instead of two and is sure to be more efficient.
01/30/2020 at 10:07 AM #11825301/30/2020 at 10:22 AM #11825401/30/2020 at 10:43 AM #118257I just greyed out the relevant long / short details from each then optimized the trend and period variables. I did this over the whole 100k with no WF so you might want to look at it again, but the basic code is so good I didn’t feel that another WF was necessary. Would probably need further adjustments if looking back 200k…
My version also has money management which was off during the tests. If you want to enable it, change line 10 to MM2ndType = 1
Many thanks to Matriciel and Paul and everyone else for this excellent piece of work!
01/31/2020 at 5:10 PM #118376la version ITF du dernier code est elle qq part?
01/31/2020 at 11:25 PM #118402bertrandpinoy – English only in the English speaking forums please. 🙂
02/12/2020 at 7:12 PM #119479bertrandpinoy – Please stop posting in French in the English speaking forums. I have deleted your last post – please re-post in English or open a topic in the French forum if you wish to communicate in French.
02/19/2020 at 6:41 AM #119914Why does this strage use 2 moving averages? I have modified it use only one single MA and it works quite beautifully too.
31 wins and 4 losses over pass 10000 periods of 30 mins.
3.88 gain/loss
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576DEFPARAM CumulateOrders = FalseDEFPARAM PRELOADBARS = 10000daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0Schedule = time >= 000000 and time <= 220000PositionsizeA = 3PositionsizeV = 3MM = Average[135](totalprice)Newhighest=max(DHigh(0), DHigh(1))Newlowest=min(DLow(0), DLow(1))Middle = (Newhighest+Newlowest)/2Overbought = average[150]((Newhighest+Middle)/2)Oversold = average[150]((Newlowest+Middle)/2)CA = (MM > Overbought) and (close crosses over Middle)CV = (MM < Oversold) and (close crosses under Middle)// Long EntriesIF Schedule AND CA AND not daysForbiddenEntry AND NOT SHORTONMARKET THENBUY PositionsizeA CONTRACTS AT MARKETENDIFIF LONGONMARKET THENSELL AT TRADEPRICE +50*pointsize LIMITENDIF// Short EntriesIF Schedule AND CV AND not daysForbiddenEntry AND NOT LONGONMARKET THENSELLSHORT PositionsizeV CONTRACTS AT MARKETENDIFIF SHORTONMARKET THENEXITSHORT AT TRADEPRICE - 50*pointsize LIMITENDIF//MFE//trailing stoptrailingstop = 40//resetting variables when no trades are on marketif not onmarket thenMAXPRICE = 0MINPRICE = closepriceexit = 0endif//case SHORT orderif shortonmarket thenMINPRICE = MIN(MINPRICE,close) //saving the MFE of the current tradeif tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price levelendifendif//case LONG orderif longonmarket thenMAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current tradeif MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop thenpriceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price levelendifendif//exit on trailing stop price levelsif onmarket and priceexit>0 thenEXITSHORT AT priceexit STOPSELL AT priceexit STOPendif//SET TARGET pPROFIT 46SET STOP pLOSS 10002/19/2020 at 2:23 PM #119950OOS is very bad on GBPJPY @redfoxspacewolf
02/19/2020 at 3:00 PM #119955What is OOS?
02/19/2020 at 3:09 PM #119956OOS = out of sample. You optimized for 10,000 bars but if you run it on 100,000, or even 20,000 it fails – sorry!
02/19/2020 at 3:41 PM #119957Do you recommend that I run a 100000 period test for it to fit better? I have executed the system and it was profitable in the last 7 trades
02/19/2020 at 4:27 PM #119960Do you recommend that I run a 100000 period test for it to fit better?
All you are then doing is curve fitting it to all the data available. Best practice is to develop a strategy on part of the data available (which is your in sample test) and then test it on the rest of the data available once you have finished the strategy – this is your OOS test. If the strategy is good then it should perform the same or close on the the OOS data. If it flops then it is a sure sign that you just fitted it to your IS data – so bin it and start again. Never be tempted to tweak a failed strategy so that it works on all the data as you are just curve fitting it to all your data and then have no way to check if it is curve fitted except forward testing it on future data.
Your 7 winning trades is a good forward test so far but as a data sample it is tiny and not to be trusted. Leave it running on live demo for a few years before committing any real money to it would be my suggestion.
02/19/2020 at 4:34 PM #119962More data gives a bigger picture, but you have to do a Walk Forward analysis to check the performance in and out of sample. There’s a chapter in the manual that’ll show you how to do that.
(Posted before i saw Vonasi’s reply)
-
AuthorPosts