Malaysian Support and Resistance
- Uzmanlar
- Januaries Mwaka Mawioo
- Sürüm: 1.10
- Etkinleştirmeler: 10
MetaTrader 5 Expert Advisor | Multi-Symbol Support & Resistance Trading with Trend-Based Logic
Overview
Classic SNR Breakout EA is a professional trading robot that identifies structural Support & Resistance levels using daily swing points and executes trades based on H1 price action relative to these levels. The EA applies dual logic: in an uptrend, it sells on H1 rejection below an SNR level; in a downtrend, it buys on H1 rejection above an SNR level. Breakout confirmations are also traded when the H1 close moves decisively beyond a level.
The EA scans up to 14 symbols simultaneously, automatically resolving broker-specific symbol names and suffixes.
This strategy is designed for traders who understand that structural levels can act as both support/resistance and breakout triggers, depending on market context.
How It Works
The EA analyzes daily close prices to identify swing highs and swing lows over a configurable lookback period. These swing points become structural Support and Resistance levels. The EA then monitors H1 candle closes relative to each SNR level and applies trend-based logic to determine trade direction.
Core Trading Logic
The EA does not simply trade breakouts in one direction. Instead, it evaluates price position and H1 close behavior:
| Price Position Relative to SNR | H1 Close Behavior | Trade Action |
|---|---|---|
| Price ABOVE SNR (uptrend context) | H1 closes BELOW the level (rejection) | SELL |
| Price BELOW SNR (downtrend context) | H1 closes ABOVE the level (rejection) | BUY |
| Price touches SNR level | H1 closes BEYOND the level (breakout) | Trade in breakout direction |
This means:
-
In an uptrend (price trading above an SNR level): If the H1 candle taps the level but closes below it, this signals rejection. The EA opens a SELL position.
-
In a downtrend (price trading below an SNR level): If the H1 candle taps the level but closes above it, this signals rejection. The EA opens a BUY position.
-
Breakout scenario: When price breaks through a level and the H1 candle closes beyond it, the EA trades in the breakout direction (BUY above resistance, SELL below support).
Signal Generation Process
Step 1: Daily SNR Calculation
-
Scans daily close prices over the configured period (default 60 bars)
-
Identifies swing highs (resistance) and swing lows (support)
-
Clusters nearby levels within user-defined distance (default 50 pips)
-
Levels are sorted and classified relative to current price
Step 2: H1 Confirmation (Dual Logic)
-
Waits for an H1 candle to close
-
The candle must "tap" the SNR level (low ≤ level ≤ high)
-
Rejection Signal (Counter-Trend):
-
Price above level + H1 closes below level → SELL
-
Price below level + H1 closes above level → BUY
-
-
Breakout Signal (Trend-Following):
-
H1 closes above resistance → BUY
-
H1 closes below support → SELL
-
Step 3: Pending Signal Creation
-
When H1 confirms, a pending signal is created at the SNR level
-
The EA waits for price to return within the entry zone (default 5 points)
-
Pending signals are invalidated if price breaks through the level on subsequent H1 bars
Step 4: Precise Entry Execution
-
When price returns to the SNR level ± entry zone, the trade executes immediately
-
Stop loss is placed beyond the SNR level with user-defined buffer
-
Take profit targets the next SNR level in the direction of the trade
-
Partial profit taking closes 50% of the position at 50% of TP distance and moves SL to breakeven
Reversal Handling
When a new H1 confirmation contradicts an existing position direction, the EA automatically closes all positions of the opposite type before opening new ones. For example:
-
If the EA has BUY positions and a new SELL signal is confirmed, all BUY positions are closed first
-
This prevents position pile-up and follows the new market direction
Risk Management
| Parameter | Default | Description |
|---|---|---|
| Risk per setup | 10% | Percentage of equity risked per trade |
| SL buffer | 20 pips | Distance beyond SNR level for stop loss |
| TP buffer | 10 pips | Distance before next SNR level for take profit |
| Max positions per symbol | 50 | Concurrent position limit |
| Max spread | 500 points | Maximum allowed spread for entry |
Position Sizing
Lot sizes are calculated automatically based on:
-
Account equity
-
Risk percentage per trade
-
Stop loss distance in pips
-
Symbol-specific tick value and tick size
The EA also respects:
-
Broker volume limits (min, max, step)
-
Position volume limits per symbol
-
Margin availability (prevents over-leverage)
Partial Profit Taking
At 50% of the distance to the take profit level:
-
Half of the position volume is closed
-
The remaining position's stop loss is moved to breakeven
-
Original take profit target remains active
This locks in profits early while keeping runners open for extended moves.
Input Parameters
Symbol Configuration
| Parameter | Default | Description |
|---|---|---|
| SymbolList | US30,US100,US500,XAUUSD,... | Comma-separated symbol names |
SNR Detection
| Parameter | Default | Description |
|---|---|---|
| SwingLookback | 3 | Bars on each side to identify swing points |
| DailyBarsToScan | 60 | Number of daily bars to analyze (0=all) |
| SNR_ClusterPips | 50 | Distance to merge nearby levels (pips) |
Visual Display
| Parameter | Default | Description |
|---|---|---|
| DrawSNRLines | true | Draw SNR levels on chart |
| SupportColor | DodgerBlue | Color for support lines |
| ResistanceColor | OrangeRed | Color for resistance lines |
| SNR_LineStyle | STYLE_SOLID | Line style for SNR levels |
| SNR_LineWidth | 2 | Line width |
Trade Parameters
| Parameter | Default | Description |
|---|---|---|
| SL_BufferPips | 20 | Pips beyond SNR level for stop loss |
| TP_BufferPips | 10 | Pips before next SNR level for take profit |
| RiskPercent | 10.0 | Risk percentage per trade setup |
| MaxPosPerSymbol | 50 | Maximum positions per symbol |
| MagicNumber | 202603 | EA's unique identifier |
| MaxSpreadPoints | 500 | Maximum spread in points |
| EntryZonePoints | 5 | Max distance from SNR for entry (points) |
Debugging
| Parameter | Default | Description |
|---|---|---|
| DebugLog | false | Enable detailed debug logging |
Features
Dual Trading Logic (Breakout + Rejection)
The EA does not rely on a single market condition. It adapts to price behavior:
-
Rejection trades: When price respects an SNR level and reverses, the EA enters counter-trend positions
-
Breakout trades: When price violates an SNR level with conviction, the EA enters trend-following positions
This dual approach allows the EA to perform in both ranging and trending markets.
Automatic Symbol Resolution
The EA includes an extensive alias database covering:
-
Indices: US30, US100, US500, DE30, UK100, JP225
-
Metals: XAUUSD (Gold), XAGUSD (Silver)
-
Crypto: BTCUSD, ETHUSD
-
Forex: All major and minor pairs
Broker suffixes (e.g., XAUUSDz, US30.cash) are automatically handled.
Market Session Awareness
The EA checks if the market is open before executing any trade or position close, preventing errors during market closures.
Stop Level Protection
The EA automatically enforces broker minimum stop distances and freeze levels, preventing invalid stop loss and take profit placement.
Volume Normalization
Lot sizes are normalized to the exact decimal places required by each symbol's volume step, eliminating "Invalid volume" errors.
Order Validation
All trade requests pass through MQL5's OrderCheck function before submission, preventing terminal errors and log spam.
Supported Symbols
The EA supports a wide range of symbols including:
Indices
-
US30, DJ30, WS30, DOW JONES
-
US100, NAS100, USTEC, NASDAQ
-
US500, SPX500, SP500, S&P 500
-
DE30, GER30, DAX
-
UK100, FTSE
-
JP225, NIKKEI
Metals
-
XAUUSD (Gold)
-
XAGUSD (Silver)
Crypto
-
BTCUSD (Bitcoin)
-
ETHUSD (Ethereum)
Forex
-
All major, minor, and exotic pairs
Any symbol with available daily and H1 data can be added to the symbol list.
Requirements
-
MetaTrader 5 platform
-
Broker with access to configured symbols
-
Daily and H1 historical data for SNR calculation
-
Hedging or Netting account mode supported
Setup Instructions
-
Attach the EA to any chart
-
Configure the symbol list with your desired instruments
-
Adjust risk parameters according to your account size
-
Set SNR detection parameters for your trading style
-
Enable automated trading in MT5
-
Monitor the chart for drawn SNR levels
Symbol List Format
Use comma-separated base names. The EA will automatically resolve broker-specific names:
US30,US100,US500,XAUUSD,XAGUSD,EURUSD,GBPUSD,BTCUSD
Strategy Notes
This EA is designed for traders who:
-
Understand support and resistance concepts in both trending and ranging markets
-
Want automated trading that adapts to price behavior (breakouts AND reversals)
-
Accept the risks of trading near key structural levels
-
Use appropriate position sizing for their account
The EA does not predict price direction. It identifies structural levels and executes trades based on how price reacts to those levels on H1 confirmation, managing risk through automatic position sizing, stop losses, and partial profit taking.
Support
Product support is provided via the MQL5 comment section and messaging system. When requesting assistance, please include your broker name, symbol list, and any relevant screenshots.
Legal Disclaimer
Trading foreign exchange, indices, commodities, and cryptocurrencies carries a high level of risk and may not be suitable for all investors. Past performance does not guarantee future results. This Expert Advisor is a tool to assist with trading decisions; it does not guarantee profits. Users should test thoroughly on demo accounts before live deployment.
