Doctrading

A simple Heiken Ashi Trading Strategy

Category: Strategies By: Doctrading Created: May 14, 2016, 5:53 PM
May 14, 2016, 5:53 PM
Strategies
5 Comments
A simple Heiken Ashi Trading Strategy

Hello Guys,

This is a simple code for trading the Heiken Ashi.
We just buy or sell according to the Heiken Ashi, when it changes color.

We also trade according to the trend.

For this simple backtest, I did set a simple moving average of 130 periods, but of course you can use more efficient filters.

The test was done on the DAX, timeframe M15, with spread 1 point.

This strategy can be improved, the results are encouraging !

xClose = (Open+High+Low+Close)/4

if(barindex>2) then
xOpen = (xOpen[1] + xClose[1])/2
endif

c1 = xClose>xOpen AND xClose[1]<xOpen[1]
c2 = xClose<xOpen AND xClose[1]>xOpen[1]

if c1 AND Not LongOnMarket and close > average[130] then
BUY 2 SHARE AT MARKET
endif

if c2 AND Not ShortOnMarket and close < average[130] then
SELLSHORT 2 SHARE AT MARKET
endif

Download
Filename: Heiken-Ashi-trading-strategy.itf
Downloads: 742
Doctrading
Doctrading Master
Hello, I'm Marc. Nice to meet you.
Author’s Profile

Comments

alfcont
7 years ago
#

The first time that the system open a position it should buy or sell one contract, after the number of the contracts shoul be two in order to close and reverse the position. thanks

pascal3431
10 years ago
#

il semble que cette stratégie ne fonctionne pas avec des stop loss : y a t'il un moyen de limiter les pertes ? merci

Doctrading
10 years ago
#

Chez IG markets, on est effectivement plus limité.
C'est pourquoi j'utilise ProRealTime CFD. Il suffit de passer de 100000 unités (affichées par défaut) à 250000 (si je me rappelle bien).

Voilà, pas de secret !

Corto78
10 years ago
#

Bonjour,

Merci pour cette stratégie, mais je ne comprends pas comment vous faites pour tester depuis 2008 à 2016 en 15min alors que PRT en 15min ne fourni que 10000 unités et donc la période démarre mi-décembre.

De plus, j'ai pris exactement le code de la stratégie et l'ai appliquée sur le même support (DAX Mini en 15min), les résultats sont totalement différents et catastrophique (-13%).

Une subtilité que je n'ai pas perçue ?

Cordialement

Nicolas
10 years ago
#

On peut augmenter le nombre d'unités en utilisant (x) unités pour backtester très loin dans le passé. On a un historique très conséquent dans PRT pour vérifier les hypothèses de trading.

ProRealCode ProRealCode
Loading...