Skip to main content

Williams Trade Modified

Williams Trade Modified strategy behavior

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_SIGNAL exits on the complete bearish threshold condition, including any enabled cross and slope requirements.
  • WTM_EXIT_ON_WT_OPPOSITE exits 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:

  1. Select a liquid pair and verify its pip size.
  2. Keep the default 120-candle range initially.
  3. Compare fresh crosses with persistent above-level entries.
  4. Test slope confirmation separately.
  5. Use pip mode when evaluating pivot targets.
  6. Decide whether pivot supports should influence the protective stop.
  7. Configure session windows only after checking the UTC offset.
  8. Test ranges, false breakouts, and sustained momentum phases.

Strategy settings

Trading and execution

SettingDescription
BUY_ENABLEDEnables new buy orders.
SELL_ENABLEDEnables target, signal, and protective sell orders.
PERIODCandle period used by the range and pivot calculations; the default is five minutes.
TRADING_LIMITCompatibility 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_LIMITFor USDT-BTC, the amount of USDT used for an entry.
FUNDS_RESERVEFor USDT-BTC, the amount of USDT the bot must leave unused.
KEEP_QUOTEFor USDT-BTC, the amount of BTC the strategy must not sell.
MIN_VOLUME_TO_BUYGeneral minimum buy value. For USDT-BTC, this value is in USDT.
MIN_VOLUME_TO_SELLGeneral minimum sell value. For USDT-BTC, this value is in USDT.
WTM_MIN_ORDER_VALUEStrategy-specific minimum entry value. For USDT-BTC, this value is in USDT.
WTM_MIN_SELL_VALUEStrategy-specific minimum exit value. For USDT-BTC, this value is in USDT.
WTM_COOLDOWN_MSMinimum delay in milliseconds between actions.
WTM_ENFORCE_COOLDOWN_IN_BACKTESTApplies the cooldown during backtests as well as live trading.
WTM_MAX_SPREAD_PCTMaximum permitted spread as a percentage.
WTM_MAX_SPREAD_ABSOLUTEOptional maximum spread in USDT for a pair such as USDT-BTC. 0 disables it.
WTM_MAX_SPREAD_PIPSOptional maximum spread in pips. 0 disables it.
WTM_NEWS_BLOCKManually blocks new entries while existing positions remain manageable.
WTM_NEWS_BLOCK_UNTILBlocks entries until the configured time.

All enabled spread limits must pass.

Williams Trade signal

SettingDescription
WTM_PERIODLookback used to normalize the close between the recent low and high.
WTM_BUY_LEVELUpper threshold for bullish momentum.
WTM_SELL_LEVELLower threshold for bearish momentum.
WTM_REQUIRE_CROSSRequires a fresh crossing of the relevant threshold.
WTM_REQUIRE_SLOPERequires the line to move in the signal direction.

Pivot controls

SettingDescription
WTM_PIVOT_LOOKBACKRecent candles used to calculate pivot support and resistance.
WTM_USE_PIVOT_TARGETUses a qualifying R1/R2 target in pip mode; otherwise falls back to the fixed target.
WTM_USE_PIVOT_STOPAllows S1/S2 to compete with the fixed distance as the closest stop below entry.

Target and protection

SettingDescription
GAINGeneral gain fallback retained in the configuration.
WTM_USE_PIPSUses pip target and stop distances and enables the practical pivot-target window.
WTM_PIP_SIZEValue of one pip. 0 selects 0.01 for JPY pairs and 0.0001 otherwise. For USDT-BTC, this value is in USDT.
WTM_TARGET_PIPSRequested fixed target in pip mode.
WTM_TARGET_PIPS_MINMinimum pip target and lower boundary for pivot resistance.
WTM_TARGET_PIPS_MAXMaximum pip target and upper boundary for pivot resistance.
WTM_STOP_PIPSFixed stop distance in pip mode.
WTM_TARGET_PCTFixed target percentage when pip mode is disabled.
WTM_STOP_PCTFixed stop distance in percentage mode.
WTM_MIN_NET_GAIN_PCTMinimum intended gain beyond estimated round-trip fee break-even.
WTM_USE_PROTECTIONActivates the selected protective stop.

Sessions and exits

SettingDescription
WTM_SESSION_FILTERRestricts new entries to the configured windows.
WTM_SESSION_TIMEZONE_OFFSETHour offset from UTC used to interpret session windows.
WTM_SESSION_WINDOWSComma-separated entry windows in HH:MM-HH:MM format.
WTM_EXIT_ON_SELL_SIGNALEnables a profitable exit on the complete bearish Williams signal.
WTM_EXIT_ON_WT_OPPOSITEEnables a profitable exit whenever the line falls below the buy threshold.

Backtesting range

SettingDescription
BF_SINCEStart of the selected backtesting period.
BF_UNTILEnd of the selected backtesting period.
DEEP_TESTINGEnables 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.