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.
-
-
12/18/2018 at 2:55 PM #87328
Hi I’m new and not very experienced and for some time I try to learn information from the community. I ask you advice to improve this simple code that I developed but I would like to reduce the% Ma DrawDown and I think there is some error. Thanks to anyone who wants to help me.
12345678910111213141516171819202122232425262728293031323334//Eur/Usd mini - 1D Capital Eur 500,00DEFPARAM CUMULATEORDERS= falseDEFPARAM PRELOADBARS = 10000n=1Atr = AverageTrueRange[14](close)Atrs = 0.1x = average[A,3]((High+Low+close)/3)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 n CONTRACTS AT b1e limitENDIF// Condizioni per uscire da posizioni longIf LongOnMarket THENSELL AT s1e limitENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close>hbop THENSELLSHORT n CONTRACTS AT s1e limitENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket THENEXITSHORT AT b1e limitENDIFset stop loss (1.8*ATR)12/18/2018 at 3:26 PM #87369Variable A is missing, what’s its value?
12/18/2018 at 3:45 PM #87371Are you aware that if your long or short limit orders open positions then you will not have a sell or exitshort order on the market until the close of the bar? You should add them in like this:
123456789101112131415161718192021/ Condizioni per entrare su posizioni longIF NOT LongOnMarket AND close<lbop THENBUY n CONTRACTS AT b1e limitSELL AT s1e limitENDIF// Condizioni per uscire da posizioni longIf LongOnMarket THENSELL AT s1e limitENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close>hbop THENSELLSHORT n CONTRACTS AT s1e limitEXITSHORT AT b1e limitENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket THENEXITSHORT AT b1e limitENDIF12/18/2018 at 4:20 PM #8737512/18/2018 at 4:31 PM #873771234567891011121314151617181920212223242526272829303132333435363738DEFPARAM CUMULATEORDERS= falseDEFPARAM PRELOADBARS = 10000capital = 500 + strategyprofitn=1Atr = AverageTrueRange[14](close)Atrs = 0.1x = average[2,3]((High+Low+close)/3)ema=average[3,6](close)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 and close>ema THENBUY n CONTRACTS AT b1e limitSELL AT s1e limitENDIF// Condizioni per uscire da posizioni longIf LongOnMarket THENSELL AT s1e limitENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close>hbop and close<ema THENSELLSHORT n CONTRACTS AT s1e limitEXITSHORT AT b1e limitENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket THENEXITSHORT AT b1e limitENDIFset stop loss (1.8*ATR)If Capital<-300 thenquitendifI’ve applied some variations like an EMA filter
12/18/2018 at 4:36 PM #8737812/18/2018 at 4:40 PM #87380You have to try changing values until you find the ones that you think are what suit you (not the market!) best.
Setting an average type of 2 (wma), instead of 3, then 1.3 at line 34, provided variable A has been assigned 2, my drawdown drops to 267.30 as from screenshot.
Try to walk forward your strategy.
12/18/2018 at 4:56 PM #87382I prefer to take stuff away rather than add it. I have removed the fixed level stop loss (it doesn’t add much anyway) and you have levels set to reverse the trades anyway. Most trades don’t seem to be more than one day so I have added exits at the close of any day that you are in profit. The ATRS variable has been optimised to 0.16. It seems pretty stable for a EUR/USD strategy. I wouldn’t add EMA’s as you are just adding an extra level of curve fit and EMA’s are oh so easy to curve fit!
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647//Eur/Usd mini - 1D Capital Eur 500,00DEFPARAM CUMULATEORDERS= falseDEFPARAM PRELOADBARS = 10000a = 2t = 2//m = 2.7n=1Atr = AverageTrueRange[14](close)Atrs = 0.16x = average[A,3]((High+Low+close)/3)b1e = ((t*x)-high)+(ATR*ATRs)s1e = ((t*x)-Low)-(ATR*ATRs)Hbop = (t*x)-(t*Low)+HighLbop = (t*x)-(t*High)+Low// Condizioni per entrare su posizioni longIF NOT LongOnMarket AND close<lbop THENBUY n CONTRACTS AT b1e limitSELL AT s1e limitENDIF// Condizioni per uscire da posizioni longIf LongOnMarket THENSELL AT s1e limitif close > positionprice thensell at marketendifENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close>hbop THENSELLSHORT n CONTRACTS AT s1e limitEXITSHORT AT b1e limitENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket THENEXITSHORT AT b1e limitif close < positionprice thenexitshort at marketendifENDIF//set stop loss (m*ATR)12/18/2018 at 5:41 PM #8738712/18/2018 at 5:48 PM #87388The name is Vonasi not Vanosi!
m is the multiple of the ATR for the stoploss. If you unremark the stoploss and unremark the m = 2.7 then you can run it with a stoploss. 2.7 was the value that gave highest results.
1 user thanked author for this post.
12/18/2018 at 8:30 PM #87401Just out of interest I decided to take my version of your strategy and convert it to an end of day strategy. So I removed the limit orders and just bought or sold if it was above or below lbop and hbop. I reinstated the stop loss and optimised it and ATRS. I tested back to the beginning of 1995. Even if the ride was a little rough especially through the 2008 recession it was still ultimately a good equity curve. You may be on to something with your ATR band calculations. Are you sure that you’re new to this game?
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253//Eur/Usd mini - 1D Capital Eur 500,00DEFPARAM CUMULATEORDERS = falseDEFPARAM PRELOADBARS = 10000a = 2t = 2m = 1.8n=1Atr = AverageTrueRange[14](close)Atrs = 0.01x = average[A,3]((High+Low+close)/3)b1e = ((t*x)-high)+(ATR*ATRs)s1e = ((t*x)-Low)-(ATR*ATRs)Hbop = (t*x)-(t*Low)+HighLbop = (t*x)-(t*High)+Low// Condizioni per entrare su posizioni longIF NOT LongOnMarket AND close <= lbop THENBUY n CONTRACTS AT market//b1e limit//SELL AT s1e limitENDIF// Condizioni per uscire da posizioni longIf LongOnMarket and close > s1e THENSELL AT market//s1e limitif close > positionprice then//positionprice thensell at marketendifENDIF// Condizioni per entrare su posizioni shortIF NOT ShortOnMarket AND close >= hbop THENSELLSHORT n CONTRACTS AT market//s1e limit//EXITSHORT AT b1e limitENDIF// Condizioni per uscire da posizioni shortIF ShortOnMarket and close < b1e THENEXITSHORT AT market//b1e limitif close < positionprice thenexitshort at marketendifENDIFset stop loss (m*ATR)//graph b1e//graph s1e//graph Hbop//graph Lbop//12/18/2018 at 8:43 PM #8740512/18/2018 at 8:46 PM #87406What an early weekend! You’re lucky Vonasi.
12/18/2018 at 8:52 PM #8740712/18/2018 at 9:19 PM #87408 -
AuthorPosts