Doctrading

The Zen Forex strategy

Category: Strategies By: Doctrading Created: May 18, 2016, 11:59 AM
May 18, 2016, 11:59 AM
Strategies
8 Comments
The Zen Forex strategy

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

 

Download
Filename: ZEN-FOREX.itf
Downloads: 211
Doctrading
Doctrading Master
Hello, I'm Marc. Nice to meet you.
Author’s Profile

Comments

oldup
10 years ago
#

Just divise StopLoss /2 - Result is better

 

oldup
10 years ago
#

It works on ProOrder - but  I don't like the maxWin = MaxLoss.

 

 

Benjamin Costa
10 years ago
#

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. 

Doctrading
10 years ago
#

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,

gianpiero
10 years ago
#

Hi Benjamin.

do you have an IG account?...i have your same problem...don't works in Pro Order...

noisette
10 years ago
#

Hello benjamin,

Modification have to be done line 52. Replace BUY by SELLSHORT.

Benjamin Costa
10 years ago
#

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 

Doctrading
10 years ago
#

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 !

ProRealCode ProRealCode
Loading...