Doctrading

A forex trend breakout code

Category: Strategies By: Doctrading Created: May 22, 2016, 7:19 PM
May 22, 2016, 7:19 PM
Strategies
2 Comments
A forex trend breakout code

Hello,

At the request of Ashley, I tried to backtest a strategy.

It was a failure on M15 and H1.
But the code works well for these conditions :

  • H4 timeframe
  • EUR/USD
  • only long positions (works not great with shorts)

On H1, we must use “sell limit” instead of “buy stop”, it works with it !

So this code isn’t my best strategy of course, but the equity curve is sexy 🙂

// ASHLEY's strategy
// EUR/USD  H4  minicontracts

EMA21 = exponentialaverage[21]
EMA40 = exponentialaverage[40]
EMA100 = exponentialaverage[100]

n = 4

Ctime = time > 040000 and time < 200000

// ACHAT
ca1 = EMA21 > EMA40 and EMA40 > EMA100
ca2 = EMA21 > EMA21[1] and EMA40 > EMA40[1] and EMA100 > EMA100[1]
ca3 = low < EMA21 and close > EMA21
ca4 = close > open and close > close[1] and close > open[1] and open <= open[1] and open <= close[1]

IF Ctime and ca1 and ca2 and ca3 and ca4 and not longonmarket THEN
SL = close - low
buy n shares at highest[1](high) stop
ENDIF


set stop loss SL
set target profit SL * 1.5

Download
Filename: ASHLEY.itf
Downloads: 337
Doctrading
Doctrading Master
Hello, I'm Marc. Nice to meet you.
Author’s Profile

Comments

Glen Marquis
10 years ago
#

Not your best..So what is your best strategy? :)

Doctrading
10 years ago
#

Hello,

Someone asked me something (his results seemed to be different) on my email, but it was a "donotreply" adress.

 

Here is my answer :

Hello,
There is no error, your backtest is true.
But you backtested it from april 2012, my backtest begins before 2000.
So the equity curved seemed to be different, but it's the same for the same period.
 
See my picture here : 
 
Best regards,
Marc

ProRealCode ProRealCode
Loading...