Hermes Rule Based Trade Template
- Uzmanlar
-
Juan Francisco Fraguela
HermesBot - custom MQL5 and MQL4 development
We build custom Expert Advisors, indicators and utilities for MetaTrader 5 and MetaTrader 4, based on clearly defined trading rules.
What you get:
- Clean, commented source code, with every setting exposed as grouped inputs. - Sürüm: 1.0
- Etkinleştirmeler: 10
Hermes Rule Based Trade Template is an Expert Advisor for MetaTrader 5 that trades four simple, well-known entry signals and wraps them in a complete set of risk and execution controls. It is built for traders who want transparent, rule-based behavior that they can test and adjust in the Strategy Tester before using it on any account.
The Expert Advisor does not use martingale, grid or averaging. It opens at most one entry per bar and always places a stop loss when one is configured. Every decision it takes, including the signals it rejects and the reason, is written to the Experts log, so you can see exactly why a trade was or was not opened.
Entry signals (choose one)- Moving average cross: the fast moving average crosses the slow moving average on a closed bar (method and applied price are configurable).
- Relative Strength Index (RSI) levels: buy when the RSI leaves the oversold level, sell when it leaves the overbought level.
- Previous candle: trade in the direction of the last closed candle, with an optional minimum body size; doji candles are skipped.
- Session range breakout: builds the high and low of a time window (server time), draws it on the chart and trades a close beyond it, with an optional buffer and one breakout per side per day.
- Optional trend filter: only trade in the direction of a long moving average.
- Allowed direction: buy and sell, buy only or sell only.
- Stop loss and take profit in points, automatically widened to the broker stops level when needed.
- Break-even with a configurable trigger and locked points.
- Trailing stop with start, distance and step.
- Lot size: fixed lot, or a percentage of the balance risked at the stop loss.
- Maximum number of open positions for this Expert Advisor (magic number and symbol).
- Daily loss limit in account currency or as a percentage of the day-start balance, with optional closing of the positions of this Expert Advisor.
- Maximum spread filter and trading-hours window (overnight windows supported), with optional closing outside the window.
- Optional close of open positions on an opposite signal.
- Checks free margin before every order and skips the trade with a clear message if the margin is not enough.
- Normalizes volume to the broker minimum, maximum and step.
- Respects stops level and freeze level for every modification.
- Works on netting and hedging accounts and never touches positions from other Expert Advisors or manual trades.
- No external DLLs and no web requests.
- Entry signal: signal mode, signal timeframe, allowed direction.
- Moving average cross: fast period, slow period, method, applied price.
- RSI levels: period, oversold level, overbought level.
- Previous candle: minimum body in points.
- Session range breakout: range start and end time, breakout buffer, one breakout per side per day.
- Trend filter: enabled or disabled, moving average period, moving average method.
- Stop loss and take profit: stop loss in points, take profit in points, close on opposite signal.
- Break-even: enabled or disabled, trigger points, locked points.
- Trailing stop: enabled or disabled, start points, distance, step.
- Position size: lot mode, fixed lot, risk percent.
- Limits: maximum positions, maximum spread, daily loss mode, daily loss value, close all when the limit is hit.
- Trading hours: enabled or disabled, start and end time, close outside hours.
- Other: magic number, order comment, maximum slippage, detailed log, on-chart panel.
- Download the demo version from this page (it runs in the Strategy Tester only), then open the Strategy Tester in MetaTrader 5 (Ctrl+R) and select Hermes Rule Based Trade Template.
- Choose a symbol and timeframe, for example EURUSD H1, and the "Every tick based on real ticks" model.
- Start with the default inputs, then change the entry signal and the risk settings one group at a time.
- Enable visual mode to see the on-chart panel with the active settings, the session range rectangle and the last decision.
- Read the Journal tab: each entry, rejection, break-even and trailing modification is logged with its reason.
Default stop loss, take profit and trailing values are in points. Symbols with very different point sizes, such as gold, indices or cryptocurrencies, need larger values than currency pairs.
Notes- Past results in the Strategy Tester do not guarantee future results. The Expert Advisor executes the rules you configure and does not promise any profit.
- The Expert Advisor is written in MQL5. If you need the same logic for MetaTrader 4, or a custom version with your own rules, we can also port it to MQL4. Contact us through the MQL5 private messages.

