Market State Intelligence OBV
- Experts
- Versione: 3.7
- Attivazioni: 5
MSI-OBV: Market State Intelligence with On-Balance Volume Engine
What is MSI-OBV?
MSI-OBV is a fully automated trading Expert Advisor that combines the power of On-Balance Volume (OBV) analysis with a flexible execution engine. It detects market regime shifts, volume momentum, and trend changes to generate high-probability entry and exit signals.
The EA works with the OBV_MTF_I4EA indicator (embedded) - a standalone indicator valued at $100 on the MQL5 Market. This indicator is included with the EA at no additional cost, providing you with professional-grade volume analysis and multi-timefram intelligence.
Key Features
| Feature | Description |
|---|---|
| Dual Entry Signals | Choose from Momentum signals (buffers 2,3) and/or X-Cross signals (buffers 7,8) with OR/AND logic |
| Flexible Exit Signals | Map any indicator buffer for exits OR use opposite entry signal |
| Divergence Detection | OBV_MTF_I4EA includes bullish and bearish divergence detection (buffers 4,5) - usable for both entry and exit signals |
| HTF Directional Filter | Single timeframe OR 2-of-3 consensus with REGIME or SLOPE columns |
| One-Direction Trading | Set MaxBuyPositions or MaxSellPositions to 0 to trade only in the HTF direction - true trend following |
| Proximity Filter | Enforces minimum distance between entries in same direction |
| Bar-Based Entries | Signals processed once per bar (no repainting, no multiple entries) |
| Real-Time Exits | Exit signals checked every tick for immediate response |
| Auto-Reversal | Closes positions and opens opposite on signal |
| Broker Profiler | Adapts slippage based on live execution feedback |
| Breakeven + Partial Close | Lock in profits and reduce risk systematically |
| Trading Hours Control | Set specific start and end hours for trading sessions |
| Session Detection | Automatically identifies Sydney, Tokyo, London, and New York sessions |
| Diagnostic Buffer Scan | Prints active buffer mappings directly to terminal logs |
One-Direction Trading: Trend is Your Friend
MSI-OBV includes a powerful trend-following capability that many traders overlook. By simply setting the maximum positions for one direction to zero, the EA will only trade in the direction of the HTF filter.
How It Works
| Setting | Value | Result |
|---|---|---|
| MaxBuyPositions | 0 | EA will NEVER open BUY positions |
| MaxSellPositions | 1 | EA can open SELL positions |
| HTF Filter | BEARISH | Only SELL trades are allowed (aligns with trend) |
Why This Matters
-
Eliminates counter-trend trades (reduces losses)
-
Forces discipline - only trades with the trend
-
Perfect for traders who believe "trend is your friend"
-
Simpler than setting up complex trend filters
-
Works seamlessly with the HTF directional filter
Included Indicator Value
The EA embeds the OBV_MTF_I4EA indicator which is valued at $100 as a standalone purchase. This indicator provides:
-
Multi-timeframe OBV analysis (M15, H1, H4)
-
Regime detection (Bullish/Bearish/Neutral)
-
Slope detection (Up/Down/Flat)
-
X-Cross signals (regime changes)
-
Bullish and Bearish Divergence detection
-
Distance gauge (ATR-based risk assessment)
You get all this functionality included with the EA at no extra cost.
Questions MSI-OBV Answers
| Trader Question | How MSI-OBV Answers It | With What |
|---|---|---|
| "Is the trend bullish or bearish?" | HTF Filter reads Regime column from selected timeframe(s) | HTF_FILTER (SINGLE or CONSENSUS) |
| "How do I trade only with the trend?" | Set one direction's max positions to 0 | ONE-DIRECTION TRADING |
| "When should I enter?" | Momentum signals detect acceleration; X-Cross detects regime changes | DUAL ENTRY SIGNALS with OR/AND logic |
| "When should I exit?" | Exit on opposite entry signal OR custom exit buffers | FLEXIBLE EXIT SYSTEM |
| "Is there a divergence signal?" | OBV_MTF_I4EA detects bullish and bearish divergences | DIVERGENCE BUFFERS (4,5) |
| "Am I entering too close to my last trade?" | Proximity Filter blocks entries within X points of previous same-direction entry | PROXIMITY FILTER (user-defined points) |
| "Is the volume confirming the move?" | OBV calculates volume delta; Regime and Slope columns show conviction | OBV_MTF_I4EA ENGINE |
| "What do higher timeframes say?" | HTF Consensus checks 2 of 3 timeframes for alignment | MULTI-TF CONSENSUS |
| "Why was my trade blocked?" | EA panel displays block reason (HTF, Spread, Proximity, Confidence) | BLOCK REASON DISPLAY |
| "Is the EA configured correctly?" | Diagnostic scan prints active signal buffers to terminal | DIAGNOSTIC BUFFER SCAN |
| "How do I know which buffer to use for exits?" | Buffer scan identifies which buffers have active signals | TERMINAL LOG OUTPUT |
| "Will my broker's slippage affect performance?" | Broker Profiler adapts slippage dynamically | BROKER PROFILER |
| "How do I protect profits?" | Breakeven and Partial Close handlers lock in gains | RISK MANAGEMENT SUITE |
| "What time is it safe to trade?" | Trading hours control restricts when trades can be placed | TRADING START/END HOUR |
| "Which session is currently active?" | Session detection identifies market session in real-time | SESSION INFO DISPLAY |
Versatility: Signal Entry and Exit
Entry Configuration
| Setup | Momentum Entry | X-Cross Entry | Divergence Entry | Combine Mode | Best For |
|---|---|---|---|---|---|
| Momentum Only | ON | OFF | OFF | (ignored) | Trend followers |
| X-Cross Only | OFF | ON | OFF | (ignored) | Regime changers |
| Divergence Only | OFF | OFF | ON | (ignored) | Reversal traders |
| Both (OR) | ON | ON | OFF | OR | Maximum opportunities |
| Both (AND) | ON | ON | OFF | AND | High-conviction only |
| Full Suite | ON | ON | ON | OR | All signal types |
Exit Configuration
| Setup | Opposite Entry | Custom Buffers | Result |
|---|---|---|---|
| Signal Exit | ON | OFF | Exit on opposite signal |
| X-Cross Exit | OFF | ExitBuy=8, ExitSell=7 | Exit on regime change |
| Momentum Exit | OFF | ExitBuy=3, ExitSell=2 | Exit on momentum shift |
| Divergence Exit | OFF | ExitBuy=5, ExitSell=4 | Exit on divergence signal |
| No Exit Signals | OFF | OFF | Use SL/TP only |
HTF Filter: Two Independent Settings
Setting 1: HTF Source (WHICH timeframe)
| Source | Description |
|---|---|
| SINGLE | Use one timeframe only (user selects which) |
| CONSENSUS | Use 2 of 3 timeframes (user selects all 3) |
Setting 2: HTF Column (WHAT to read)
| Column | Description |
|---|---|
| REGIME | Bull/Bear/Neutral (based on OBV vs midpoint) |
| SLOPE | Up/Down/Flat (based on OBV momentum) |
EA has; Trading Time Restrictions (restrict window within which EA is active) and Session Info display (London, Newyork, Tokyo, Sydney & their overlap transition)
Semi-Automation Capabilities
MSI-OBV can be used in semi-automated mode, giving you manual control over trade decisions while the EA handles analysis and position management:
How Semi-Automation Works
| Mode | EA Role | Trader Role | Best For |
|---|---|---|---|
| Full Auto | Everything | Monitor only | Hands-off trading |
| Signal-Only | Shows signals and HTF direction | Manual trade placement | Traders who want analysis only |
| Entry Auto, Exit Manual | Opens positions automatically | Decides when to exit | Taking profits manually |
| Entry Manual, Exit Auto | Shows entry signals | Opens trades manually | Protecting profits automatically |
Semi-Automation Setup
-
Disable Entry Execution - Set MaxBuyPositions and MaxSellPositions to 0
-
Enable Signal Display - Panel shows HTF direction and entry signals
-
Manual Trade Placement - Use the signals as a guide, place trades manually
-
Auto Position Management - Trailing stops, breakeven, and partial closes still work on manually opened trades (using the EA's Magic Number)
Why Use Semi-Automation?
-
Validation of signals before committing capital
-
Manual override of questionable signals
-
Learning the EA's behavior before full automation
-
Combining personal analysis with EA signals
Execution Safeguards
| Safeguard | Description |
|---|---|
| Broker Profiler | Adapts slippage parameters based on live execution feedback |
| Breakeven Handler | Moves SL to entry after profit target is reached (with buffer points) |
| Partial Close | Closes portion of position at profit levels |
| Proximity Filter | Blocks entries too close to previous same-direction entries |
| Margin Safety | Reduces lot size if margin exceeds 80% of free margin |
| Retry Logic | Retries failed orders with configurable attempts and delays |
| Spread Check | Blocks trades if spread exceeds user-defined maximum |
Included Files
-
MSI-OBV.mq5 - Main EA file
-
OBVIntelligence.mqh - OBV signal processing wrapper
-
OBV_MTF_I4EA.ex5 - Embedded volume indicator ($100 value, included at no extra cost)
Quick Start
-
Drop MSI-OBV on any chart (M15-H1 recommended)
-
Set your preferred entry signals (Momentum, X-Cross, Divergence, or combinations)
-
Configure HTF filter (SINGLE or CONSENSUS)
-
Set proximity filter distance (or disable with 0)
-
Configure trading hours and session preferences
-
Enable automated trading and watch the EA work
