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
You must be logged in to post a comment.
Ok thank you for your answers. Gianpiero, i have an Interactive brokers account. Noisette, i will test with modification. Doctrading, your strategy is with little drawdown, it's interesting.
Hi all,
I didn't try it with ProOrder, as I don't find this strategy very performing, compared to my own strategies.
I don't know why it doesn't work on ProOrder, it should.
You are right, there is a mistale on line 52.
I will test it with ProOrder, and check the code
Best Regards,
Hi Doc,
thanks for the code, I tried his on backtest on Dax, and the result is like you. But that don't work on ProOrder Auto trading. Could you say me why please?
Other question, i tried to change code to have shorts positions but that simply replace all "buy positions" by all "shorts positions". what line should i change? Have you repaired the code?
Thank you
There is an error with the code.
As you see, there are no short positions.
Because I did set "buy", I should have written "sellshort".
But the results are worse with the sellshort !
Just divise StopLoss /2 - Result is better