Whale Fibonacci Bollinger Bands
- Experts
- Mustafa Ozkurkcu
- Versione: 1.0
- Attivazioni: 5
Trend Band Strategy (v1.0) is a hybrid trend-following and mean-reversion Expert Advisor that blends Fibonacci-scaled Bollinger Bands with Parabolic SAR confirmation.
It identifies stretched price moves toward the extreme Fibonacci bands, waits for a reversal signal aligned with the SAR trend switch, and opens counter-trend trades aiming for reversion toward equilibrium.
The algorithm runs entirely on bar-close logic for stability and includes dynamic risk-based lot sizing, margin verification, and account-balance protection.
The EA is validation-friendly for MQL5 Market publishing (no custom DLLs, works in Strategy Tester), and can be tuned for high-volatility pairs or indices by adjusting VWMA and deviation parameters.
How the Strategy Works
1. Indicator Framework
-
Parabolic SAR: Determines primary trend direction.
-
Price above SAR → Uptrend
-
Price below SAR → Downtrend
-
-
Fibonacci Bollinger Bands (FBB): VWMA-based central line with standard-deviation envelopes scaled by Fibonacci ratios
(0.236 – 1.000).
It defines a multi-layer “trend band” zone, allowing detection of overextended moves.
2. Signal Generation
-
Uptrend (Buy Setup)
-
Two bars ago, the candle closed below the lowest band (FBB Lower 6) → oversold condition.
-
Current bar closes back above FBB Lower 5 while SAR confirms uptrend → bullish reversion trigger.
-
-
Downtrend (Sell Setup)
-
Two bars ago, the candle closed above the highest band (FBB Upper 6) → overbought condition.
-
Current bar closes back below FBB Upper 5 while SAR confirms downtrend → bearish reversion trigger.
-
3. Trade Execution
-
On confirmation:
-
BUY: Entry = Ask Price
-
SL = Ask − (StopLoss × 10 × Point)
-
TP = Ask + (TakeProfit × 10 × Point)
-
-
SELL: Entry = Bid Price
-
SL = Bid + (StopLoss × 10 × Point)
-
TP = Bid − (TakeProfit × 10 × Point)
-
-
-
Minimum stop-distance checks ( SYMBOL_TRADE_STOPS_LEVEL ) prevent invalid orders.
-
Margin verification ensures required margin ≤ 95 % of free margin before placement.
4. Lot Calculation & Risk Control
-
If InpLotSize > 0 → fixed lot.
-
Else the EA auto-computes position size:
RiskAmount = AccountBalance × (InpRiskPercent / 100) Lot = RiskAmount / (SLticks × TickValue) -
Lot is normalized between SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_MAX using SYMBOL_VOLUME_STEP .
5. Safety Filters
-
Minimum Deposit Check: Blocks trading below InpMinDeposit , yet passes validation.
-
Data Readiness: Waits until sufficient bars (VWMA period + 10) exist.
-
Single Position Rule: Only one open position per symbol (checked via PositionSelect ).
-
Error Handling: Copy-buffer and indicator failures logged; initialization never aborts for validation safety.
Explanation of Input Parameters
Parabolic SAR Settings
| Parameter | Description |
|---|---|
| InpSARStep | Acceleration factor; higher = faster SAR turns. |
| InpSARMaximum | Maximum acceleration limit. |
Fibonacci Bollinger Band Settings
| Parameter | Description |
|---|---|
| InpVWMAPeriod | Period for VWMA basis line. |
| InpStdDevMultiplier | Multiplier for standard deviation width. |
| InpPriceType | Applied price, default HLC3 (Typical Price). |
| InpFibLevel | Primary Fibonacci level (0.236 – 1.0) used for entry scaling. |
Risk Management
| Parameter | Description |
|---|---|
| InpLotSize | Fixed lot (if > 0). |
| InpRiskPercent | Percent of balance risked per trade when auto-lot enabled. |
| InpStopLoss | Stop-loss distance in pips. |
| InpTakeProfit | Take-profit distance in pips. |
| InpMinDeposit | Minimum required balance; below this EA won’t trade. |
General Settings
| Parameter | Description |
|---|---|
| InpMagicNumber | Unique identifier for EA positions. |
| InpTradeComment | Custom comment text attached to orders. |
Practical Notes & Tuning
-
Execution Environment: Fully backtestable; uses only bar and indicator data (no DOM).
-
Timeframes: Works best on H1–H4 for swing setups; M15–M30 for intraday mean reversion.
-
VWMA Tuning: Larger periods → smoother bands → fewer trades; smaller → more responsive.
-
Deviation Control: InpStdDevMultiplier ≈ 2.0 suits volatile pairs; reduce for calmer markets.
-
Fibonacci Depth: 0.618 and 0.764 bands provide strong reversal zones.
-
Risk Balance: Keep InpRiskPercent ≤ 1% for conservative trading.
-
Margin Headroom: EA uses only 95 % of free margin; avoid over-leveraged accounts.
-
Validation Compatibility: All terminal checks pass; EA initializes even on insufficient balance to meet MQL5 Market rules.
Important Risk Disclosure
Automated trading and leveraged FX/CFD operations involve substantial risk.
-
Capital Loss: You may lose all invested funds.
-
Market Volatility: Sudden spikes can skip SL/TP levels, causing slippage.
-
Indicator Lag: SAR and VWMA rely on historical data; trend reversals may be delayed.
-
Broker Variation: Different tick volumes and stop levels affect signal accuracy.
-
Backtest vs Live: Historical tests cannot replicate real-time spreads, commissions, or execution latency.
-
Responsibility: Use only on regulated brokers and demo-test thoroughly before deploying on live accounts.
