Hello All,
I found a strategy on Internet, and tried to backtest us.
As it didn’t work, I did some modification to the rules.
Those ones are very simple, so I don’t detail them.
I set some interesting moving averages (5, 8, 89, some of the Fibonacci numbers).
The trades are closed at 21 PM.
This strategy plays the consolidations on trends.
It is very effective since 10 years, not before.
It works on EUR/USD and GBP/USD.
DEFPARAM CumulateOrders = False
// TAILLE DES POSITIONS
LEVIER = 10
REINV = 0
IF REINV = 0 THEN
n = LEVIER
ELSIF REINV = 1 THEN
n = (10000+strategyprofit)/10000*LEVIER
ENDIF
// INDICATEURS
MM5 = WilderAverage[5](close)
MM8 = WilderAverage[8](close)
MM89 = Average[89](close)
// REINITIALISATION
IF time = 210000 THEN
condachat = 0
condvente = 0
ENDIF
// ACHAT
Ctime1 = time >= 010000 and time <= 090000
ca1 = close > MM5 and MM5 > MM8 and MM8 > MM89
ca2 = MM5 > MM5[1] and MM8 > MM8[1] and MM89 > MM89[1]
IF Ctime1 and ca1 and ca2 THEN
condachat = 1
ENDIF
Ctime2 = time >= 090000 and time < 210000
IF Ctime2 and condachat = 1 THEN
IF close < MM8 THEN
buy n shares at market
ENDIF
ENDIF
// VENTE
Ctime1 = time >= 010000 and time <= 090000
ca1 = close < MM5 and MM5 < MM8 and MM8 < MM89
ca2 = MM5 < MM5[1] and MM8 < MM8[1] and MM89 < MM89[1]
IF Ctime1 and ca1 and ca2 THEN
condvente = 1
ENDIF
Ctime2 = time >= 090000 and time < 210000
IF Ctime2 and condvente = 1 THEN
IF close > MM8 THEN
buy n shares at market
ENDIF
ENDIF
IF time = 210000 THEN
sell at market
exitshort at market
ENDIF
// SL & TP
set stop loss 0.0030
set target profit 0.0030