AI Range Compression Breakout Trader
- Experts
- 버전: 1.0
AI Range Compression Breakout Trader — MetaTrader 5 Trading Robot
AI Range Compression Breakout Trader is a fully automated MetaTrader 5 Expert Advisor built around a market-tested idea: price ranges that compress tightly relative to their own historical average are frequently followed by a strong directional expansion. The robot measures the current short-term range against a longer-term baseline range on the same symbol, waits for a genuine squeeze condition, and then arms itself to trade the breakout in whichever direction the market actually moves.
There is no fixed list of symbols or timeframes hard-coded into the logic. The Expert Advisor calculates everything from the live price data of the chart it is attached to, so it can be tested and used on different instruments and periods according to your own trading plan.
Key Features
- Detects range compression (a "squeeze") by comparing the recent range to its own historical average range, instead of relying on a fixed pip value.
- Trades the breakout in either direction with a configurable buffer beyond the compressed range, so entries are not triggered on price noise.
- One new-bar check per candle keeps the logic clean and avoids duplicate signals within the same bar.
- Automatic lot size normalization to the broker's minimum, maximum and step volume rules.
- Margin check before every trade using OrderCalcMargin with a safety buffer, so the robot will not attempt a trade it cannot safely support.
- Built-in trailing stop that only moves the stop loss once price has advanced enough, and never moves it in a way that would place it too close to the current price or endanger the take profit.
- A safety check on every new order verifies the stop loss against both sides of the spread before sending the trade, so orders are skipped instead of rejected during unusually wide-spread conditions.
- No Martingale, no grid, no position averaging — every position is opened with its own fixed stop loss and take profit from the moment it is placed.
Recommended Use
- Works on any symbol and timeframe available in your MetaTrader 5 terminal — test it on the instrument and period you intend to trade.
- Best suited to instruments that show clear alternating cycles of quiet consolidation and expansion moves.
- Always test on a demo account first and confirm the input settings match your broker's typical spread and stop level before using a live account.
- Use a VPS for uninterrupted operation, since the Expert Advisor needs to keep monitoring the chart continuously to detect the squeeze and the breakout.
Main Inputs
- Compression Bars — number of recent bars used to measure the current, short-term range.
- Baseline Bars — number of bars used to calculate the normal, longer-term average range for comparison.
- Compression Percent — the current range must fall below this percentage of the average range for a squeeze to be recognized.
- Breakout Buffer Points — distance in points beyond the compressed range required to confirm a genuine breakout.
- Lot Size — fixed trading volume used for each new position.
- Stop Loss Points / Take Profit Points — distance in points for the protective stop loss and take profit on every trade.
- Trailing Start Points / Trailing Step Points — profit distance required before the trailing stop activates, and the step by which it advances afterward.
- Magic Number — unique identifier used to separate this Expert Advisor's positions from any other robot running on the same account.
Past performance of any trading strategy, including results shown in the Strategy Tester, does not guarantee future results. Please test thoroughly on a demo account and understand the risks of automated trading before using this product on a live account.
