Orpiment
- Experts
-
Alex Amuyunzu Raymond
I’m an experienced MQL5 developer and software engineer specializing in building robust, high-performance algorithmic trading systems for MetaTrader 5. My work goes beyond standard EA development — I design intelligent, scalable solutions that combine market logic, automation, and external - 버전: 1.0
- 활성화: 5
ORPIMENT: The Gold Scalper That Waits for Confirmation, Then Strikes
Gold punishes impatience. Orpiment is built around one rule: it does not enter on a hunch. It waits for a chain of closed Heiken Ashi candles to confirm direction against the 50 EMA, and only then takes the trade. Fixed risk and the daily protections are in place before the order goes out.
Orpiment is a fully automated MetaTrader 5 Expert Advisor for XAUUSD (Gold). It works on M1 to M15 and is tuned by default for M5.
THE IDEA
Heiken Ashi candles smooth out market noise, and the EMA 50 marks the dynamic trend line. When several closed Heiken Ashi candles stack up on one side of the EMA, momentum is not random. Orpiment trades that alignment.
- Heiken Ashi is calculated inside the EA. No external indicator, no files, no DLLs.
- The EMA period and applied price are adjustable.
- Every decision is made on a newly closed candle. Signals never repaint, so what you see in a backtest is what live trading does.
ENTRY LOGIC
BUY: the last N closed Heiken Ashi candles (default 3) all close above the EMA. With the colour filter on, all of them must also be bullish.
SELL: the mirror image below the EMA.
Extra entry controls:
- The number of confirmation candles is adjustable from 1 to 10.
- A minimum distance filter between the Heiken Ashi close and the EMA skips flat, choppy conditions where price is tangled around the average.
- Only one position per direction at a time, and a configurable cap on total open trades (default 1).
- On netting accounts the EA never opens an opposite trade against an existing position.
EXITS
Stop Loss
- Fixed in points, or ATR-based (default ATR 14 x 1.5), so the stop adapts to current gold volatility.
Take Profit
- Fixed in points, or a Risk:Reward ratio (default 1:1.5).
Break-even
- Once a trade reaches your trigger distance, the stop moves to entry plus a lock-in you choose.
Trailing stop
- Optional, with start distance, trailing distance and step.
Opposite-side exit
- Optional. Closes the trade when a Heiken Ashi candle closes on the other side of the EMA.
All stop modifications respect the broker’s stop level and freeze level, so they are not rejected.
RISK MANAGEMENT
- Lot sizing: fixed lot, or a percentage of balance risked per trade. In risk mode the lot is derived from the actual stop distance and the symbol’s tick value.
- Margin check: the EA checks free margin before sending an order and scales the volume down, or skips the trade, instead of firing a doomed order.
- Max spread filter: gold spreads widen around news and rollover, and entries are skipped above your limit.
- Daily loss limit: counts realized plus floating loss and stops the EA for the rest of the day when the limit is hit. You can optionally close open trades at that point.
- Daily trade limit: caps how many trades are opened per day.
- Slippage control: maximum deviation in points.
TRADING FILTERS
- Session filter: start and end time in server time, including overnight windows. Keep Orpiment out of rollover and thin liquidity.
- Friday cut-off: stop opening new trades after a set time on Fridays.
- Every skipped signal is logged with the reason.
THE ORPIMENT DASHBOARD
A dark, gold-accented panel on the chart that shows what the EA is doing at any moment:
- Status pill: SCANNING, IN TRADE, OFF SESSION, SPREAD HIGH, FRIDAY STOP, TRADE LIMIT, DAILY LIMIT or ALGO OFF.
- Market card: symbol and timeframe, live spread against your limit, the EMA value, and a strip of the last N Heiken Ashi candles coloured green or red against the EMA.
- Signal card: BUY SETUP, SELL SETUP or NO SETUP for the last closed bar, plus four filter lights (Session, Spread, Daily, Friday).
- Account card: balance, equity, today’s P/L, trades taken against your daily cap, and a daily loss bar that turns amber and red as you approach the limit.
- Position card: the open trade with direction, volume, entry, floating P/L, stop loss and take profit.
- A collapse button, plus position and scale inputs, so it fits any screen.
The dashboard is switched off automatically during non-visual backtests and optimizations, so testing stays fast.
EXECUTION QUALITY
- Built on the standard CTrade class, with the filling mode detected from the symbol.
- Automatic retries on requotes, price changes, timeouts and connection errors, with a configurable delay.
- Invalid-stops errors are handled by widening and retrying.
- Volume is normalized to the broker’s step, minimum and maximum.
- Works with broker suffixes (XAUUSDm, XAUUSD.pro and so on) and 3-digit or 2-digit gold pricing.
- A magic number tags every trade, so Orpiment manages only its own orders.
- Entries, exits, skips and errors are logged in the Experts tab.
RECOMMENDED SETUP
- Symbol: XAUUSD
- Timeframe: M5 (M1 to M15 supported)
- Account: ECN or low-spread, hedging or netting
- Test first on a demo account for at least two weeks, and backtest with “Every tick based on real ticks”.
- Check your broker’s server time and adjust the session and Friday times to match.
KEY INPUTS
Timeframe, EMA period and price, confirmation candles, colour filter, minimum distance, SL mode (fixed or ATR), TP mode (fixed or risk:reward), break-even, trailing, lot mode and size, risk %, max trades, max spread, daily loss %, daily trades, session and Friday times, slippage, magic number, trade comment, and the dashboard options.
IMPORTANT
Trading leveraged instruments such as gold carries a high level of risk and can result in the loss of your deposit. No Expert Advisor can guarantee profit. Past performance, backtests included, does not guarantee future results. Always test on a demo account and risk only what you can afford to lose.
Support is handled through the seller profile: https://www.mql5.com/en/users/yunzuhalex/seller
