random_trader
This EA opens a single position at a time with a random direction (buy or sell), using either a fixed pip distance or ATR-based stop loss and take profit. It includes a breakeven mechanism and risk-based lot sizing with margin validation, but the core entry logic is purely random with no market analysis.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The EA's strategy concept is purely random entry trading, using MathRand() to generate 0 or 1 to decide buy or sell direction with zero technical analysis or market judgment. Entry conditions depend solely on whether there is no existing position (PositionsTotal()==0), opening a random trade whenever the account is flat. Exit conditions are implemented through stop loss and take profit, where stop loss can be based on fixed pip distance or ATR indicator, and take profit is calculated using the configured reward/risk ratio. Position sizing uses account balance percentage for risk-based lot calculation, adjusts lot size based on margin availability, and supports using maximum available margin when required margin is insufficient. The breakeven mechanism moves stop loss to the entry price after price moves favorably by a specified pip distance. Overall, this is a random trading tool rather than a strategic EA, with expected long-term returns approaching zero minus spread costs being negative.
Strengths
- Comprehensive order validation mechanism including stop level, freeze level, and margin checks
- Risk-based position sizing that dynamically adjusts lot size based on account balance percentage and stop loss distance
- Breakeven mechanism effectively protects existing profits and reduces loss risk
- Clean code structure using class encapsulation for trade validation logic, good maintainability
- ATR-based stop loss mode can adapt to changing market volatility
Weaknesses
- Entry logic is completely random with no market analysis basis, guaranteed long-term loss after spread costs
- Only one position allowed at a time, missing other trading opportunities and unable to hedge
- Pip point calculation is incomplete, not handling non-standard digits values like 0, 1, or 6
- Stop level calculation has hardcoded 10*point extra offset, lacking transparency and configurability
- Breakeven mechanism doesn't account for trading costs (spread and commission), moving to entry price may still result in loss
- The tiket variable is not persisted across EA restarts, potentially losing position tracking
Possible improvements
- Add technical analysis entry signals to replace random entry, such as MA crossover or RSI overbought/oversold, giving the strategy positive expected value
- Move stop loss to entry price plus spread and commission costs in breakeven mechanism to ensure true breakeven
- Complete pip_point calculation for non-standard digits and make the stop level extra offset configurable
- Add spread filter and trading session filter to avoid trading during high spread and low liquidity periods
Risk assessment
Overall risk: Medium
- Random entry without analytical basis, statistically guaranteed long-term loss after spread deduction (negative expected value)
- No new bar check mechanism, may attempt to open positions on every tick potentially at unfavorable moments
- Breakeven mechanism doesn't account for trading costs, may still be in a loss position
- The tiket variable resets on EA restart, potentially causing loss of position management
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
reward_risk_ratio | 2 | Reward-to-risk ratio: TP distance vs SL distance |
loss | PIP | Stop-loss mode: PIP (fixed points) or ATR-based |
loss_atr | 5 | ATR stop-loss multiplier applied to ATR value |
loss_pip | 20 | Fixed stop-loss distance in pips |
risk_percent_per_trade | 1 | Risk percentage per trade, sizes position from balance |
use_breakeven | true | Enable breakeven: moves SL to entry after specified distance |
breakeven_distance | 10 | Breakeven activation distance in pips |
use_max_margin | true | Use maximum available margin to adjust lot size when insufficient |
Similar Unclassified EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.