Samurai sun
- Experts
- Version: 1.40
- Updated: 25 June 2026
- Activations: 10
Samurai Sun is an elite, institutional-grade algorithmic trading system engineered for modern Forex and Precious Metals markets (XAUUSD). Unlike traditional retail grid or martingale systems that fail during volatile market events, Samurai Sun is built on a proprietary Institutional Execution Architecture. It mathematically protects capital through dynamic stealth execution while maximizing trend capture via an advanced Multi-Timeframe (MTF) engine.
The system has been heavily hardened to achieve a flawless 10/10 MQL5 Validator Code Safety rating. It operates fully automatically but also features an interactive on-chart utility panel for hybrid manual trading, fully integrated with the internal risk engine.
The Institutional Execution Moat (Why We Are #1)
Two-Stage Stealth Execution: Samurai Sun never places orders with rigid Stop Loss or Take Profit targets attached to the market order. It guarantees the fill at the market price with 0.0 stops, dynamically modifying the targets milliseconds later. This makes the system virtually immune to widened spreads, slippage, and "Invalid Stops" requotes.
AI Perceptron Filter [NEW in v1.40]: Before placing any breakout orders, the built-in Neural Network pattern recognition engine evaluates historical price sequences. If the AI determines the pattern has a low probability of success, the trade is vetoed, drastically increasing strike rates.
Advanced Broker Defenses [NEW in v1.40]: Built to combat broker manipulation. Includes an External Price Feed Validator (verifies prices against 3rd-party APIs to detect price painting), DOM Spoofing Detector (monitors Level 2 order books for fake volume), and a Latency Guard (actively monitors ping and blocks trades during network lag).
Order Randomization Engine [NEW in v1.40]: Obfuscates your strategy footprint by introducing micro-millisecond execution delays and slight randomized lot variations, preventing broker algorithms from profiling your trades and hunting your stops.
Trade Pacing & Cooldowns [NEW in v1.40]: Forces extreme precision by enforcing a Maximum Trades Per Day limit and a mandatory Cooldown Timer after closed trades. This eliminates revenge trading, overtrading, and spread-fee erosion in choppy markets.
Stealth Netting Chunking: Built to survive deep drawdowns, the EA natively monitors your broker's SYMBOL_VOLUME_MAX. If an order exceeds the broker's limit, the algorithm seamlessly slices the order into sequential chunks, allowing massive accumulation and closure without triggering terminal errors.
100% Prop-Firm Compliant: Samurai Sun features hard equity stops including Daily Loss Limits, Max Drawdown Percentages, and Daily Profit Targets. It is designed to pass strict proprietary trading firm evaluations.
Tick-Size Normalization: Mathematically flawless execution on Gold (XAUUSD), Crypto, and exotic crosses. The algorithm calculates exact precision values to prevent zero-divide and invalid price errors regardless of the broker's digit structure.
Key Advantages
- Persistent Equity Guard [NEW in v1.40]: Max Drawdown and Daily Profit targets are now saved directly to terminal Global Variables, guaranteeing that your risk parameters survive MT5 crashes or VPS restarts without resetting.
- Execution Quality Monitor [NEW in v1.40]: Actively logs every single trade to a local CSV file, permanently recording requested price, executed price, spread, and slippage points to keep your broker honest.
- Multi-layered Risk Management: Choose from Fixed Lot, Risk Percentage, Anti-Martingale, or Volatility-Adjusted sizing.
- Adaptive Trade Management: Features ATR-based trailing stops, 3-tier step-based profit trailing, and break-even protections.
- Spread and Freeze Level Immunity: Automatically calculates dynamic +150 point safety buffers to protect pending orders during periods of extreme volatility or midnight rollovers.
- Multi-Level Partial Profit Taking: Secure a percentage of your position once a predefined risk-to-reward ratio is achieved, allowing the remainder to trail the trend.
- Integrated Time and News Filters: Automatically pauses trading during specified hours, specific days, or high-impact news events.
- Push & Telegram Alerts [NEW in v1.40]: Fully integrated instant Telegram, Email, and Push notifications for seamless remote monitoring.
Input Parameters
Money Management Settings
- MoneyMode: Choose the lot sizing method (Fixed Lot, Risk Percent, Anti-Martingale, Volatility Adjusted, Martingale).
- FixLot: Fixed lot size (if Fixed Lot mode is selected).
- RiskPercent: Percentage of free margin to risk per trade.
- MaxMartingaleLevels: Maximum consecutive losses before resetting the lot multiplier.
- MartingaleMultiplier: Lot size multiplier after a loss.
- AntiMartingaleConsecutiveWins: Wins required before increasing lot size.
- AntiMartingaleMultiplier: Lot size multiplier after consecutive wins.
Exposure & Prop Firm Risk Limits
- MaxPositionsPerSymbol: Hard limit on open positions.
- MaxTotalExposure: Maximum allowed combined lot size.
- DailyLossLimit / DailyProfitTarget: Hard equity dollar limits for daily trading.
- MaxDrawdownPercent: Global hard stop for total account drawdown.
- EquityTrailTrigger / EquityTrailStep: Trailing equity stops to lock in daily profits.
- AutoResetDrawdownDaily: Automatically resets daily limits at midnight.
- AvoidCorrelatedPairs: Blocks trading on pairs with matching base/profit currencies.
Broker Defenses & Trade Pacing [NEW]
- UsePriceValidator: Validates execution prices against external APIs.
- UseSpoofingDetector: Detects DOM volume spoofing.
- MaxLatencyMs: Maximum ping allowed for trade execution.
- RandomDelayMaxMs: Introduces random micro-delays to hide execution footprint.
- MaxTradesPerDay: Hard limit on daily trade frequency.
- CooldownMinutes: Mandatory wait time after a closed trade.
- LogExecutionQuality: Writes exact slippage and spread data to CSV.
Core Trading Settings
- MagicNumber: Unique identifier for the EA's trades.
- StopLossPips / TakeProfitPips: Initial Stop Loss and Take Profit distances.
- MaxSpreadPips: Maximum allowed spread to open a trade.
Break-Even and Partial Close
- UseBreakEven: Enable or disable break-even protection.
- BreakEvenTriggerPips / BreakEvenLockPips: Profit required to trigger, and pips to lock.
- UsePartialClose: Enable closing a portion of the trade at a specific target.
- TP1_RR: Risk-to-Reward ratio to trigger the partial close.
- TP1_Percent: Percentage of the total lot size to close at the target.
Trailing Stop Settings
- UseATRTrailing: Enable ATR-based dynamic trailing stop.
- TrailingStopATR: Multiplier for the ATR trailing stop distance.
- UseTrailingProfit: Enable the advanced 3-tier step-based profit trailing.
AI Perceptron & MTF Trend Filter Settings
- UseAIFilter: Enable Neural Network pattern recognition validation.
- UseTrendFilter: Enable Multi-Timeframe moving average convergence.
- TrendTF: Timeframe for the trend filter evaluation.
- FastMA / SlowMA: Periods for the fast and slow moving averages.
- TrendMethod: Calculation method (EMA, SMA, etc).
Session, Time, and News Filters
- StartHour / StopHour: Primary trading session hours.
- UseSecondSession: Enable a secondary trading session.
- StartHour2 / StopHour2: Secondary trading session hours.
- TradeMonday / TradeFriday: Enable or disable trading on Mondays and Fridays.
- NewsFilter: Hard filters for Low, Medium, and High impact news events with custom pre/post minute buffers.
Setup Instructions
- Attach the Expert Advisor to a chart (recommended timeframe: H1 or D1).
- Ensure Auto Trading is enabled in the MetaTrader 5 terminal.
- Configure your preferred Money Management settings based on your account size or Prop Firm rules.
- If using the News Filter or External Price Validator, ensure "Allow WebRequest for listed URL" is enabled in terminal settings (Tools -> Options -> Expert Advisors).
- Use the On-Chart Interactive Panel to manage trades globally, close all positions, or execute manual trades synchronized with the EA's risk management engine.
Support is provided exclusively via the MQL5 comments section and the built-in MQL5 messaging system
