I wanted to test a strategy that I used manually in Day Trading on the DAX in graphs 5 minutes.
The problem is that it is not always easy to backtest a manual strategy, particularly it is difficult to determine the slope of the moving averages, the levels of supports / resistances, etc.
So I slightly adapted the parameters for automatic trading.
We have a profit factor of 1.25 (spread included in the backtest) ; in manual trading I am rather at a profit factor of 1.5 (but exit rules are slightly different, on a trailing stop that is difficult to adapt) . I’m quite happy with my backtest that looks pretty close to reality. The strategy is very simple, it is the “KISS”, Keep It Simple and Stupid strategy. It uses only three moving averages, we trade with the trend.
Note that the test is positive in M5 timeframe (but I can only test it on 2,5 years), it is much worse on the upper timeframes.
Defparam cumulateorders = false
Ctime = time > 080000 and time < 180000
MM200 = average(close)
MM180 = average(close)
MM20 = average(close)
ca1 = MM20 > MM180 and MM180 > MM200
ca2 = MM200 > MM200 and MM180 > MM180 and MM20 > MM20
ca3 = close crosses over MM20
ca4 = close > open and close > close
ca5 = ADX > 12
IF Ctime and ca1 and ca2 and ca3 and ca4 and ca5 THEN
buy at market
Sell at MM180 stop
cv1 = MM20 < MM180 and MM180 < MM200
cv2 = MM200 < MM200 and MM180 < MM180 and MM20 < MM20
cv3 = close crosses under MM20
cv4 = close < open and close < close
cv5 = ADX > 12
IF Ctime and cv1 and cv2 and cv3 and cv4 and cv5 THEN
sellshort at market
Exitshort at MM180 stop
// Clôture des positions le soir
IF time = 200000 THEN
sell at market
exitshort at market
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :