Williams Trade Modified

Williams Trade Modified trades a normalized measure of where the latest close sits inside its recent high-to-low range. The line runs from 0 to 100:
- values near 100 mean price is closing near the lookback high;
- values near 0 mean price is closing near the lookback low.
The strategy buys when this Williams Trade line moves above a bullish threshold. Optional controls can require a fresh threshold cross and an upward slope. Targets and stops can use fixed distances or recent pivot levels, while an optional session filter limits new entries.
This is a momentum strategy rather than a classic oversold reversal system. It is best suited to liquid markets where closing strength near the top of the recent range can continue.
warning
The protective stop is disabled by default. Williams-line exits are break-even protected and cannot close a losing position.
Williams Trade line
WTM_PERIOD defines the recent range. On every candle, the line compares the close with the highest high and lowest low in that window.
A longer period creates a slower reference and asks price to show strength relative to a broader range. A shorter period responds more quickly but can cross the thresholds frequently.
Buy and sell levels
WTM_BUY_LEVEL defines bullish strength. The default long condition is above 55.
WTM_SELL_LEVEL defines the mirrored bearish condition. The default is below 45.
Keeping a gap between the two levels creates a neutral zone. Reversing or overlapping them can make bullish and bearish classifications less useful.
Cross and slope confirmation
With WTM_REQUIRE_CROSS enabled, the previous reading must be at or below the buy level and the current reading above it. This limits entries to fresh transitions.
When disabled, any current reading above the buy level can qualify while the strategy is flat.
WTM_REQUIRE_SLOPE additionally requires the line to be flat or rising for buys and flat or falling for sell signals. It prevents a still-high but weakening line from qualifying as bullish.
The strategy opens one position at a time and does not average down.
Pivot target and stop
WTM_PIVOT_LOOKBACK defines a recent high, low, and previous close. From these, the strategy calculates a central pivot with R1/R2 resistance and S1/S2 support.
Pivot target
In pip mode, WTM_USE_PIVOT_TARGET selects the nearest R1 or R2 that lies farther than WTM_TARGET_PIPS_MIN and no farther than WTM_TARGET_PIPS_MAX. If neither level fits, WTM_TARGET_PIPS is used.
In percentage mode, the allowed pivot window collapses to the single percentage target distance, so a pivot will normally not qualify. Use pip mode when pivot-target selection matters.
The target is raised when necessary to cover estimated round-trip fees and WTM_MIN_NET_GAIN_PCT.
Pivot stop
When WTM_USE_PIVOT_STOP is enabled, S1 and S2 are compared with the fixed stop distance. The closest valid level below entry becomes the stop.
Enable WTM_USE_PROTECTION to activate that stop. Without protection, pivot and fixed stop calculations do not close a losing position.
Technical exits
Two break-even-aware exits are available:
WTM_EXIT_ON_SELL_SIGNALexits on the complete bearish threshold condition, including any enabled cross and slope requirements.WTM_EXIT_ON_WT_OPPOSITEexits whenever the line falls below the buy level.
The opposite-line exit is broader and normally reacts earlier. For example, a drop from 60 to 50 is below the buy level but still above the sell level, so it can trigger the opposite exit without producing a full sell signal.
Both exits require the position to have reached the fee-aware profitable level.
Session filter
Enable WTM_SESSION_FILTER to permit entries only within WTM_SESSION_WINDOWS.
The windows use HH:MM-HH:MM format and are interpreted with WTM_SESSION_TIMEZONE_OFFSET, an hour offset from UTC. Multiple windows can be comma separated.
Session filtering affects new entries only. Existing positions continue to use targets, stops, and technical exits outside the window.
Good market conditions
Williams Trade Modified generally works best when:
- the pair is liquid with a tight spread;
- price is breaking or holding near the upper part of a meaningful range;
- the Williams Trade line crosses above the buy level with positive slope;
- nearby pivot resistance still leaves a realistic target;
- movement is large enough to cover fees and slippage.
A good setup often follows consolidation and then a close into the upper portion of the range. Requiring a fresh cross helps focus on that transition.
Avoid choppy markets where the line oscillates around 55 and 45, and be careful after an already extended move. A close near the range high shows relative strength, but it does not prove that additional buyers remain.
Creating the strategy
Create a spot strategy and choose Williams Trade Modified as the buy and sell method. The default period is five minutes. Start with backtesting or paper trading.
A practical setup process is:
- Select a liquid pair and verify its pip size.
- Keep the default 120-candle range initially.
- Compare fresh crosses with persistent above-level entries.
- Test slope confirmation separately.
- Use pip mode when evaluating pivot targets.
- Decide whether pivot supports should influence the protective stop.
- Configure session windows only after checking the UTC offset.
- Test ranges, false breakouts, and sustained momentum phases.
Strategy settings
Trading and execution
| Setting | Description |
|---|---|
BUY_ENABLED | Enables new buy orders. |
SELL_ENABLED | Enables target, signal, and protective sell orders. |
PERIOD | Candle period used by the range and pivot calculations; the default is five minutes. |
TRADING_LIMIT | Compatibility fallback only. It is ignored while the strategy-specific trading limit contains a positive value. Configure the strategy-specific setting for normal use. For USDT-BTC, this value is in USDT. |
WTM_TRADING_LIMIT | For USDT-BTC, the amount of USDT used for an entry. |
FUNDS_RESERVE | For USDT-BTC, the amount of USDT the bot must leave unused. |
KEEP_QUOTE | For USDT-BTC, the amount of BTC the strategy must not sell. |
MIN_VOLUME_TO_BUY | General minimum buy value. For USDT-BTC, this value is in USDT. |
MIN_VOLUME_TO_SELL | General minimum sell value. For USDT-BTC, this value is in USDT. |
WTM_MIN_ORDER_VALUE | Strategy-specific minimum entry value. For USDT-BTC, this value is in USDT. |
WTM_MIN_SELL_VALUE | Strategy-specific minimum exit value. For USDT-BTC, this value is in USDT. |
WTM_COOLDOWN_MS | Minimum delay in milliseconds between actions. |
WTM_ENFORCE_COOLDOWN_IN_BACKTEST | Applies the cooldown during backtests as well as live trading. |
WTM_MAX_SPREAD_PCT | Maximum permitted spread as a percentage. |
WTM_MAX_SPREAD_ABSOLUTE | Optional maximum spread in USDT for a pair such as USDT-BTC. 0 disables it. |
WTM_MAX_SPREAD_PIPS | Optional maximum spread in pips. 0 disables it. |
WTM_NEWS_BLOCK | Manually blocks new entries while existing positions remain manageable. |
WTM_NEWS_BLOCK_UNTIL | Blocks entries until the configured time. |
All enabled spread limits must pass.
Williams Trade signal
| Setting | Description |
|---|---|
WTM_PERIOD | Lookback used to normalize the close between the recent low and high. |
WTM_BUY_LEVEL | Upper threshold for bullish momentum. |
WTM_SELL_LEVEL | Lower threshold for bearish momentum. |
WTM_REQUIRE_CROSS | Requires a fresh crossing of the relevant threshold. |
WTM_REQUIRE_SLOPE | Requires the line to move in the signal direction. |
Pivot controls
| Setting | Description |
|---|---|
WTM_PIVOT_LOOKBACK | Recent candles used to calculate pivot support and resistance. |
WTM_USE_PIVOT_TARGET | Uses a qualifying R1/R2 target in pip mode; otherwise falls back to the fixed target. |
WTM_USE_PIVOT_STOP | Allows S1/S2 to compete with the fixed distance as the closest stop below entry. |
Target and protection
| Setting | Description |
|---|---|
GAIN | General gain fallback retained in the configuration. |
WTM_USE_PIPS | Uses pip target and stop distances and enables the practical pivot-target window. |
WTM_PIP_SIZE | Value of one pip. 0 selects 0.01 for JPY pairs and 0.0001 otherwise. For USDT-BTC, this value is in USDT. |
WTM_TARGET_PIPS | Requested fixed target in pip mode. |
WTM_TARGET_PIPS_MIN | Minimum pip target and lower boundary for pivot resistance. |
WTM_TARGET_PIPS_MAX | Maximum pip target and upper boundary for pivot resistance. |
WTM_STOP_PIPS | Fixed stop distance in pip mode. |
WTM_TARGET_PCT | Fixed target percentage when pip mode is disabled. |
WTM_STOP_PCT | Fixed stop distance in percentage mode. |
WTM_MIN_NET_GAIN_PCT | Minimum intended gain beyond estimated round-trip fee break-even. |
WTM_USE_PROTECTION | Activates the selected protective stop. |
Sessions and exits
| Setting | Description |
|---|---|
WTM_SESSION_FILTER | Restricts new entries to the configured windows. |
WTM_SESSION_TIMEZONE_OFFSET | Hour offset from UTC used to interpret session windows. |
WTM_SESSION_WINDOWS | Comma-separated entry windows in HH:MM-HH:MM format. |
WTM_EXIT_ON_SELL_SIGNAL | Enables a profitable exit on the complete bearish Williams signal. |
WTM_EXIT_ON_WT_OPPOSITE | Enables a profitable exit whenever the line falls below the buy threshold. |
Backtesting range
| Setting | Description |
|---|---|
BF_SINCE | Start of the selected backtesting period. |
BF_UNTIL | End of the selected backtesting period. |
DEEP_TESTING | Enables deeper backtesting mode in the editor. |
Practical tuning directions
For a clean breakout-style signal, enable both cross and slope confirmation. For continuation entries during an established strong range position, disable the cross requirement but consider retaining slope.
Lengthening WTM_PERIOD makes the line compare price with a broader range. Shortening it creates faster threshold changes and more sensitivity to recent candles.
Use pip mode when testing pivot targets. Set the min/max window wide enough to include realistic R1 or R2 distances for the selected pair.
The opposite-line exit is intentionally more sensitive than the full sell signal. Test them separately if profitable trades are closing earlier than expected.
Important limitations
- The 0–100 line is not shown in classic negative Williams %R notation.
- A high range position can occur near the end of a move.
- Pivot targets are practically selected only in pip mode.
- Technical exits do not deliberately realize a loss.
- UTC offsets do not automatically apply daylight-saving rules.
- Pip size and spread thresholds are pair-specific.
- Backtests cannot perfectly reproduce live spread, slippage, latency, or liquidity.
Williams Trade Modified works best when strength relative to the recent range represents a genuine breakout or continuation. The cross and slope controls help distinguish that event from a line that is merely still high after momentum has begun to fade.