Trabalho concluído
Termos de Referência
This Expert Advisor is designed to detect liquidity-based reversals on the 15-minute timeframe by combining volume spikes, price action (pin bars), and trend alignment. The goal is to identify exhaustion candles during strong directional moves and enter trades at optimal points using adaptive stop-loss and risk-based lot sizing.
1. Volume Climax Detection
-
Identify bars where volume is at least 1.1× greater than the average of the last 20 bars
-
Only act on bars that qualify as pin bars with:
-
Wick-to-body ratio of 0.8 or more
-
Pin direction aligned with expected reversal
-
2. Trend Filter (Slope-Based)
-
Use a 50-period Simple Moving Average on the H1 timeframe
-
Confirm the trend direction using slope comparison over the last 5 candles
-
Slope ↑ = uptrend (only allow buys)
-
Slope ↓ = downtrend (only allow sells)
-
3. Trade Entry Logic
-
Entry on confirmation of reversal candle (after signal bar)
-
Position taken at the high/low of the pin bar
-
Use CTrade class or MqlTradeRequest for execution
4. Risk-Based Lot Sizing
-
User-defined RiskPercent per trade (e.g. 1%)
-
Calculate lot size dynamically based on stop-loss distance and account balance
5. Adaptive Stop-Loss & Take-Profit
-
Stop loss: Max of ATR(14) × 1.2 or 50 points
-
TP1 (Partial Take Profit): at 1:1 RR
-
TP2 (Final Take Profit): at 1.5:1 RR
-
Close 50% of position at TP1, move SL to breakeven, and let remaining run to TP2
6. Daily Loss Limiter
-
Prevent trading if daily loss exceeds X% of account balance (e.g. 5%)
7. Trade Session Filter (optional but useful)
-
Only allow trades during London & New York sessions (07:00–22:00 terminal time)
8. No Re-entry Unless New Signal
-
Only one position open per symbol
-
New entry only allowed after a fresh climax + pin setup