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.
-
-
02/20/2020 at 12:12 PM #12003402/20/2020 at 12:38 PM #120038
valflare – Please don’t type in all capital letters. The use of capitals is considered as shouting in forums. In these forums you will find that code words will sometimes be typed in capital letters to highlight that they are different from normal text but otherwise we try to keep the shouting to a minimum! 🙂
02/25/2020 at 10:30 PM #120507Hello gentlemen,
I also made some modifications to this highly interesting EUR/CAD 15m strategy. Changes:
- Changed spread to 2.5 since that is what IG uses on EUR/CAD.
- Added a re-invest code found on this forum. It’s highly flexible, choose your own risk by adjusting the last line (I set 25 to default. 100 = 1 contract). Thank you creator of that code!
- Lower stop loss (didn’t have effect on backtesting, just the illusion of lower risk and keep IG happy when go live).
- Removed graphonprice to allow it to run on automatic trading in demo.
As mentioned by the original creator Matriciel the time-in-market is i bit high which will add interest cost. But the % winning trades and gain/loss ratio is fabulous. It would be nice to not have a large MAE in almost every trade but I don’t know how to fix that 🙂
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166// EURCAD Dhigh/Dlow v2 15m// spread 2.5defparam cumulateorders = falsedefparam preloadbars = 10000//once enablets = 1once select=2 // optimized for period1,2,3once tds =1 // added on optimized results// code re-investCapital = 10000Equity = Capital + StrategyProfitPosition = Max(1, Equity * (1/Capital))Position = Round(Position*100)Position = Position/25if select=1 then // TF 15 MINtr1=45tr2=25period1=78period2=12period3=4elsif select=2 then // TF 15 MINtr1=45tr2=20period1=84period2=6period3=8endif// trend detectionif tds=0 thentrendup=1trenddown=1elseif tds=1 thentrendup=(Average[tr1](close)>Average[tr1](close)[1])trenddown=(Average[tr2](close)<Average[tr2](close)[1])elseif tds=2 thenendifendifendif// strategy//ctime = time >= 000000 and time <= 220000mm = average[period1,3](totalprice)Newhighest=max(DHigh(0), DHigh(1))Newlowest=min(DLow(0), DLow(1))avghl = (Newhighest+Newlowest)/2c1 = average[period2,period3]((Newhighest+avghl)/2)c2 = average[period2,period3]((Newlowest+avghl)/2)condbuy = mm > c1condbuy = condbuy and close crosses over avghlcondbuy = condbuy and trendupcondsell = mm < c2condsell = condsell and close crosses under avghlcondsell = condsell and trenddown////if ctime thenif condbuy thenbuy position contract at marketendifif condsell thensellshort position contract at marketendif//endif// trailing stop atrif enablets then//once steps=0 // set to 0 to ignore stepsonce minatrdist=16once atrtrailingperiod = 14 // atr parameter valueonce minstop = 0 // minimum trailing stop distanceif barindex=tradeindex thentrailingstoplong = 16 // trailing stop atr relative distancetrailingstopshort = 16 // trailing stop atr relative distanceelseif longonmarket thenif prezzouscita>0 thenif trailingstoplong>minatrdist thenif prezzouscita>prezzouscita[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-stepsendifelsetrailingstoplong=minatrdistendifendifendifif shortonmarket thenif prezzouscita>0 thenif trailingstopshort>minatrdist thenif prezzouscita<prezzouscita[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-stepsendifelsetrailingstopshort=minatrdistendifendifendifendif//atrtrail=averagetruerange[atrtrailingperiod]((close/1)*pipsize)trailingstartl=round(atrtrail*trailingstoplong)trailingstarts=round(atrtrail*trailingstopshort)tgl=trailingstartltgs=trailingstartsif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenmaxprice=0minprice=closeprezzouscita=0endif//if longonmarket thenmaxprice=max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thenprezzouscita=maxprice-tgl*pointsizeelseprezzouscita=maxprice-minstop*pointsizeendifendifendif//if shortonmarket thenminprice=min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thenprezzouscita=minprice+tgs*pointsizeelseprezzouscita=minprice+minstop*pointsizeendifendifendif//if longonmarket thenif prezzouscita>0 thensell at prezzouscita stopendifendifif shortonmarket thenif prezzouscita>0 thenexitshort at prezzouscita stopendifendifendifset stop %loss 1.702/26/2020 at 12:16 AM #12051202/26/2020 at 8:44 AM #120525Weird … I don’t get the same curve or stats as you and there is no Time that I need to align with UK time, so I can’t think why we should be different.
I’m on SB and you are on CFD but I would expect that to only show a minor difference in performance stats?
Any thoughts anyone or what do you get??
I’ll try it on my CFD Platform.
EDIT / PS
Yep …. on CFD same as you now @swedshare … see 3rd image … how unsettling is that??
Can only be that IG are playing around with the SB data to our disadvantage??
Price and spread (2.5) are the same currently on SB and CFD, but they can’t always be else performance stats would be same on SB as CFD … or has my coffee not worked through yet?? 🙂
02/26/2020 at 8:57 AM #1205323rd image attached (missed off from above post).
I get 74 trades on CFD (same as you) but I only get 58 trades on SB … and both charts are running over the same time period of 100k bars.
Very worrying anomaly for us British .. is Brexit hurting us already!!?? 🙂 🙂
03/10/2020 at 8:46 AM #12163004/09/2020 at 5:26 PM #125473Alfred, you don’t really need to care about the time. It can run 24/7. The important part to notice is the relatively high risk. When/if a trade reaches its stoploss you will get a big loss.
Another factor to consider is why the strategy only seems to work well on EUR/CAD and not the other currency pairs. That should rise a red flag 🙂
1 user thanked author for this post.
04/09/2020 at 6:49 PM #125480Hello to you all,
I have a good feedback on the EUR code USD H1. May I am still blocking about partial fences, impossible to run in prorder. Can one of you help me?04/09/2020 at 7:10 PM #125486May I am still blocking about partial fences
Above does not make sense.
But if you mean partial closures? ProOrder does not allow partial closures.
Change Sell and Exitshort to below
12Sell at MarketExitShort at Market1 user thanked author for this post.
04/10/2020 at 8:08 AM #12552304/11/2020 at 4:53 PM #125713Hello Grahall, thank you for your reply. Indeed my first message was incorrectly translated by my English translation software. But you get it.
Despite your trick, I can’t get the code to work.
If I send it to you, can you make the changes? I am a poor coder yet… To read you, thank you, cordially.04/16/2020 at 8:34 AM #126351Hi all, I backtested the EurUsd 15min and the EurCad 15min v2 and… 97% win. I actually tried to activate autotrading on my demo account of both with max 1 contract (100.000) and I’ll see. I just had to “//” the graph function on EurUSd otherwise the system won’t let me use it.
Is there some parameter for auto trading you suggest me to set up?
Thanks a lot
04/16/2020 at 8:43 AM #12635204/16/2020 at 12:03 PM #126386Hi @MAKSIDE
I definately have doubts about the long term robustness of the strategy. I made some minor changes since the v2. See attached for current version. I have disabled the re-invest and only buy 1 contract each time. Also don’t hold position over weekend. If you would like to check how the equity curve developes in 200k it would be appreciated. Spread is now set to 6 to reflect what IG offers. Initial capital 1000 CAD.
EURCAD Dhigh/Dlow 15m v3123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186// Created by Matriciel. Added MM, riskM and calender by swedshare// EURCAD Dhigh/Dlow v3 15m// spread = 6 (actual spread on IG CFD)defparam cumulateorders = falsedefparam preloadbars = 5000//code re-investCapital = 1000 // initial capitalEquity = Capital + StrategyProfitPosition = Max(1, Equity * (1/Capital))Position = Round(Position*100)Position = Position/100 // not activated. Change "1" to "position" in the buy conditions to use re-invest.//********************set stop %loss 1.30//code quit strategymaxequity = max(equity,maxequity)DrawdownNeededToQuit = 40 // percent drawdown from max equity to stop strategyif equity < maxequity * (1 - (DrawdownNeededToQuit/100)) thenquitendif//*****************// Force close of positions at Friday 21:30:00 (UTC+2 Europe/Berlin)if dayofweek = 5 and time = 213000 thenIF longonmarket THENSELL AT MARKETendifif shortonmarket thenEXITSHORT AT MARKETENDIFENDIF//*************// Don't take position after friday 20:00:00 (UTC+2 Europe/Berlin)BadTime = dayofweek = 5 AND OpenTime > 200000//*************once enablets = 1once select=1 // optimized for period1,2,3once tds =1 // added on optimized resultsif select=1 then // TF 15 MINtr1=45tr2=25period1=78period2=12period3=4elsif select=2 then // TF 15 MINtr1=45tr2=20period1=84period2=6period3=8endif// trend detectionif tds=0 thentrendup=1trenddown=1elseif tds=1 thentrendup=(Average[tr1](close)>Average[tr1](close)[1])trenddown=(Average[tr2](close)<Average[tr2](close)[1])elseif tds=2 thenendifendifendifmm = average[period1,3](totalprice)Newhighest=max(DHigh(0), DHigh(1))Newlowest=min(DLow(0), DLow(1))avghl = (Newhighest+Newlowest)/2c1 = average[period2,period3]((Newhighest+avghl)/2)c2 = average[period2,period3]((Newlowest+avghl)/2)condbuy = mm > c1condbuy = condbuy and close crosses over avghlcondbuy = condbuy and trendupcondsell = mm < c2condsell = condsell and close crosses under avghlcondsell = condsell and trenddownif condbuy and not BadTime thenbuy 1 contract at marketendifif condsell and not BadTime thensellshort 1 contract at marketendif//endif// trailing stop atrif enablets then//once steps=0 // set to 0 to ignore stepsonce minatrdist=16once atrtrailingperiod = 14 // atr parameter valueonce minstop = 0 // minimum trailing stop distanceif barindex=tradeindex thentrailingstoplong = 16 // trailing stop atr relative distancetrailingstopshort = 16 // trailing stop atr relative distanceelseif longonmarket thenif prezzouscita>0 thenif trailingstoplong>minatrdist thenif prezzouscita>prezzouscita[1] thentrailingstoplong=trailingstoplongelsetrailingstoplong=trailingstoplong-stepsendifelsetrailingstoplong=minatrdistendifendifendifif shortonmarket thenif prezzouscita>0 thenif trailingstopshort>minatrdist thenif prezzouscita<prezzouscita[1] thentrailingstopshort=trailingstopshortelsetrailingstopshort=trailingstopshort-stepsendifelsetrailingstopshort=minatrdistendifendifendifendif//atrtrail=averagetruerange[atrtrailingperiod]((close/1)*pipsize)trailingstartl=round(atrtrail*trailingstoplong)trailingstarts=round(atrtrail*trailingstopshort)tgl=trailingstartltgs=trailingstartsif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thenmaxprice=0minprice=closeprezzouscita=0endif//if longonmarket thenmaxprice=max(maxprice,close)if maxprice-tradeprice(1)>=tgl*pointsize thenif maxprice-tradeprice(1)>=minstop thenprezzouscita=maxprice-tgl*pointsizeelseprezzouscita=maxprice-minstop*pointsizeendifendifendif//if shortonmarket thenminprice=min(minprice,close)if tradeprice(1)-minprice>=tgs*pointsize thenif tradeprice(1)-minprice>=minstop thenprezzouscita=minprice+tgs*pointsizeelseprezzouscita=minprice+minstop*pointsizeendifendifendif//if longonmarket thenif prezzouscita>0 thensell at prezzouscita stopendifendifif shortonmarket thenif prezzouscita>0 thenexitshort at prezzouscita stopendifendifendif1 user thanked author for this post.
-
AuthorPosts