Risk ManagementEA Position Sizing for a Drawdown Lock
A trailing drawdown lock ratchets up with every new equity high and never gives ground back. Most EAs have no idea it exists.
Build a rule-based forex strategy in MT5 step by step — entries, exits, risk management, backtesting and forward testing, checklist included.

A rule-based forex strategy is the single most important weapon in a profitable trader's arsenal. Most retail traders don't have one. They enter trades on gut feeling, chase the market after news spikes, and revenge-trade after losses. Building a rule-based forex strategy in MetaTrader 5 eliminates all of that, giving you a systematic, repeatable edge. After 15+ years of live trading and strategy development, I can tell you this: the traders who survive are the ones who follow rules. Not the ones with the fanciest indicators or the biggest accounts. In this guide, I'll walk you through exactly how to build a rule-based forex strategy in MT5, with a practical checklist you can start using today.
A rule-based forex strategy is a trading system where every decision is governed by predefined, objective rules. There's no room for interpretation, emotion, or second-guessing. You define your entry conditions, exit conditions, position sizing, and risk parameters. Then you follow them without deviation.
This isn't the same as a fully automated Expert Advisor (EA), although rule-based strategies can be automated later. The point is to create a repeatable, testable process that you can backtest, forward-test, and refine over time.
Beginners obsess over finding the "right" indicator. Professionals obsess over building the right process. Here's the truth: RSI, MACD, and moving averages all "work" in some market conditions and fail in others. The difference between a winning trader and a losing one isn't which indicator they use. It's whether they have clear rules for when to act and when to sit on their hands. A rule-based approach gives you:
Before you open MT5, you need to answer one question: what market inefficiency are you exploiting? Every profitable rule-based forex strategy has an edge: a structural reason why it makes money. Without one, you're just gambling with extra steps. Common edges in forex include:
Don't try to combine multiple edges into one strategy. Pick one edge and build your entire ruleset around it.
Your timeframe determines everything, from how many trades you'll take to how much screen time you need. Be honest about your lifestyle and risk tolerance.
Pro tip: If you're building your first rule-based forex strategy, start with H1 or H4. These timeframes are forgiving: you have time to think, the signals are cleaner, and you're less affected by spread costs and slippage. Important: Calculate your spread-to-stop ratio before committing to a timeframe. If your broker's spread exceeds 5% of your typical stop loss (common on M15 strategies with tight stops), transaction costs will significantly erode your edge. Lower timeframes require tighter execution and wider spread tolerance.
Stick to major pairs (EUR/USD, GBP/USD, USD/JPY, AUD/USD) and a handful of liquid crosses. Avoid exotics: wider spreads and erratic price action make rule-based strategies harder to validate. Your strategy should work on at least 2-3 pairs to demonstrate robustness.
This is where most traders overcomplicate their rule-based forex strategy. Your entry rules should be simple, objective, and pass the "could a stranger execute this?" test. If someone else can't look at your rules and know exactly when to enter, they're not specific enough.
Break your entry into two components:
Example: Trend Continuation Strategy on H4:

News Filter (Critical): Avoid entries within 30 minutes before/after high-impact scheduled events (NFP, FOMC, ECB rate decisions, CPI releases). Even the best rule-based strategy can be destroyed by headline risk. Use MT5's integrated economic calendar from MQL5 or install a free news indicator.
In MT5, add your indicators to the chart and use templates to save your setup. This ensures consistency across sessions. Here's how:
TrendContinuation_H4
Use MT5's Objects panel to mark areas of interest, and the built-in Alert system to notify you when price reaches your setup zone, so you're not glued to the screen.
The exit is where the money is made or lost. You need three exit scenarios defined before you place any trade:
Your stop loss must be based on market structure, not an arbitrary pip count. Good stop placement options:
Rule: If the stop loss makes the trade risk more than your per-trade risk limit, skip the trade. No exceptions.
Define your target using one of these approaches:
Often overlooked, but critical. If a trade hasn't moved in your favour after X candles, close it. Dead trades tie up margin and mental energy. For an H4 chart, a reasonable rule might be: "If not at +1R within 5 candles (20 hours), close at market."
This section is the single biggest factor in long-term survival for any rule-based forex strategy, not optional.
Risk no more than 1% of your account equity per trade. Here's the formula: Lot Size = (Account Equity × Risk %) / (Stop Loss in Pips × Pip Value) MT5 makes this straightforward. Use the built-in Trade panel or a position size calculator script. Several free ones are available on the MQL5 marketplace; just verify they account for the correct pip value for each pair.
If you're trading EUR/USD long and GBP/USD long at the same time, you're essentially doubling your USD short exposure. Rule: Never have more than 2 correlated positions open simultaneously. Use MT5's correlation matrix tools or simply track your net exposure by currency.
MT5's built-in Strategy Tester is powerful for automated strategies, but even for manual rule-based strategies, you can (and should) backtest in MT5. Here's the process:
For an easier time interpreting these metrics (for automated strategies only) check out our better backtest reports. Important: Don't curve-fit. If you backtest, find poor results, change a rule, and re-test, you've just optimized for the past. Split your data: use 70% for development and 30% for out-of-sample validation.
Once your backtest shows a positive expectancy over 100+ trades, run your rule-based forex strategy forward on an MT5 demo account for at least 30 trading days. This validates that:
Use an equity tracker to monitor your real-time performance during forward testing; balance alone won't tell the full story. If your demo results show broadly similar expectancy to your backtest, you have a viable strategy. Some degradation is normal due to execution differences, slippage, and spread variation. But if the core edge persists, you're ready for real capital (starting small).
Your trading plan is the final layer. It turns your rule-based forex strategy into a complete operating procedure. It should include:
Use this checklist every time you develop or refine a rule-based forex strategy. Don't go live until every box is checked.
Most rule-based forex strategies fail for one of four recurring reasons: too many entry conditions, chasing win rate instead of expectancy, ignoring the market regime, and skipping the trading journal. Each one is easy to avoid once you know to check for it.
More rules ≠ better results. Every additional filter reduces your sample size. If you need 7 conditions to align before you can trade, you'll get 3 signals per year: not enough data to validate anything. Aim for 2-4 entry conditions maximum.
A 40% win rate with a 3:1 R:R is far more profitable than an 80% win rate with a 0.5:1 R:R. Focus on expectancy, not win rate.
No strategy works in all conditions. Your trend strategy will get chopped up in consolidation. Your mean-reversion strategy will get steamrolled in strong trends. Define what the ideal market regime looks like for your strategy and add a rule to sit out when conditions don't match.
If you're not recording every trade (entry reason, emotional state, execution quality, outcome), you're flying blind. MT5's built-in trade history export is a good start, but pair it with a journal that captures the qualitative aspects of your trading.
Once your rule-based forex strategy is proven and documented, you have a clear path to automation. MT5's MQL5 language lets you code your strategy as an Expert Advisor. Because your rules are already objective and well-defined, the translation to code becomes straightforward.
For a complete walkthrough, see our guide to MT5 Expert Advisors. Even if you don't plan to automate, the discipline of building a rule-based forex strategy makes you a better discretionary trader. It forces you to think in probabilities, respect risk, and treat trading as a business rather than a gamble.
Print the checklist above and pin it next to your trading screen. The next time you're tempted to take a trade "because it just looks right," stop, check your rules, and only act if every condition is met.