LiquidityZones
LiquidityZones is a built-in TypeScript strategy from @tradejs/strategies.
It builds liquidity zones from swing highs/lows, waits for retests, and trades reactions from those zones.
Entry Logic
- Builds active liquidity zones from pivots.
- Skips until a zone retest signal appears.
- Selects
LONGorSHORTside config from signal direction. - Builds a stop buffer from zone height and
LIQUIDITY_ZONES_STOP_BUFFER_PCT. - Places stop outside the retested zone.
- Computes target from
LIQUIDITY_ZONES_TARGET_R_MULT. - Sizes quantity from
MAX_LOSS_VALUE / riskDistance, withFEE_PERCENTbuffer. - Returns
entrywith zone figures andliquidityZonesContext.
Entry codes:
LIQUIDITY_ZONES_BULLISH_RETESTLIQUIDITY_ZONES_BEARISH_RETEST
Exits
When a position exists:
LIQUIDITY_ZONES_OPPOSITE_RETEST_EXITwhenLIQUIDITY_ZONES_EXIT_ON_OPPOSITE_RETEST=trueand the opposite retest appears.- otherwise
POSITION_EXISTS.
Config Parameters
Zone model:
LIQUIDITY_ZONES_PIVOT_LOOKBACKLIQUIDITY_ZONES_SWING_AREA_MODE(wick_extremityorfull_range)LIQUIDITY_ZONES_FILTER_MODE(countorvolume)LIQUIDITY_ZONES_MIN_FILTER_VALUELIQUIDITY_ZONES_SHOW_SWING_HIGH_ZONESLIQUIDITY_ZONES_SHOW_SWING_LOW_ZONESLIQUIDITY_ZONES_MAX_AGELIQUIDITY_ZONES_REACTION_CLOSE_BEYOND_ZONELIQUIDITY_ZONES_REQUIRE_REACTION_BODYLIQUIDITY_ZONES_MAX_RETEST_PENETRATION_PCTLIQUIDITY_ZONES_STOP_ZONE_BUFFER_MULTLIQUIDITY_ZONES_STOP_BUFFER_PCTLIQUIDITY_ZONES_TARGET_R_MULTLIQUIDITY_ZONES_EXIT_ON_OPPOSITE_RETESTLIQUIDITY_ZONES_MAX_FIGURE_ZONES
Shared groups:
- runtime:
ENV,INTERVAL,MAKE_ORDERS,BACKTEST_PRICE_MODE - AI/ML:
AI_ENABLED,AI_MODE,MIN_AI_QUALITY,ML_ENABLED,ML_THRESHOLD - risk:
FEE_PERCENT,MAX_LOSS_VALUE,LONG.*,SHORT.* - shared indicators: MA, OBV, ATR, BB, MACD fields
Signal Payload
The strategy stores:
additionalIndicators.liquidityZonesContext- zone figures from
buildLiquidityZonesFigures(...) - stop outside the retested zone
- one take-profit at the computed target
Common Skip Reasons
NO_LIQUIDITY_ZONE_RETESTPOSITION_EXISTSDEV_TRADE_COOLDOWNSTRATEGY_DISABLEDINVALID_STOPINVALID_QTYRISK_RATIO:<value>
Validation Notes
Compare wick_extremity vs full_range carefully. Zone width, provider wick quality, and retest penetration settings can change signal frequency.