DojiTrader
DojiTrader is an Expert Advisor that identifies Doji candlestick patterns to generate trade signals. It enters positions when a Doji pattern forms at potential reversal zones, suggesting market indecision and impending direction change. The EA automates trade execution based on this single candlestick pattern with configurable parameters for pattern detection and risk management.
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.27% | -0.24% | 3.79% | 110 | 48.60% | -0.05 | -0.07 | 4 | +$0.06 | Reliable |
| GBPUSD | +6.63% | +5.74% | 3.89% | 108 | 51.90% | 1.18 | 1.70 | 8 | +$6.14 | Reliable |
| USDJPY | +2.04% | +1.77% | 4.48% | 101 | 49.50% | 0.44 | 0.46 | 6 | +$2.02 | Reliable |
| XAUUSD | +1.98% | +1.63% | 52.23% | 105 | 50.00% | 0.38 | 0.04 | 7 | +$4.28 | Reliable |
Profitable on 3 of 4 markets with reliable results.
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.
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +2.68% 2026-04 | -1.11% 2026-01 |
| GBPUSD | 69% | +2.68% 2026-04 | -2.56% 2026-10 |
| USDJPY | 46% | +2.95% 2026-04 | -1.91% 2026-03 |
| XAUUSD | 62% | +29.82% 2026-02 | -29.62% 2026-08 |
From the backtest equity curve, sampled about every two days; only reliable results.
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 core concept of DojiTrader strategy is to identify market indecision through the Doji candlestick pattern, which typically appears at key reversal or continuation points. Entry conditions involve detecting a standard Doji pattern where the open and close prices are nearly equal with relatively long upper and lower shadows, potentially filtered by trend context or support/resistance levels. Exit conditions typically include fixed take-profit and stop-loss levels, or closing positions when a reverse signal appears. Position sizing may offer fixed lot sizes or account-balance-proportional calculation methods. Money management relies on configurable stop-loss settings to control per-trade risk, but relying purely on a single candlestick pattern can generate numerous false signals in choppy markets, requiring additional trend filtering mechanisms to improve win rates.
Strengths
- The Doji is a classic reversal signal pattern with solid technical analysis theory backing
- The strategy logic is simple and intuitive, easy to understand and debug, suitable for beginners learning candlestick pattern trading
- Configurable pattern recognition parameters allow users to adjust Doji detection criteria for different instruments
Weaknesses
- A single candlestick pattern strategy easily generates many false signals in choppy markets, potentially resulting in a low win rate
- Lacks multi-timeframe confirmation and trend filtering mechanisms, making it susceptible to false reversal signals in strong trends
- Does not account for market volatility changes; using the same parameters in low and high volatility environments may lead to inconsistent performance
Possible improvements
- Add trend filtering indicators (such as EMA or ADX) to only trade Doji signals in the trend direction, reducing false signals
- Incorporate multi-timeframe analysis, confirming trend direction on higher timeframes before seeking Doji entry opportunities on intermediate timeframes
Risk assessment
Overall risk: Medium
- Single candlestick pattern lacks confirmation mechanism; consecutive false signals may lead to consecutive losses
- If stop-loss is set too tight, short-term volatility after Doji formation may frequently trigger stops
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Total profit target in points |
DojiMaxBody | 5 | Maximum doji body size in points |
MinShadowRatio | 2.0 | Minimum shadow-to-body ratio |
MagicNumber | 12345 | EA unique identifier |
MaxSlippage | 3 | Maximum allowed slippage |
Similar Candlestick Pattern EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.