iqow-three-oscillators-markers.lua 7 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
- Marker companion
- On price
- Intermediate
Draws the HIGHER and LOWER markers of the Three Oscillators script on the price chart, above and below the candles, so they show on every asset, JPY pairs included. No lines: add Three Oscillators as well for the lines that count the crossings.
This is the price-chart companion of Three Oscillators. It draws no lines, only the same HIGHER and LOWER markers, above and below the candles, so they show on every asset, JPY pairs included. Load both scripts and keep their settings equal.
The rules
HIGHER marker
At least 2 of 3 cross upward within the last 3 candles: RSI(14) above 30, CCI(20) above -100, Williams %R(14) above -80.
LOWER marker
At least 2 of 3 cross downward within the last 3 candles: RSI(14) below 70, CCI(20) below +100, Williams %R(14) below -20.
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
Markers only, on the price chart: a green HIGHER triangle below a candle and a red LOWER triangle above it, each on the candle that completed the setup of Three Oscillators. A marker appears after the next candle opens and does not move. The script draws no line, so add Three Oscillators (it opens in its own panel) to see the lines that count the crossings. Both scripts use the same settings.
Indicators used
- RSI (14, 30/70)
- CCI (20, +/-100)
- Williams %R (14, -80/-20)
Same view with built-in indicators: Add RSI (14, levels 30/70), CCI (20, levels -100/+100) and Williams %R (14, levels -80/-20) in three panels under the price chart.
Default settings
| RSI period | 14 |
|---|---|
| CCI period | 20 |
| Williams %R period | 14 |
| Oscillators that must cross | 2 |
| Window (candles) | 3 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- This is the price-chart companion of Three Oscillators: the same rule, the same settings and the same HIGHER and LOWER markers.
- A script in its own panel draws its markers at the candle's price on the panel's axis, so on JPY pairs and other assets priced above about 100 they fall outside the panel.
- The companion draws them above and below the candles instead, so they show on every asset.
- Each marker sits on the candle that completed the setup and appears after the next candle opens; it does not move or disappear.
- It draws no lines: add Three Oscillators to see the lines that count the crossings in its own panel.
- Test both on a Practice balance first.
Limitations. Same setup and same limits as Three Oscillators: the markers describe the rule, not what the next candle will do. It draws no lines, so load the panel script to see why a marker appeared. Import both on the Practice balance and keep their settings equal. 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: 7813f661ca60ecf0bca39286d02ba55e3b5a293b8a6ec0e9c3b6f0e4e27ea272
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Three Oscillators Markers v1.0.0
--
-- Price-chart companion of IQOW Three Oscillators (three-oscillators). It
-- draws no lines: only that script's HIGHER and LOWER markers, above and below
-- the candles on the price chart. A script with its own panel draws its
-- markers at the candle's price on the panel's axis, so on assets priced above
-- about 100 (for example JPY pairs) they fall outside the panel. Add IQOW
-- Three Oscillators as well to see the lines that count the crossings. Keep
-- the settings of both scripts equal.
--
-- The article's trio setup: RSI, CCI and Williams %R, each watched for a cross
-- back out of its own extreme zone. A strong setup has all three; the article
-- says two of three is enough, so the number needed is an input (default 2).
-- Crossings may be spread over a short window of candles.
--
-- RSI follows IQ Option's built-in RSI: closing prices, with the average gain
-- and the average loss smoothed by an exponential average (alpha 2 / (period +
-- 1)).
--
-- HIGHER: at least 2 of 3 cross upward within the window: RSI(14) above 30,
-- CCI(20) above -100, Williams %R(14) above -80.
-- LOWER: at least 2 of 3 cross downward within the window: RSI below 70,
-- CCI below +100, Williams %R below -20.
--
-- 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 Three Oscillators Markers",
short_name = "MK 3 OSC",
overlay = true
}
input_group {
"1. Oscillators",
rsi_period = input (14, "RSI period", input.integer, 2, 100),
cci_period = input (20, "CCI period", input.integer, 5, 100),
wpr_period = input (14, "Williams %R period", input.integer, 2, 100)
}
input_group {
"2. Levels",
rsi_low = input (30, "RSI oversold", input.double, 5, 45, 1, false),
rsi_high = input (70, "RSI overbought", input.double, 55, 95, 1, false),
cci_level = input (100, "CCI level (+/-)", input.double, 50, 300, 10, false),
wpr_low = input (-80, "Williams %R oversold", input.double, -99, -55, 1, false),
wpr_high = input (-20, "Williams %R overbought", input.double, -45, -1, 1, false)
}
input_group {
"3. Confirmation",
needed_crossings = input (2, "Oscillators that must cross (2 or 3)", input.integer, 2, 3),
cross_window = input (3, "Window for the crossings (candles)", input.integer, 1, 10)
}
input_group {
"Display and advice",
signals_visible = input { default = true, type = input.plot_visibility },
advice_enabled = input { default = false, name = "Enable platform advice", type = input.boolean }
}
input_group {
"Colors",
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 }
}
-- RSI as IQ Option's built-in RSI draws it: the average gain and the average
-- loss are exponential averages (alpha = 2 / (period + 1)), not Wilder's
-- smoothing (alpha = 1 / period). It stays empty until both averages exist and
-- is 50 when price did not move at all.
rsi_change = close - close [1]
rsi_gain = ema (max (rsi_change, 0), rsi_period)
rsi_loss = ema (max (-rsi_change, 0), rsi_period)
rsi_total = rsi_gain + rsi_loss
rsi_value = iff (rsi_total > 0, 100 * rsi_gain / rsi_total, rsi_total + 50)
cci_value = cci (close, cci_period)
range_high = highest (high, wpr_period)
range_low = lowest (low, wpr_period)
wpr_value = 100 * (close - range_high) / max (range_high - range_low, 1e-10)
local rsi_now = get_value (rsi_value, nil)
local rsi_before = get_value (rsi_value [1], nil)
local cci_now = get_value (cci_value, nil)
local cci_before = get_value (cci_value [1], nil)
local wpr_now = get_value (wpr_value, nil)
local wpr_before = get_value (wpr_value [1], nil)
local levels_are_valid = rsi_low < 50 and rsi_high > 50 and wpr_low < wpr_high
local data_is_ready =
levels_are_valid and
rsi_now ~= nil and rsi_before ~= nil and
cci_now ~= nil and cci_before ~= nil and
wpr_now ~= nil and wpr_before ~= nil
-- Each oscillator crossing back out of its extreme zone on this candle.
rsi_up = conditional (data_is_ready and rsi_before <= rsi_low and rsi_now > rsi_low)
cci_up = conditional (data_is_ready and cci_before <= -cci_level and cci_now > -cci_level)
wpr_up = conditional (data_is_ready and wpr_before <= wpr_low and wpr_now > wpr_low)
rsi_down = conditional (data_is_ready and rsi_before >= rsi_high and rsi_now < rsi_high)
cci_down = conditional (data_is_ready and cci_before >= cci_level and cci_now < cci_level)
wpr_down = conditional (data_is_ready and wpr_before >= wpr_high and wpr_now < wpr_high)
-- Did the event happen on this candle or inside the window?
local function seen_recently (event, bars)
if get_value (event, false) then
return true
end
for back = 1, bars - 1 do
if get_value (event [back], false) then
return true
end
end
return false
end
local bullish_count = 0
local bearish_count = 0
if seen_recently (rsi_up, cross_window) then bullish_count = bullish_count + 1 end
if seen_recently (cci_up, cross_window) then bullish_count = bullish_count + 1 end
if seen_recently (wpr_up, cross_window) then bullish_count = bullish_count + 1 end
if seen_recently (rsi_down, cross_window) then bearish_count = bearish_count + 1 end
if seen_recently (cci_down, cross_window) then bearish_count = bearish_count + 1 end
if seen_recently (wpr_down, cross_window) then bearish_count = bearish_count + 1 end
higher_setup = conditional (data_is_ready and bullish_count >= needed_crossings)
lower_setup = conditional (data_is_ready and bearish_count >= needed_crossings)
-- 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)
)
-- Markers on the price chart: HIGHER below the candle, LOWER above it. Offset -1
-- puts each one on the candle that completed the setup (the confirmation above
-- is evaluated when the next candle opens).
if signals_visible then
plot_shape (
confirmed_higher,
"3 OSC HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"3 OSC 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
- 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
- Beginner
Keltner Re-entry
Marks the candle that closes back inside the Keltner Channel after the previous candle closed outside it. The channel width follows volatility, so a close outside it shows an unusually stretched move.
Indicators: Keltner Channel (EMA 20, 2 x ATR)
- Reversal
- On price
- Intermediate
Morning Evening Star RSI
Marks morning star and evening star candle patterns when RSI on the middle candle was at a low or high zone. RSI helps check that the pattern follows a push in the opposite direction.
Indicators: Morning and evening star candles · RSI (14, 40/60)
Download all 70 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.