Exp_Stochastic_Histogram
This EA trades based on the Stochastic Histogram custom indicator, supporting two signal modes: level-based (overbought/oversold) and crossover-based. It opens buy positions when the stochastic signals bullish momentum and sell positions when bearish momentum is detected, with configurable position closing on opposite signals. Money management is handled via the included TradeAlgorithms library with multiple margin modes.
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 strategy concept is based on momentum signals from the Stochastic Histogram custom indicator. Entry conditions operate in two modes: in Levels mode, buy signals trigger when the histogram column crosses above zone 0 and sell signals trigger when it crosses below zone 2; in Cross mode, buy signals occur when the upper line crosses above the lower line and sell signals on the opposite crossover. Exit conditions are triggered by opposing signals, with BuyPosClose and SellPosClose parameters controlling whether positions are closed on reversal signals. Position sizing defaults to a fixed lot mode (LOT) but also supports multiple money management modes including balance-based and free margin-based allocation. Stop loss is set at 1000 points and take profit at 2000 points, yielding a risk-reward ratio of 1:2. Signal evaluation uses the SignalBar parameter (default bar 1, the last closed bar) which avoids repaint issues from using the current unclosed bar.
Strengths
- Dual-mode signal system (Levels/Cross) provides flexible strategy selection
- Uses closed bar (SignalBar=1) for signal evaluation, avoiding repaint issues
- New bar detection mechanism (IsNewBar) prevents duplicate trades within the same bar
- 1:2 risk-reward ratio is reasonably designed for positive long-term expectancy
- Independent buy/sell switches allow long-only or short-only trading for trend filtering
- Multiple money management modes accommodate different risk preferences
Weaknesses
- Fixed 1000-point SL and 2000-point TP are excessively large without ATR-based volatility adaptation
- Depends on custom Stochastic_Histogram indicator, increasing deployment complexity and failure risk
- No spread filter, which may lead to unfavorable fills in high-spread environments
- No maximum position count limit, potentially causing overtrading in choppy markets
- Static variables lose state on EA restart, potentially missing signals
- Lacks drawdown control and maximum loss limit mechanisms
Possible improvements
- Introduce ATR-based dynamic stop loss and take profit for volatility-adaptive position management
- Add spread filter and maximum position count limit to reduce unfavorable fills and overtrading
- Implement drawdown control and equity curve protection mechanisms such as max drawdown percentage circuit breaker
Risk assessment
Overall risk: Medium
- Fixed large stop loss (1000 points) is excessive for low-volatility instruments and insufficient for high-volatility ones
- No drawdown control mechanism, risking sustained losses during extreme market conditions
- Custom indicator load failure only prints a log and returns INIT_FAILED with no retry/fallback mechanism
- No spread filter, potentially suffering severe slippage during low-liquidity sessions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management parameter controlling lot size |
MMMode | LOT | Position sizing mode (free margin/balance/net free margin/net balance/fixed lot) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum slippage deviation |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long on reverse signal |
SellPosClose | true | Allow closing short on reverse signal |
InpInd_Timeframe | PERIOD_H4 | Indicator calculation timeframe |
TMode | Cross | Signal mode (level/crossover) |
KPeriod | 5 | Stochastic K period |
DPeriod | 3 | Stochastic D period |
Slowing | 3 | Stochastic slowing period |
MA_Method | MODE_SMA | Moving average method |
Price_field | STO_LOWHIGH | Stochastic price field (high-low/close) |
HighLevel | 60 | Overbought level |
LowLevel | 40 | Oversold level |
SignalBar | 1 | Bar index for signal detection |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.