- Reversal
- Own panel
- Intermediate
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.
The rules
HIGHER marker
%K crosses above %D on a candle where %J is below 20.
LOWER marker
%K crosses below %D on a candle where %J is above 80.
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
Orange is %K, green is %D and purple is %J in a separate panel with levels at 20 and 80. A green HIGHER triangle at the bottom of the panel marks %K crossing above %D with %J below 20; a red LOWER triangle at the top marks %K crossing below %D with %J above 80.
Indicators used
- KDJ (9, 3, 3)
Same view with built-in indicators: Add KDJ (9, 3, 3) with levels 20 and 80 from the IQ Option indicator list.
Default settings
| Stochastic period | 9 |
|---|---|
| K smoothing | 3 |
| D period | 3 |
| Low level (J) | 20 |
| High level (J) | 80 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- KDJ is a stochastic oscillator with a third, faster line called J.
- K is the smoothed stochastic, D is its average, and J exaggerates the gap between them.
- When J is below 20 or above 80, the market is stretched in that direction.
- We wait for K to cross D: above it with J below 20 is HIGHER, below it with J above 80 is LOWER.
- The markers sit in the indicator panel and confirm on a completed candle.
- Use a Practice balance to see how it behaves in trending versus sideways markets.
Limitations. The J line can stay beyond 20 or 80 for a long time in a strong trend, so a K/D cross there may be an early or a short-lived turn. The settings here are the official 9, 3 and 3; shorter periods give more markers and more noise. Test on the Practice balance before risking real funds.
Install it in four steps
- Download and inspectDownload one .lua file and open it in a plain-text editor if you want to read it first. If you downloaded the ZIP, extract it.
- Open Chart Analysis → ScriptsIn the IQ Option traderoom, choose the Practice balance, open the chart analysis panel, select Scripts and choose Import script.
- Save and add to chartSelect the downloaded file, review the imported code, choose Save, then use the + control to add it to the chart.
- Change one input at a timeConfirm the default view first. Then adjust periods, levels or colours one setting at a time and note what changes.
Complete source code
The download and this preview resolve to the same reviewed file. SHA-256: 2f2fbb11f380cd9135e88d2ef7441f52b990fc2b5dc61ae78a9b38eab242b730
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW KDJ Cross v1.0.0
--
-- KDJ extends the stochastic oscillator: K is the smoothed stochastic, D is
-- its moving average and J = 3K - 2D reacts faster than both. A K/D cross
-- with J already stretched marks a possible turn. Formula follows the
-- official IQ Option KDJ indicator. Drawn in its own panel.
--
-- HIGHER: K crosses above D while J is below 20.
-- LOWER: K crosses below D while J is above 80.
--
-- 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 KDJ Cross",
short_name = "IQOW KDJ",
overlay = false
}
input_group {
"1. KDJ settings",
k_period = input (9, "Stochastic period", input.integer, 2, 100),
k_smooth = input (3, "K smoothing", input.integer, 1, 50),
d_period = input (3, "D period", input.integer, 1, 50)
}
input_group {
"2. Levels",
low_level = input (20, "Low level (J)", input.double, 0, 45, 1, false),
high_level = input (80, "High level (J)", input.double, 55, 100, 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",
k_color = input { default = "#FF7700", type = input.color },
d_color = input { default = "#25E154", type = input.color },
j_color = input { default = "#B42EFF", type = input.color },
level_low_color = input { default = rgba(255, 108, 88, 0.5), type = input.color },
level_high_color = input { default = rgba(37, 225, 84, 0.5), 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 }
}
-- KDJ: K = smoothed stochastic (0-100), D = SMA of K, J = 3K - 2D.
k_line = sma (stochastic (close, k_period), k_smooth) * 100
d_line = sma (k_line, d_period)
j_line = 3 * k_line - 2 * d_line
-- Current-bar scalars for the Lua rule logic.
local k_now = get_value (k_line, nil)
local k_before = get_value (k_line [1], nil)
local d_now = get_value (d_line, nil)
local d_before = get_value (d_line [1], nil)
local j_now = get_value (j_line, nil)
local data_is_ready =
low_level < high_level and
k_now ~= nil and
k_before ~= nil and
d_now ~= nil and
d_before ~= nil and
j_now ~= nil and
get_value (d_line [k_period + k_smooth], nil) ~= nil
-- Event: K crosses D on this candle while J is stretched.
higher_setup = conditional (
data_is_ready and k_before <= d_before and k_now > d_now and j_now < low_level
)
lower_setup = conditional (
data_is_ready and k_before >= d_before and k_now < d_now and j_now > high_level
)
-- 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)
)
hline { value = high_level, color = level_high_color, width = 1 }
hline { value = low_level, color = level_low_color, width = 1 }
if lines_visible then
plot (k_line, "%K", k_color, line_width)
plot (d_line, "%D", d_color, line_width)
plot (j_line, "%J", j_color, line_width)
end
if signals_visible then
plot_shape (
confirmed_higher,
"KDJ HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.bottom,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"KDJ LOWER",
shape_style.triangledown,
shape_size.small,
lower_color,
shape_location.top,
-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
- Beginner
Bollinger RSI Reversal
Marks the first candle that closes back inside the Bollinger Bands after a close outside a band with RSI in its oversold or overbought zone. The bands show how stretched price is and RSI adds a second view of the same stretch.
Indicators: Bollinger Bands (20, 2) · RSI (14, 30/70)
- Reversal
- Own panel
- Beginner
DeMarker 30 70 Cross
Marks the candle where DeMarker closes back out of its oversold or overbought zone. The 30 and 70 levels are the ones used in the related guide.
Indicators: DeMarker (14, levels 30/70)
- Reversal
- On price
- Beginner
Donchian RSI Reversal
Marks the moment RSI leaves its oversold or overbought zone after price touched the matching Donchian band in the same excursion. The channel shows where price is stretched; RSI shows when momentum starts to turn.
Indicators: Donchian Channel (20) · RSI (14, 30/70)
Download all 56 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.