Trend following strategy, multi market, 30min to 4h
Forums › ProRealTime English forum › ProOrder support › Trend following strategy, multi market, 30min to 4h
- This topic has 5 replies, 3 voices, and was last updated 6 years ago by
Magifina.
-
-
08/08/2019 at 5:28 PM #104431
Hello,
I developed this strategy that follows the trend (buy and sell). It’s based on 3 conditions only related with the exponential moving average.
It works better without target and stop loss.
It keeps positions open for a minimum of 24h.
You can backtest this strategy with different timeframe, but you’ll have to adapt R :
– R=200 for TF=30min
– R=100 for TF=1h
– R=50 for TF=2h
– R=25 for TF=4hIt gives good results with all the major indices and forex (TF=2H) :
– DAX, GL=3.07 (90 trades)
– FTSE, GL=2.20 (81 trades)
– CAC, GL=2.07 (86 trades)
– US500, GL=2.41 (69 trades)
– DOW, GL=1.83 (69 trades)
– US100, GL=1.65 (72 trades)
– ASX, GL=1.54 (96 trades)
– EURUSD, GL=1.95 (91 trades)
– GBPUSD, GL=1.43 (82 trades)
– USDJPY, GL=1.27 (75 trades)These results are with the exact same code for each market with a timeframe=2H
You can easily get a better GL for each market by changing few settings, but the initial idea was to use the same code for all markets.
These backtests are with no spreads, and no fees, how much fees we can expect for 1 contrat on one of this market for a duration of 1 week open?
What are your ideas to improve this strategy?
Jérémy
4h, all market123456789101112131415161718192021222324252627282930313233343536373839404142434445DEFPARAM cumulateorders = falsepositionSize = 1SL = 0 // stop loss in %, set to 0 to not use TPTP = 0 // target in %, set to 0 to not use SLminimumBarKeepOpen = 12 // keep open at least 24h, as example if TF=2h then the calcul is 24/2h = 12R = 50 // R=200 for TF=30min, R=100 for TF=1h, R=50 for TF=2h, R=25 for TF=4hcrossEntry = R * 1crossExit = R * 2period1 = R * 2period2 = R * 2period3 = R * 4MM1 = Average[period1](close)MM2 = Average[period2](close)MM3 = Average[period3](close)entryBuy = MM1 > MM1[crossEntry] and MM2 > close and MM3 > closeentrySell = MM1 < MM1[crossEntry] and MM2 < close and MM3 < closeexitBuy = shortonmarket and MM1 < MM1[crossExit] AND BarIndex - TradeIndex > (minimumBarKeepOpen - 1)exitSell = longonmarket and MM1 > MM1[crossExit] AND BarIndex - TradeIndex > (minimumBarKeepOpen - 1)IF not onmarket and entryBuy THENSELLSHORT positionSize SHARES AT MARKETENDIFIF not onmarket and entrySell THENBUY positionSize SHARES AT MARKETENDIFIF exitBuy THENexitshort at marketENDIFIF exitSell THENSELL AT MARKETENDIFIF SL > 0 THENSET STOP %LOSS SLENDIFIF TP > 0 THENSET TARGET %PROFIT TPENDIF08/08/2019 at 9:09 PM #10444308/08/2019 at 9:40 PM #10444508/09/2019 at 1:43 PM #104472Hi Jeremyben,
Thanks for sharing this strategy. It proves that a simple strategy can be performant.
I have tries to tweak the different variables but I couldn’t lower the drawdown. In fact the drawdown is due to the fact that we are keeping our position for one day.
To improve the performance MM3 can be removed. It allows to double the number of trades.08/09/2019 at 2:16 PM #104475By removing MM3, I get nearly the same number of trades. How did you get the double?
The effect I see without MM3 are:
- longer time spent in market (x1.5, an it reaches 100% time in market if we remove MM2 and MM3)
- a slight improvement of GL
And yes the main problem of this strategy is its potential huge DD because of no stop. How can we solve it?
We are loosing performance by using any StopLoss. I’ve tried the trailing stop, but it doesn’t help. This strategy bet on a return of the market for the loosing trades so that make sense any Stoploss will go against the strategy.
08/09/2019 at 3:42 PM #104480I got the double with dax that works very well with this strategy.
Maybe with a volatility filter you can improve drawdown but I don’t think significantly.On dax I had these conclusions:
– The biggest lost are always with trades lasting more than 2 days
– A trade with a mfe of 0 will always end with a lost and one with a mae of 0 a winThis strategy can be profitable if you have the necessary capital to handle the drawdown.
It can be a good manual strategy but is too risky to be automated. -
AuthorPosts
