Hey there, fellow traders! Today, let's dive into the fascinating world of the Harami pattern and how you can leverage it using an Expert Advisor (EA) in MetaTrader 4. This strategy utilizes two Moving Averages and incorporates a Trailing Stop Loss along with Take Profit settings, making it perfect for trading major forex pairs and stocks on the 4-hour (4H) and daily (1D) timeframes.
Getting Started with the Harami EA
- Test it Out on Demo First: Always try your strategies on a demo account before going live.
- Open Candle Trading: This EA only trades based on the opening price of the candle!
- Control Your Lot Sizes: If you prefer not to increase your lot size after a losing trade, set IncreaseFactor=0.
Key Inputs for Your EA
- Use_TP_In_Money: Enable Take Profit in monetary values (true/false).
- TP_In_Money: Set your Take Profit in money (values: 10-100).
- Use_TP_In_percent: Enable Take Profit in percent (true/false).
- TP_In_Percent: Set your Take Profit in percent (values: 10-100).
- ------------Money Trailing Stop for Multiple Trades------------
- Enable_Trailing: Turn on trailing with monetary values (true/false).
- Take Profit In Money: Set this value in your current currency (values: 25-200).
- Stop Loss In Money: Define your Stop Loss in current currency (values: 1-20).
- --------------------------------------------------
- Exit: Close trades if the trend goes against you to manage drawdown (true/false).
- Lots: Define your lot size (values: 0.01-1).
- Lots Size Exponent: Manage your lot size exponent (values: 1.01-2).
- IncreaseFactor: This controls how much to increase lots from total margin if you lose a trade (values: 0.001-0.1).
- Stop_Loss: Set your Stop Loss (values: 30-500). Use 600 for multiple trades.
- MagicNumber: Assign a magic number (values: 1-100000).
- TakeProfit: Set your Take Profit (values: 50-200). Use 600 for multiple trades.
- FastMA: Choose your Fast Moving Average (values: 1-20).
- SlowMA: Set your Slow Moving Average (values: 50-200).
- Mom_Sell: Define your Sell momentum trigger (values: 0.1-0.9).
- Mom_Buy: Define your Buy momentum trigger (values: 0.1-0.9).
- ---------------------Control Drawdown---------------------
- UseEquityStop: Enable equity stop (true/false).
- TotalEquityRisk: Define risk in equity (values: 0.01-20).
- -------------------------------------------------------------------------------
- Max_Trades: Set the maximum number of trades (1-12).
- ----------------Using Only One Trade:-----------------------
- /////////////////////////////////////////////////////////////////////
- USETRAILINGSTOP: Enable trailing stop (true/false).
- WHENTOTRAIL: Set when to start trailing (values: 40-100).
- TRAILAMOUNT: Define the amount to trail (values: 40-100).
- Distance From Candle: Set the distance from the candle (values: 1-100).
- USECANDELTRAIL: Enable candle trailing (true/false).
- X: Number of candles (values: 1-100).
- USEMOVETOBREAKEVEN: Enable break-even (true/false).
- WHENTOMOVETOBE: Set when to move to break-even (values: 1-30).
- PIPSTOMOVESL: Set how many pips to move stop loss (values: 1-30).
It's essential to optimize this EA every few months using the exact inputs mentioned above. You can utilize it as a hedging grid EA or as a single trade EA. Interested in backtesting? Check out this backtesting guide for more insights!

연관 포스트
- RRS Impulse: Your Go-To Scalping EA for MetaTrader 4
- Mastering Take Profit Strategies in MetaTrader 4: A Local Trader’s Guide
- Maximize Your Trading Efficiency with AutoCloseOnProfitLoss EA for MetaTrader 5
- Maximize Your Trading with the Babi Ngepet EA for MetaTrader 5
- Mastering the Market with the 1MA Expert Advisor for MetaTrader 4