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
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...
vinit0412 I tried using the above strategy but since IG doesnt allow partial closing of the positions....
Rajesh Deshpande Updated the code which has now 100% winning rate in last 2yrs. Yes takes average 1 trade per...
murre87 No Stoploss?
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?
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
victormork Hi, I would just like to share my own take on this strategy. I'm using 30 min on EURUSD but ...
mckubik Thanks. I will run a Test. 
poonsl2828 Hi! bjoern May i know what timing should i change for time zone (Singapore (GMT +8:00) ...
Samitha Prasanna Hi ALE, would you be able to provide the values for the below part of the code (time >=1...
Player Bonjour, J'ai testé cette stratégie sur EurUSD en 1 heures sur 10000 unités et le résultat ...
Player Vue du rapport du Backtest https://ibb.co/8BMrBz6
Doctrading Hello, Higher timeframes are better. I suggest D1 or H4.Best regards,
Pinkybouh hello, I propose to add another conditions: ie: haussier: close > open and close >...
TheHovisTrader I'd be interested in the actual profit of this - in the example the stop range is at least 2...
Dimi.A Awesome mate.
mora87 Hi David and Nicola, I'd like to share idea with you guys which is related to David's Idea. ...
Nicolas Please ask for custom coding in forums instead.
Naren Yanan what is    diplus  diminus  please
Barney Has anyone tested this algon now when PRT 10.3 was released?
Yngve does anyone know if the issue with the TP/SL is resolved ?
JakeDB Answered my own question....Sorry about this question. 5 positions, take profit at 15, loss ...
maxxb sto facendo girare in demo questa strategia modificata a 10 minuti con stop e profit ottimiz...
Manuel9z Hello, this strategy improves with the SL 30 and the TP 10. I have done backtesting and it w...

Top