iqow-clv-atr-imbalance-fade.lua 4 KB · Free, MIT license
For the IQ Option web traderoom. Quadcode does not draw HIGHER and LOWER markers on mobile.
Add it to IQ Option in 3 steps
- Get the file. Press Get the script. Your browser saves a .lua file.
- Import it in IQ Option. Open the web traderoom on the Practice balance. Click the wave icon at the bottom left of the chart, open the Scripts tab, press Import script and pick the file.
- Add it to the chart. The code opens in an editor. Click the plus button under it (Add to chart). Save is only needed after you edit the code.
Full illustrated guide, with screenshots →
Risk. Trading can lose money. A marker is a chart observation, not a prediction, and this script is checked on test data, not proven in live trading. Try it on the Practice balance first.
- Reversal
- On price
- Advanced
Measures cumulative buying or selling pressure over four candles using ATR-normalized Close Location Value, fading one-sided bursts that push at least 1.2 ATR(14) away from EMA(20).
The rules
HIGHER marker
The 4-bar sum of ATR-normalized CLV drops to -2.2 or below while the close is at least 1.2 ATR(14) below EMA(20), and the prior candle did not trigger.
LOWER marker
The 4-bar sum of ATR-normalized CLV rises to +2.2 or above while the close is at least 1.2 ATR(14) above EMA(20), and the prior candle did not trigger.
A marker appears after the next candle opens and is drawn on the candle that completed the setup. It is a chart observation, not an instruction to trade.
How to read it
The cyan midline shows EMA(20) and the purple guides sit 1.2 ATR(14) on either side. A green HIGHER triangle marks a four-candle cluster where candles repeatedly closed near their lows on expanding ranges below the lower guide. A red LOWER triangle marks mirrored repeated highs-closing imbalance above the upper guide.
Indicators used
- Close Location Value (CLV) weighted by bar range / ATR(14)
- EMA (20) with ATR (14) stretch bands
Same view with built-in indicators: Plot EMA (20) and ATR (14) on a 5m crypto chart to judge candle stretch, while checking whether the last four bars all closed near their high or low extremes.
Default settings
| Flow accumulation window | 4 |
|---|---|
| Cumulative CLV-ATR threshold | 2.2 |
| Minimum EMA(20) stretch in ATR | 1.2 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- Uses Close Location Value scaled by candle range over ATR(14) so strong directional closes weigh more than dojis.
- Accumulates that imbalance across four candles rather than reacting to a single outlier candle.
- Across 26 unseen windows (2020-2026) on Binance 5m IQOW10 crypto pairs, it recorded 55.44% fixed and 56.16% walk-forward.
- Sensitivity to payout is clear: 85% payout yields +0.0252 EV, whereas 80% payout turns slightly negative (-0.0020).
What the research found
The evidence behind this script
Tested on Binance 5m IQOW10 crypto spot data (2020-2026, 26 unseen walk-forward windows plus 2019-2026 holdout) at a 30-minute expiry. Break-even at 85% payout is 54.05%.
- 5m/30m · 26 windows
- 55.44%
- Walk-forward 26W
- 56.16%
- Unseen 2019-2026 all
- 55.57%
- Overlap vs 5m Top 2
- 56.57%
Fixed params across 26 unseen windows (2020-2026): n=254,560 trades, Wilson low95 55.25%, 19 of 26 windows above 54.05%.
Rolling out-of-sample selection: n=138,862 trades, low95 55.90%, 23 of 26 windows above break-even.
n=275,586 trades (low95 55.39%); 2024 (54.03%) and 2025 (53.47%) lagged before 2026 recovered (55.31% pre-Aug, 55.94% Aug-Oct).
Non-overlapping trades vs #1 Big Body Fade and #2 Z-Score Fade (max Jaccard 0.100); 9 of 10 coins cleared 54.05% (TRXUSDT 51.69%).
Evaluated on Binance 5m spot crypto candles (30m expiry), distinct from the 1m/2m IQOW Ten leaderboard (#1 Big Body Fade, #2 Z-Score Fade). Low 80% payouts produce negative expected value; use 85%+ crypto pairs and Practice balance first.
Limitations. Evaluated on Binance 5m spot crypto data (IQOW10 basket, 30m expiry), separate from the 1m/2m IQOW Ten leaderboard (#1 Big Body Fade, #2 Z-Score Fade). 9 of 10 coins cleared 54.05% (TRXUSDT 51.69%), while 2024 (54.03%) and 2025 (53.47%) trailed break-even. At 80% payout fixed EV is -0.0020, needing 85%+ payouts. Internal research only; does not guarantee outcomes. Test on the Practice balance before risking real funds.
Complete source code
The download and this preview resolve to the same reviewed file. SHA-256: 13dc580045d9738cb2250b5470dfaafbf378542f9596c8069fb8dcf0049f8b56
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW CLV ATR Imbalance Fade v1.0.0
--
-- Accumulates Close Location Value weighted by ATR-normalized candle range
-- over a rolling window, flagging saturated one-sided buying or selling
-- pressure when price is stretched away from EMA(20).
--
-- HIGHER: Cumulative CLV flow(4) <= -2.2 while close <= EMA(20) - 1.2 ATR(14).
-- LOWER: Cumulative CLV flow(4) >= +2.2 while close >= EMA(20) + 1.2 ATR(14).
--
-- Markers use the previous completed candle: they appear after the next candle
-- opens and are shifted back one bar onto the candle that qualified.
-- Educational chart tool only. It does not place trades, choose an expiry,
-- predict outcomes, or guarantee results. Test on a Practice balance first.
instrument {
name = "IQOW CLV ATR Imbalance Fade",
short_name = "IQOW CLVFADE",
overlay = true
}
input_group {
"1. CLV imbalance settings",
flow_window = input (4, "Flow accumulation window", input.integer, 2, 20),
flow_threshold = input (2.2, "Cumulative CLV-ATR threshold", input.double, 0.5, 10, 0.1, false),
min_stretch_atr = input (1.2, "Minimum EMA(20) stretch in ATR", input.double, 0.1, 5, 0.1, false)
}
input_group {
"Display and advice",
lines_visible = input { default = true, type = input.plot_visibility },
signals_visible = input { default = true, type = input.plot_visibility },
advice_enabled = input { default = false, name = "Enable platform advice", type = input.boolean }
}
input_group {
"Colors",
guide_color = input { default = "#56CEFF", type = input.color },
band_color = input { default = "#9B59B6", type = input.color },
line_width = input { default = 1, type = input.line_width },
higher_color = input { default = "#25E154", type = input.color },
lower_color = input { default = "#FF6C58", type = input.color },
signal_text_color = input { default = "#FFFFFF", type = input.color }
}
atr14 = rma (tr, 14)
rng = high - low
clv = iff (rng > 1e-10, ((close - low) - (high - close)) / max (rng, 1e-10), 0)
flow = clv * rng / max (atr14, 1e-10)
cum_flow = sum (flow, flow_window)
mid_guide = ema (close, 20)
upper_guide = mid_guide + min_stretch_atr * atr14
lower_guide = mid_guide - min_stretch_atr * atr14
local c_now = get_value (close, nil)
local cf_now = get_value (cum_flow, nil)
local a_now = get_value (atr14, nil)
local e_now = get_value (mid_guide, nil)
local data_is_ready =
c_now ~= nil and cf_now ~= nil and a_now ~= nil and a_now > 0 and e_now ~= nil
local stretch = data_is_ready and ((c_now - e_now) / a_now) or 0
local raw_higher = data_is_ready and cf_now <= -flow_threshold and stretch <= -min_stretch_atr
local raw_lower = data_is_ready and cf_now >= flow_threshold and stretch >= min_stretch_atr
higher_setup = conditional (raw_higher and not raw_lower)
lower_setup = conditional (raw_lower and not raw_higher)
-- Confirm only a new setup on the previous completed candle.
confirmed_higher = conditional (
get_value (higher_setup [1], false) and
not get_value (higher_setup [2], false)
)
confirmed_lower = conditional (
get_value (lower_setup [1], false) and
not get_value (lower_setup [2], false)
)
if lines_visible then
plot (upper_guide, "Upper guide", band_color, line_width)
plot (lower_guide, "Lower guide", band_color, line_width)
plot (mid_guide, "Baseline", guide_color, line_width)
end
if signals_visible then
plot_shape (
confirmed_higher,
"CLVFADE HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"CLVFADE LOWER",
shape_style.triangledown,
shape_size.small,
lower_color,
shape_location.abovebar,
-1,
"LOWER",
signal_text_color
)
end
-- QCS advice is a platform notification state only; it does not place trades.
if advice_enabled and
get_value (confirmed_higher, false) and
not get_value (confirmed_lower, false) then
advise (advice.buy)
elseif advice_enabled and
get_value (confirmed_lower, false) and
not get_value (confirmed_higher, false) then
advise (advice.sell)
else
advise (advice.neutral)
end
More reversal scripts
- Reversal
- On price
- Advanced
Jump Fade
Marks the first 1-minute candle whose single-candle move is an extreme outlier against the last 120 returns, expecting a short snap back. The researched setting also needs Supertrend(10, 3) to disagree with the fade.
Indicators: 1-candle log return z-score (120) · Supertrend (10, 3), required to disagree
- Reversal
- Own panel
- Intermediate
KDJ Cross
Marks K/D crosses that happen while the faster J line is already stretched below 20 or above 80. J reaches the extremes first, so the cross after it is used as the timing event.
Indicators: KDJ (9, 3, 3)
- Reversal
- On price
- Intermediate
Keltner Extreme Close Fade
Fades extreme 5-minute candle closes that pierce both a Keltner Channel(20, 2.0) and the prior 20-bar Donchian high or low while stretched at least 1.5 ATR(14) away from SMA(20).
Indicators: Keltner Channel (EMA of HLC3, RMA/ATR 20, mult 2.0) · Donchian Channel (20-bar lookback) · SMA (20) and ATR (14) stretch filter
Download all 84 scripts as one ZIP · MIT License, provided “as is”, without warranty. IQOptionWiki is independent of the IQ Option platform operator. Nothing here is investment advice or a guarantee of results.