Hard Targets
With the live reversal trigger, SL/TP are always fixed distances (pips × PIP_SIZE) sent to
mt5-trader as stop_loss_distance / take_profit_distance. RSI produces no price level, so
there is no indicator-derived stop to fall back on.
| Profile | STOP_LOSS_PIPS | TAKE_PROFIT_PIPS |
|---|---|---|
| Forex | 40 | 50 |
| Deriv | 50 | 80 |
USE_HARD_TARGETS must stay true. The service refuses to start with
USE_HARD_TARGETS=false (startup validation). RISK_REWARD is inert.
Absolute Supertrend-line stops only apply if you switch the unused Supertrend strategy back on in code. The shipped service never does that.
Why distances matter
This service evaluates on a bar close, and MT5 bars are bid-based, while a market buy fills at the ask. Anchoring absolute levels here would add the spread to every long’s risk and subtract it from the reward.
Sending distances lets mt5-trader measure from the price the order actually fills at, which also
removes the error from price drift during POLL_INTERVAL_SECONDS.
PIP_SIZE must be set explicitly
Every pip-denominated setting (STOP_LOSS_PIPS, TAKE_PROFIT_PIPS, MFE_BREAK_EVEN_PIPS) is
multiplied by PIP_SIZE. It is deliberately not derived from PRICE_DIGITS.
Always set PIP_SIZE explicitly. Leaving it unset falls back to the legacy
10^-(PRICE_DIGITS-1) derivation for backward compatibility only. A wrong PIP_SIZE
silently produces stops that are an order of magnitude off.
| Instrument | PIP_SIZE | PRICE_DIGITS |
|---|---|---|
| EURUSD | 0.0001 | 5 |
| XAUUSD | 0.10 | 2 |
| BTCUSD | 1.0 | 2 |
| Volatility 75 Index | 0.01 | 2 |
On the forex profile, BTCUSD uses the same 40/50 pip distances as XAUUSD. Matching
gold’s $40 dollar risk would require $2 risk) so orders
fit alongside XAUUSD; raise only when free margin allows. Volumes above mt5-trader
1.00 BTC lot (full-coin notional), which a
10K account typically cannot margin. Shipped volume is 0.05 (MAXIMUM_VOLUME are rejected with volume_cap_exceeded (HTTP 422).
The Deriv profile deliberately keeps a wider 50/80 stop and target. At PIP_SIZE=0.01, a
40-pip stop is a 0.40 price distance on Volatility 75 — well inside that symbol’s
trade_stops_level — and mt5-trader rejects it with stop_loss_too_close.
To re-calibrate for another instrument or platform:
PIP_SIZE = price_move / reported_pipsPRICE_DIGITS describes the feed you execute on — read it from mt5-trader’s
GET /v1/market-data/tick rather than from a TradingView quote.
Related settings
| Variable | Purpose |
|---|---|
USE_HARD_TARGETS | Must be true for the live reversal trigger |
STOP_LOSS_PIPS / TAKE_PROFIT_PIPS | Pip distances (overridable per instrument in SYMBOLS_FILE) |
PIP_SIZE | Price per pip (overridable per instrument as pip_size) |
PRICE_DIGITS | Quote precision on the execution feed |
MFE_BREAK_EVEN_PIPS | Also scaled by PIP_SIZE — see Break-even |