SHORT EUR USD (m15) // PAC MAN STRATEGY
Forums › ProRealTime English forum › ProOrder support › SHORT EUR USD (m15) // PAC MAN STRATEGY
- This topic has 85 replies, 16 voices, and was last updated 4 years ago by Vonasi.
Tagged: Break Even, BreakEven
-
-
05/19/2018 at 8:57 PM #7090105/19/2018 at 9:02 PM #70902
Vonasi do you think that unstead using the value 10.93 it would be bette to use this instruction based on the price :
1Cv3 = average[8](STD[12](close)) >= STD[12](close[3])I show you then equity curve / n= 5 (position size) / Capital = 10.000 euros :
05/19/2018 at 9:22 PM #7090705/19/2018 at 9:26 PM #70908IMHO = In My Humble Opinion.
Ref your last post I will have to try to find time tomorrow to test what you suggest as it is getting a bit late here in Greece and I am behind with my drinking!
ok have a nice night and week end !
05/20/2018 at 5:00 PM #70956IMHO = In My Humble Opinion.
Ref your last post I will have to try to find time tomorrow to test what you suggest as it is getting a bit late here in Greece and I am behind with my drinking!
Great input and looking forward to seeing the test made by u 🙂
05/20/2018 at 7:27 PM #70964Well I have been messing around with this strategy for a few hours now and trying to come to some conclusions. Normally I do not like adding indicators to indicators – especially lagging averages to indicators as Balmora74 suggested with this:
1Cv3 = average[8](STD[12](close)) >= STD[12](close[3])So I ran it with various values and graphed the results and it seemed that the values 3 and 8 were in the ball park so if we fixed them and tested with different values other than the STD[12] it might tell us more. Here are the graphs.
So it seems we are at or around the optimal value but is also is interesting to see that every value makes a profit. How straight the equity curve to that profit is then the issue for most people.
I decided to modify the code so that it opens a trade if the above code with values of STD[11] to STD[14] are true.
I should also point out that I added a condition to the 100 bar get out that it only gets out if in profit. So up to 100 bars it aims for the take profit level but after that it just aims to get out with any profit. This had little benefit or disadvantage but I left it in.
So then I noticed that being a shorting strategy its performance when the instrument was falling was much better than when it was rising or chopping up and down so I tried to filter this out but gave up as it seemed better to just put up with the chop or short down periods rather than rely on a very fitted filter on historical data. My worry though is that with a very rapidly rising price this strategy will more than likely lose money.
So having failed to break the strategy so far I decided to do what I normally do and remove things to see what effect they have. It seems that the filters Cv1 and Cv4 do very little at all so I deleted them.
The next thing to do is look at the stop loss level. Here are the graphs with other values:
It seems that the level of 52 is very optimized and very close to the cliff edge. I am not a fan of tight stop losses or stop losses at all! I think moving it further to the middle of the range that provided best profit – around 64 would be better.
It seems a fairly robust strategy and there is definitely something about it that has worked over the test period – whether that continues or how straight the equity curve is can only be tested with out of sample forward testing. For interest here is the code that I ended up with – I can’t say that it is any better or will be profitable going forward but it has less and is slightly less optimized:
1234567891011121314151617181920212223242526272829// PAC MAN - PIP HUNTER// EUR / USD (M15)// By BALMORA74 19.05.2018 - Vonasi modifications 20-5-18DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 4000PositionSize = 1Cv2 = RSI[14](close) <= 28Cv3 = 0For i = 11 to 14 DoIF average[8](STD[i](close)) >= STD[i](close[3]) THENCv3 = 1ENDIFNEXTOKSHORT = cv2 and Cv3IF OKSHORT thenSellshort PositionSize CONTRACT at marketSET STOP pLOSS 64SET TARGET PPROFIT 25ENDIF//EXIT ZOMBIE TRADEIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= 100 and close > TradePrice THENEXITSHORT AT MARKETENDIF05/20/2018 at 7:32 PM #70970Here is the equity curve etc. I feel the secret to making this more robust is to find a filter that keeps it out of the market when the market is rising – if only it were that easy! The lines on the graph show the falling equity curve when the market is rising – filter some of these out and gain per bet will be far higher. At the end of the day no matter what I did the average gain per bet was very low and that is always a worry as it is very easy to slip into a steadily losing strategy from there.
1 user thanked author for this post.
05/20/2018 at 8:18 PM #7097505/20/2018 at 8:21 PM #7097605/20/2018 at 8:55 PM #70977No problem Balmora74. Bear in mind that what I ended up with is just where I got to before beer started calling me. I should really go back to the beginning and re-analyse various values to double check that it is all still in the right ball park. Iron out the losses in a rising market and you may be on to something – although the in sample development period is still very small due to the time frame being used for good confidence building – which I guess is why I tend to avoid short time frames these days.
05/23/2018 at 4:58 PM #71196Not a bad start. Both the original version and my later version both opened two trades so far and both were closed in a short space of time for the full 25 pips profit with no overnight fees. So now we can afford a loser without too much panic.
I think the starting date was lucky as a backtest starting much earlier would have exchanged the first winner for a 64 pip loser which reminds me that I read somewhere once that you should always try to start your strategy during favourable conditions to try to get a good bit of credit at the beginning. Markets have been climbing but with all the trade war talks this week it is a good time to start a shorting strategy I guess. These little things can make a little difference and a lot of little things together makes a lot!
Fingers crossed the forward test continues this well and I look forward to any further development ideas from Balmora74 or anyone else who is thinks of a new filter or improvement.
05/23/2018 at 5:46 PM #71200Not a bad start. Both the original version and my later version both opened two trades so far and both were closed in a short space of time for the full 25 pips profit with no overnight fees. So now we can afford a loser without too much panic.
I think the starting date was lucky as a backtest starting much earlier would have exchanged the first winner for a 64 pip loser which reminds me that I read somewhere once that you should always try to start your strategy during favourable conditions to try to get a good bit of credit at the beginning. Markets have been climbing but with all the trade war talks this week it is a good time to start a shorting strategy I guess. These little things can make a little difference and a lot of little things together makes a lot!
Fingers crossed the forward test continues this well and I look forward to any further development ideas from Balmora74 or anyone else who is thinks of a new filter or improvement.
Vonasi i’m trading via the broker IG and on SHORT position (EUR – USD) i have positive overnight costs. It’s means that IG gave me money. So this positive credit improves the strategy ans equity curves !!
I’have mixed different ideas and especially the code posted by Inertia (page 1 of these forum discussion) with an Trailing Stop ang Long Time Average Filter. I also add exit conditions.
Back test tick by tick / 200kb candles / Capital = 1000 $ / PositionSize = 1 mini contract.
Less positions but a very small drawdown…
This is the code :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354DEFPARAM CumulateOrders = FalseDEFPARAM Preloadbars = 6000ONCE BarShort = 100 //EXIT ZOMBIE TRADEPositionSize = 1 //EUR - USD $1//STRATEGYCv1 = (close < Average[100]) and (Average[50] < Average[50](close[1]))Cv2 = RSI[14](close) < 28Cv3 = STD[10](close) >= 10.93 * pipsizeCv4 = close <= BollingerDown[4](close[2])Cv5 = close > ExponentialAverage[7250](close)OKSHORT = Cv1 and Cv2 and Cv3 and Cv4 and Cv5IF OKSHORT thenSellshort PositionSize CONTRACT at marketendif//STOP LOSS & TAKE PROFITSET STOP PLOSS 51SET TARGET PPROFIT 47//BREAKEVENstartBreakeven = 30PointsToKeep = 1IF SHORTONMARKET AND (tradeprice(1) - close) >= (startBreakeven * pipsize) THENbreakevenLevel = tradeprice(1) + (PointsToKeep * pipsize)IF breakevenLevel > 0 THENEXITSHORT AT breakevenLevel STOPENDIFENDIF//EXIT EMA CROSSINGex1 = SHORTONMARKETex2 = close CROSSES UNDER Average[3600]ex3 = close CROSSES UNDER Average[8](close) - 2.5*std[8](close)ex4 = close CROSSES OVER Average[16](close) + 3.25*std[16](close)//16 + 3.25IF ex1 AND (ex2 OR ex3 OR ex4) THENEXITSHORT AT MARKETENDIF//EXIT ZOMBIE TRADEIF POSITIONPERF<0 THENIF shortOnMarket AND BARINDEX-TRADEINDEX(1)>= barshort THENEXITSHORT AT MARKETENDIFENDIF05/23/2018 at 6:43 PM #71206I’ve only run a few quick checks on 100K bars so far but here are my thoughts for what they are worth.
You have added quite a lot and it has to be considered that everything and every variable that you add to a strategy just curve fits it more to the past and makes it less likely to work in the future. Try removing things and if you can barely notice the difference then they are not worth including. My quick check showed that Cv1 is adding nothing – in fact the strategy has higher gain/loss without it. The trailing stop is adding virtually nothing too. I am not a fan of trailing stops and this ones just made me even less of a fan.
I also notice that you have played with the take profit and stop loss. I suspect the stop loss is slightly closer to the cliff edge where if market characteristics shift just slightly then you will have a very good strategy…. at losing. I have not graphed it so you will need to check this yourself. Personally I think that if you can do away with targets and stop losses altogether and find a way that positions are closed on a condition then you will have a much stronger strategy.
I think that you also need to graph the average used as a filter and see how over optimized that is and also check what the draw down is either side of it.
When I see numbers like 51 and 47 for take profit and stop loss it rings alarm bells – graph them too!
I also preferred my idea of only using your ‘Zombie’ stop if the trade was in profit after a certain period. Just getting out based on time passed is never a good idea as maybe at some point at bar 99 it would have been a massive loss and bar 100 a small profit and you have just curve fitted to that with a number chosen for no other reason than it is a nice number. Plus as you said – you are getting paid for being in a short position so why rush to leave it.
Hope my ideas help……
1 user thanked author for this post.
05/23/2018 at 9:21 PM #71215I’ve only run a few quick checks on 100K bars so far but here are my thoughts for what they are worth.
You have added quite a lot and it has to be considered that everything and every variable that you add to a strategy just curve fits it more to the past and makes it less likely to work in the future. Try removing things and if you can barely notice the difference then they are not worth including. My quick check showed that Cv1 is adding nothing – in fact the strategy has higher gain/loss without it. The trailing stop is adding virtually nothing too. I am not a fan of trailing stops and this ones just made me even less of a fan.
I also notice that you have played with the take profit and stop loss. I suspect the stop loss is slightly closer to the cliff edge where if market characteristics shift just slightly then you will have a very good strategy…. at losing. I have not graphed it so you will need to check this yourself. Personally I think that if you can do away with targets and stop losses altogether and find a way that positions are closed on a condition then you will have a much stronger strategy.
I think that you also need to graph the average used as a filter and see how over optimized that is and also check what the draw down is either side of it.
When I see numbers like 51 and 47 for take profit and stop loss it rings alarm bells – graph them too!
I also preferred my idea of only using your ‘Zombie’ stop if the trade was in profit after a certain period. Just getting out based on time passed is never a good idea as maybe at some point at bar 99 it would have been a massive loss and bar 100 a small profit and you have just curve fitted to that with a number chosen for no other reason than it is a nice number. Plus as you said – you are getting paid for being in a short position so why rush to leave it.
Hope my ideas help……
Thank you for all these valuable tips. I am a beginner in algorithmic trading and I am really happy to receive advices to improve my algorithms. I want to try many things but I have to keep in mind that simplicity is the ultimate sophistication….
05/23/2018 at 10:20 PM #71219I am a beginner in algorithmic trading
I want to try many things but I have to keep in mind that simplicity is the ultimate sophistication….
We are all beginners in algorithmic trading as the markets tomorrow have very little interest in what happened yesterday or a week ago or a month ago or a year ago. But yesterday is all we have to work with so simple is more likely to fit tomorrow than complicated. IMHO
If you try to make a strategy that fits from 1970 till today then it will most probably fail tomorrow because in 1970 no one had even thought of computers or the internet and trading was done from pits with men with bits of paper. Recent history is far more relevant than distant history but as humans we want to be confident so we try to look to the past to tell us what the future will do – and the future always amazes us!
Bit heavy… sorry!
-
AuthorPosts