Strategy Eur/Usd mini, how to reduce the maximum % drawdown?
Forums › ProRealTime English forum › ProOrder support › Strategy Eur/Usd mini, how to reduce the maximum % drawdown?
- This topic has 54 replies, 7 voices, and was last updated 4 years ago by Gregg.
-
-
07/08/2019 at 8:47 AM #102125
Hi Vonasi,
Thanks for the feedback. I am not sure to follow you, do you mean to just exit everyday at 21:00? If that is what you mean I think is normal that the result is not good, IMHO that goes against the logic of the system.
I added two exits:
- the first one anyday at 21:00 if the positionperf>0 and barindex-tradeindex>70. I wanted to reduce the time in market and take quick profits after several days without reaching the limit exit order. This one make the result of the system better but without it, still is a good result.
- Another one is with positionperf<0 and other conditions, but doesn´t matter because it almost don´t act, you can take it out and won´t change much.
But IMHO if you just put to exit EVERYDAY at 21:00 you won´t let the logic of the system to work properly, because often it needs several days to get to the exit´s limit price of the original system. If you put the same condition in the original system I think it won´t work also.
I would like to hear also the opinion of the creator of the system (Coscar) about all this
07/08/2019 at 1:50 PM #102168Sorry TempusFugit but I just realised that I read through your code rather quickly and misread it. I was working under the illusion that the conditions were all separate exit conditions whereas they are actually all combined as one
I’m still not sure that they add anything to the strategy of much worth. In my 100k bar test the LOSSEXIT condition was only ever met once. The WINEXIT condition was met 49 times but this just resulted in less overall gain. Time in market was less but with a long and short forex strategy overnight fees are not a major concern as you get paid to be short and you pay to be long.
The win rate was higher by just over 5% but the gain/loss ratio was lower.
With the exit conditions the longest trade was held for 116 bars/hours. Without the conditions only seven trades went longer than this 116 hours and the longest was still only 159 hours.
I’m just not sure that the extra conditions add very much and they definitely reduced profit per trade in the tested data sample.
07/08/2019 at 3:38 PM #102176I agree with you Vonasi, the exit conditions I added are not essential to the system, I like them because they reduce the time in the market quite a lot but the system don´t need them if you don´t want them.
The important point of my version is that I translated this fine system from the 1D TF to 1H TF keeping the good results. I just wanted to share that.
07/08/2019 at 4:07 PM #102180Thank you all for your interest and collaboration in implementing the code. An alternative may be to modify the exit of trades with instruments that do not require optimization. I am currently testing with john ehlers filters. When I get results I’ll post the code. good job
07/08/2019 at 5:29 PM #102196I have had the end of day version running live on demo since 18 December 2018 and I thought that the comparison between backtesting and live forward testing might be of interest to others so I post the results here.
My demo account had several issues that meant that the strategy was stopped several times and many of my strategies went through a long phase of not opening positions – although I can’t confirm that this was one of them but because of all this the trade quantities are different and my live version missed the biggest loser. Despite all this the strategy seems to have traded pretty well so far.
Live test is on the left in the images and backtest is on the right.
1 user thanked author for this post.
07/18/2019 at 2:48 PM #102836Hi guys presents a variant of the code created with the addition of an output based on the filter by John Ehlers, plus I added some optional features like Martingala, Capital reinvestment. I tested the system starting from a minimum capital of € 500.00 and I always got the same result, it seems that the system is quite stable in the long run. I hope someone can take an interest and improve it. Share the variations. Thank you
Coscar BOP Eur/Usd mini Timeframe 1D Capitalini123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130//@Coscar Break Out Point| Eur/Usd mini - 1D Capital Ini Eur 500,00DEFPARAM CUMULATEORDERS= falseDEFPARAM PRELOADBARS = 10000//***********************************************************************************************************CapitalIni = 10000 // Capitale iniziale cifra intera min € 500,00CapitalRisk = 10 // Percentuale di rischio del capitaleNrContratti = 0.5 // numero di contratti inizialiMargineBroker = 378 // Margine richiesto dal broker IG MARKET per 1 contratto Eur/Usd MiniMartingala = 1 // "1" per ON , "0" per OFF del sistema MartinagalaMulti = 1.8 //Martingala Moltiplicatore in caso di vincita - "1" per OFFReinvestimento = 1 // "1" per ON , "0" per OFF reinvestimento Capitale e profittoPerc = 20 // Percentuale del capitale destinato al reinvestimento (consiglio max 30%)Protec = 100 // "0" per OFF, Contratti massimi consentiti al sistema -Ricordarsi di inserire questo valore in fase di Trading Automatico in PRT//------------------ EVENTUALI VARIABILI DEL SISTEMA---------------------------------------Avg = 2 // Moving Average Period DEFAULT 2 DayAtrs = 0.16 // Multiplier coefficient Atrm = 2.1//1.8 // Multiplier coefficient Stop Loss//***********************************************************************************************ONCE OrderSize = NrContrattiONCE ExitIndex = -2Capital= CapitalIni + strategyprofitIF Reinvestimento = 1 THENNR = ((Capital * Perc/100)/MargineBroker)*1000n = (ROUND(NR)/1000)ELSEn = 0.5ENDIFIF Protec>0 AND n>Protec THENn=ProtecENDIF//**************************************Indicator**************************************a1 = exp (-1.414 * 3.14159 / 10)b1 = 2 * a1 * cos (1.414 * 3.14159 / 10)c2 = b1c3 = -a1 * a1c1 = 1 - c2 - c3if barindex=0 thenFilt = c1 * (Close) / 2elsif barindex=1 thenFilt = c1 * (Close + Close[1]) / 2 + c2 * Filt[1]elsif barindex > 1 thenFilt = c1 * (Close + Close[1]) / 2 + c2 * Filt[1] + c3 * Filt[2]endifclosep=TotalPricea1 = exp (-1.414 * 3.14159 / 10)b1 = 2 * a1 * cos (1.414 * 3.14159 / 10)c2 = b1c3 = -a1 * a1c1 = 1 - c2 - c3if barindex=0 thenFiltp = c1 * (closep) / 2elsif barindex=1 thenFiltp = c1 * (Closep + Closep[1]) / 2 + c2 * Filtp[1]elsif barindex > 1 thenFiltp = c1 * (Closep + Closep[1]) / 2 + c2 * Filtp[1] + c3 * Filtp[2]endifRoofing =(Filt-Filtp)Atr = AverageTrueRange[14](close)x = average[Avg,3](Typicalprice)b1e = ((2*x)-high)+(ATR*ATRs)s1e = ((2*x)-Low)-(ATR*ATRs)Hbop = (2*x)-(2*Low)+HighLbop = (2*x)-(2*High)+Low// Condizioni per entrare su posizioni longIF NOT LongOnMarket AND close<lbop THENBUY OrderSize CONTRACTS AT b1e LIMITSELL AT s1e LIMITENDIF// Condizioni per uscire da posizioni longIf LongOnMarket THENSELL AT s1e LIMITIF close > positionprice THENSELL AT MARKETELSIF Roofing crosses under Roofing [1] THENSELL AT MARKETENDIFExitIndex = BarIndexENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close>hbop THENSELLSHORT OrderSize CONTRACTS AT s1e LIMITEXITSHORT AT b1e LIMITENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket THENEXITSHORT AT b1e LIMITIF close < positionprice THENEXITSHORT AT MARKETelsif Roofing crosses over Roofing [1] thenEXITSHORT AT MARKETendifExitIndex = BarIndexENDIFSET STOP LOSS (m*ATR)//Martingala************************IF Barindex = ExitIndex + 1 THENExitIndex = 0IF PositionPerf(1) < 0 THENOrderSize = OrderSize + (Martingala*0)ELSIF PositionPerf(1) > 0 THENOrderSize = 1 * n * MultiENDIFENDIFIF Capital<-CapitalIni*(CapitalRisk/100) THENQUITENDIF//GRAPH OrderSize07/18/2019 at 3:17 PM #102841What’s the DRAWDOWN, on my test it was over 41K US$?
I think starting with a minimun capital of 200K US$ would make IG/Esma much happier!
07/18/2019 at 5:10 PM #10284707/18/2019 at 5:16 PM #102849It happens many times to me, too. It’s a real nuisance!
Just repeat the backtest over and over until it appears!!!!
07/18/2019 at 5:26 PM #102850Hi Roberto, I reactivated PRT in Reale, this is the test on 200,000 bars, spread 1 pip. The overall DD is 27% and it is normal that in the end there is a value of 55,000 as proportionate to the contracts. Try disabling Reinvestment and Martingale. If there are errors, could you kindly highlight them? Thank you Greetings
07/19/2019 at 8:19 AM #10287607/19/2019 at 9:56 AM #102891it seems that most profits are made in the day or in max 2 or 3 days. And the biggest losses in 3 to 6 days. So should not we close after 48h max?
There is not much logic in this as maybe at the 48 hour point all those trades were actually in bigger losses and recovered a bit in the following few days and were closed for a smaller loss than would have been achieved at the 48 hour point.
You can add something to the code to test this but really it is just data mining as there is no good reason why future trades should be at smaller losses just because 48 hours has passed by since they were opened.
Avoiding over night fees is not of major benefit as it is a long and short forex strategy so we pay to be long and get paid to be short.
1 user thanked author for this post.
07/19/2019 at 10:50 AM #102906Thanks Vonasi for your explanation, I agree with you.
However I am surprised when I look at the MFE column. It seems that all losing trades have been directly negative and have never gone positive even for a short time. Unless I do not understand this column well 🙂
07/19/2019 at 12:35 PM #102923Just repeat the backtest over and over until it appears!!!!
Until what appears?
Depending what is your answer then I may have a quicker solution for you than repeating backtests.
07/19/2019 at 12:41 PM #102926 -
AuthorPosts