Risk-Sentry EA is not just another stop-loss tool—it's a dynamic risk containment framework for traders who treat capital preservation as a competitive advantage. In the same way a master carpenter trusts their chisel over a blunt blade, this Expert Advisor refines the blunt tool of static stop-losses into a precision instrument.
Built for MetaTrader 4 & 5, this algorithm continuously evaluates volatility skew, market momentum, and time-decay profiles to adjust exit parameters in real-time. Whether you trade EUR/USD, BTC/USD, or XAU/USD, Risk-Sentry EA ensures your exits are intelligent, adaptive, and aligned with your risk budget.
"A good trader stops losses. A great trader makes losses impossible to grow."
graph TD
A[Market Tick Arrives] --> B{Volatility Check}
B -->|High Volatility| C[Widen SL / Tighten TP]
B -->|Low Volatility| D[Narrow SL / Widen TP]
C --> E{Momentum Filter}
D --> E
E -->|Trend Strong| F[Shift TP in Trend Direction]
E -->|Trend Weak| G[Shift SL to Breakeven]
F --> H[Time Decay Scan]
G --> H
H -->|Near Close| I[Begin Trailing Exit]
H -->|Mid-Session| J[Maintain Adaptive Zones]
I --> K[Execute Exit]
J --> K
K --> L[Log Performance]
| Feature | Description | Benefit |
|---|---|---|
| Adaptive Stop-Loss 🎯 | Adjusts SL based on ATR, Bollinger Band width, and session volatility | Prevents premature exits during normal market noise |
| Smart Take-Profit 💰 | Dynamic TP that accounts for resistance zones and volatility compression | Captures larger moves when conditions permit |
| Breakeven Engine 🔒 | Automatically moves SL to entry + spread when price moves in your favor | Protects capital on winning trades |
| Trailing Exit Logic 📈 | Customizable trail activation (pips or percentage) | Lets winners run without giving back profits |
| Time-Decay Aware ⏳ | Adjusts exit parameters as session progresses | Optimizes for end-of-day price behavior |
| Multi-Asset Compatible 🌍 | Forex, Crypto, Indices, Commodities | One EA for all markets |
| No DLL Dependencies 🧩 | Pure MQL4/MQL5 code | Works on all brokers, including VPS |
| Error Recovery 🛠️ | Auto-restart on terminal restart | 24/7 operation without monitoring |
Risk-Sentry EA optionally connects to OpenAI GPT-4 or Claude API for enhanced market analysis:
- Sentiment Scoring: The EA sends recent price action data to the API and receives a volatility sentiment score (0-100).
- Exit Optimizer: For traders using the
API_MODE = truesetting, the EA queries an LLM to suggest optimal SL/TP adjustments based on 50 recent candles. - Risk Commentary: Receive natural-language risk briefings attached to trade logs.
"The AI integration transforms a reactive tool into a predictive shield—like having a risk analyst sitting inside your terminal."
- Dashboard Display: Real-time risk metrics on chart (current volatility, stop distance, AI sentiment)
- Mobile-Friendly Inputs: Settings panel scales to any screen resolution
- Languages Supported:
- 🇺🇸 English
- 🇪🇸 Español
- 🇫🇷 Français
- 🇩🇪 Deutsch
- 🇨🇳 简体中文
- 🇯🇵 日本語
- 🇧🇷 Português (Brasil)
| OS | Status | Notes |
|---|---|---|
| Windows 7–11 | ✅ Fully tested | Works with MT4/MT5 builds 1410+ |
| macOS (via Wine) | ✅ Certified | Use CrossOver 22+ for best results |
| Ubuntu 20.04+ (Wine) | ✅ Verified | Requires Wine 7.0+ |
| Android (MT4/5 Mobile) | ❌ No EA support | Use companion mobile dashboard |
| iOS (MT4/5 Mobile) | ❌ No EA support | Viewable via Push notifications |
[PROFILE: CONSERVATIVE_FOREX]
risk_per_trade = 0.5
max_spread = 2.0
volatility_period = 14
stop_loss_buffer = 2.0 ; In ATR multiples
take_profit_ratio = 1.8
break_even_trigger = 0.3 ; Move to BE at 30% of TP
trail_activation = 50 ; Pips
trail_step = 10 ; Pips
time_decay_enabled = true
use_ai_analysis = false[PROFILE: AGGRESSIVE_CRYPTO]
risk_per_trade = 2.0
max_spread = 5.0
volatility_period = 21
stop_loss_buffer = 1.5
take_profit_ratio = 3.0
break_even_trigger = 0.5
trail_activation = 100
trail_step = 25
time_decay_enabled = false
use_ai_analysis = true
api_type = "claude"For advanced users running MT4/5 headless on a VPS:
# Start Risk-Sentry EA on EURUSD H1 with Conservative profile
mt4-terminal --ea "Risk-Sentry EA" \
--symbol "EURUSD" \
--timeframe "H1" \
--profile "conservative_forex.ini" \
--log-level "info" \
--api-key "your_claude_api_key"Output Example:
[Risk-Sentry] 14:32:01 - Loaded profile: conservative_forex
[Risk-Sentry] 14:32:02 - EURUSD volatility: 0.0012 (Normal)
[Risk-Sentry] 14:32:02 - SL set at 1.08245 (11 pips)
[Risk-Sentry] 14:32:02 - TP set at 1.08585 (35 pips)
[Risk-Sentry] 14:32:02 - AI Sentiment: Neutral (52/100)
[Risk-Sentry] 14:32:02 - Monitoring...
- Download the EA from the link at the top or bottom of this page.
- Place
Risk-Sentry EA.ex4(or.ex5) in your MT4/MT5Expertsfolder. - Restart the terminal or refresh Navigator.
- Drag the EA onto a chart.
- Configure parameters (or load a profile from
\Filesfolder). - Enable AutoTrading (green arrow).
- Demo First: Always test on a demo account for at least 30 trades.
- Broker Compatibility: Avoid brokers with "dealer" execution or requotes.
- Risk Budget: Set
risk_per_tradeto no more than 2% for active accounts. - News Events: Consider disabling EA during high-impact news (use built-in
news_filterparameter). - VPS Required: For 24/7 operation, a $5/month VPS (Windows) is recommended.
We never leave you stranded. Support channels include:
- Email: support [at] risksentry [dot] io (response within 4 hours)
- Telegram: @RiskSentryBot (instant for priority users)
- GitHub Issues: For bug reports and feature requests
- Knowledge Base:
docs.risksentry.io(200+ articles)
Trading foreign exchange, cryptocurrencies, and other leveraged instruments carries a high level of risk and may not be suitable for all investors. Past performance is not indicative of future results. Risk-Sentry EA is a tool designed to assist with risk management—it does not guarantee profits or prevent losses entirely. The software is provided "as is" without warranty of any kind, either expressed or implied.
By using this software, you agree that:
- You are solely responsible for your trading decisions.
- The developers assume no liability for any financial losses incurred.
- You have tested the EA thoroughly on a demo account before live use.
This project is licensed under the MIT License © 2026.
You are free to use, modify, and distribute this software, provided that the original copyright notice is included.
risk management EA, adaptive stop-loss, take-profit optimizer, MetaTrader volatility tool, crypto SL EA, forex capital preservation, AI trading assistant, trailing stop EA, breakeven EA, MQL5 risk manager, automated exit strategy, smart stop-loss 2026
- Built with ❤️ for the trading community
- Inspired by the principles of Kelly Criterion and Position Sizing Theory
- Special thanks to all beta testers on Discord
Risk-Sentry EA — Because your capital deserves a sentry, not a gambler's prayer.