A “harami” trading strategy code for Daily EUR/USD

A “harami” trading strategy code for Daily EUR/USD

I originally found this code on internet.

To go “long” : when meeting a Harami with a black (or red) candle above the 50 days moving average, we buy the next day at the opening.

We close days later, no matter what happens !

The procedure is the opposite for the “short” trades.

The strategy is profitable on EUR/USD.

WARNING :

The test exclude Sunday candles (included in Mondays).

If you view the candle of  Sunday (from 23H to 00H), then the test will be completely distorted !

This code is certainly not a panacea, but it deserves to be refined and improved, no doubt.

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. gutta11 • 04/13/2016 #

    Hi!Why do I get a result which is -92% and only one trade in daily?
    What do you think is wrong?

  2. Doctrading • 04/13/2016 #

    Hello,
    Strange.
    Use it on EUR/USD, with NO CANDLE on Sunday.
    I use prorealtime.com (free daily data).

  3. gutta11 • 04/13/2016 #

    Okey thank you. How do I set “NO CANDLE on Sunday” ?

  4. Doctrading • 04/13/2016 #

    It depends of your broker.
    Or you can use the command “dayofweek”

  5. Doctrading • 04/13/2016 #

    Maybe you can also change the hourly beginning of the day (not 23PM but 12AM, OOH in french). It must be possible.

  6. Duccio • 04/13/2016 #

    Hi Doctrading,there is a way to control the max loss of the positions in this code?
    For example, if I wanted that the positions do not lose more than 200 euro what kind of code I cat try?
    Thank you

  7. Doctrading • 04/13/2016 #

    Hello,
    Yes, there is a command I think, but I don’t know it. Nicolas knows it.
    You can also use less leverage.Best regards,

avatar
Register or

Likes

avatar avatar avatar avatar
Related users ' posts
Emil
10 months ago
Nicolas
10 months ago
5 main forex pairs average
5 main forex pairs average
4
Calculated instruments
Nicolas It's only compatible from PRT v12. With the "Calculated instruments" tool, you can know crea...
MaoRai54 many thanks. IG doesn't know when they'll release it :(
MaoRai54 Hi Nicolas, I'm here again. Today I got the v.12 in my demo account. I started it, I downlo...
Jiacky
2 years ago
Range Factor
Range Factor
0
Indicators
Stephane0174 Bonjour et merci pour le Screener. Je suis nouveau ici et je ne connais rien en programmati...
Nicolas Je pense que c'est le copier/coller des guillemets qui pose problème, il faudrait les retape...
smp I also have an End Of Day (EOD) cash pivot indicator for use on cash markets; this indicator...
Dom Hello, hello....je commence le trading et découvre par la même occasion le codage....et ce n...
Nicolas Merci, ça fait plaisir !
Be-n Bonjour tout le monde ! Dans l'indicateur de tendance, j'ai du mal à saisir la nuance entre ...
Theo D'accord merci
tobytarczy Hi, I have been looking for something like this. I have a f questions about the indicator. ...
tobytarczy Hi have been trying to modify the code you so kindly shared to reflect to the image you have...
murre87 No Stoploss?
bousalahane Hi Rajesh Deshpande, Thank you for this code, I see that the code is perfect, but the posit...
Bibi83 Bonsoir à tous Je viens de backtest la stategie sur EUR/USD en graphique 1H sur 1 mois et ...
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
Daniel Martin Hi do you know how have and entry after the second cross? There is crosses below 0 and cross...
Maik2404 es sind leider nur long Positionen und keine Short zu erkennen.
Maik2404 Vytautas: es bleibt aber nur bei long Auslösungen
ullle73 this one is not a winner, have backtested it on almost all pairs, does not have an edge
Leo Does it opens pending orders?... maybe they were not trigger.
Mattzi Dont know, all i can see is that it opened an order yesterday in backtest but not live. Th...
Jean-Christophe Hello Leo, when running the strategy from 29/12/2015 to 31/08/2018 on ProRealTime Premium, I...
Nicolas Please add a request on forums for any MT4 code conversion, thank you. Follow these easy ste...
mecon I will do so, thank you!
avatar
Anonymous @mecon, did you ever get one?
apachx Hi. Please, describe the algorithm in words. I want to understand how it works, but for now...
Francesco78 Jan Wind, I obtain it from the backtest
Kris75 Hi Francesco, The results are totally different with the tickbytick mode; it becomes a losin...
UkDownUnder Takes to long!
4example excellent, thank you
JanWd Tried the code, nice concept, seems to work quit well for US/EUR 2hrs, Other markets seems n...
JR1976 Simple and nice code , congrats !!! Seems work well with TIme frame 1 h
phanz Hi all, Sorry revisiting an old post. This algo is simple, and simplicity is the ultimate ...
juanj And the point of violation is the close of the candle that violates the line by generating a...
juanj For the latest version of the strategy or to follow updates and developments see the thread ...
phanz i backtested it with 10K units of EURUSD 1 hour i get an equity curve that is going one way ...
poonsl2828 Hi! Francesco I have test it on GBP/USD but it only have a trade on 9 Jun which i backtes...
ullle73 why not use 1h chart? has 95% hitrate
ullle73 i see most of positions are only 1 pip before exit?

Top