Three Oscillators Script

← All 56 scripts

  • Reversal
  • Own panel
  • Intermediate

Counts how many of three oscillators have just crossed back out of their extreme zone and marks the candle where at least two agree. It follows the article's trio setup, where all three is strongest and two of three is enough.

  • File iqow-three-oscillators.lua
  • Version 1.0.0
  • Size 181 lines · 7 KB
  • Timeframes 5-minute candles (major pairs per the article)
  • License MIT
Three Oscillators drawn on synthetic candles
How the script draws, shown on synthetic candles generated for testing. It is an illustration of the markers and lines, not real market data or a result.

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

The panel plots a green count of oscillators that crossed up (above zero) and a red count of those that crossed down (below zero) inside the window; the lines at plus and minus the required number show the marker threshold. A HIGHER triangle appears at the bottom when the green count reaches the threshold, a LOWER triangle at the top for the red count.

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 period14
CCI period20
Williams %R period14
Oscillators that must cross2
Window (candles)3

Every value is an input in the script settings. Platform advice is off by default.

Key points

  1. This setup watches three oscillators: RSI, CCI with period 20, and Williams %R.
  2. Each one has an extreme zone. RSI 30 and 70, CCI minus 100 and plus 100, Williams %R minus 80 and minus 20.
  3. We want them to cross back out of the zone together. Three is strongest, two is enough, as the article says.
  4. The panel counts the crossings, green for upward and red for downward.
  5. When the count reaches two, the candle is marked HIGHER or LOWER.
  6. The window lets crossings a candle or two apart count together. Test on a Practice balance.

Limitations. The article gives the CCI period (20) but not the other periods, so RSI 14 and Williams %R 14 are assumed. The three oscillators are all momentum measures of price, so they often move together and the agreement adds less independent information than it may seem. The 3-candle window is an addition to let crossings that are a candle apart count together. Test on the Practice balance before risking real funds.

Learn the strategy: read the full guide on IQOptionWiki →

Install it in four steps

  1. 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.
  2. Open Chart Analysis → ScriptsIn the IQ Option traderoom, choose the Practice balance, open the chart analysis panel, select Scripts and choose Import script.
  3. Save and add to chartSelect the downloaded file, review the imported code, choose Save, then use the + control to add it to the chart.
  4. 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: bf883456740699598ac43289b0f7bfac6c0b5a113f07050c7057e3b1689f5769

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Three Oscillators v1.0.0
--
-- 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.
--
-- 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",
    short_name = "IQOW 3 OSC",
    overlay = false
}

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",
    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",
    bull_color = input { default = "#25E154", type = input.color },
    bear_color = input { default = "#FF6C58", type = input.color },
    level_color = input { default = rgba(255, 255, 255, 0.30), type = input.color },
    line_width = input { default = 2, 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 }
}

rsi_value = rsi (close, rsi_period)
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

-- Series versions of the counts, for the panel plot.
bullish_agreement = close * 0 + bullish_count
bearish_agreement = close * 0 - bearish_count

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)
)

-- Panel: how many oscillators crossed up (above zero) or down (below zero).
if lines_visible then
    hline (needed_crossings, "Crossings needed", level_color, 1)
    hline (0, "Zero", rgba (255, 255, 255, 0.25), 1)
    hline (-needed_crossings, "Crossings needed", level_color, 1)
    plot (bullish_agreement, "Oscillators crossed up", bull_color, line_width)
    plot (bearish_agreement, "Oscillators crossed down", bear_color, line_width)
end

if signals_visible then
    plot_shape (
        confirmed_higher,
        "3 OSC HIGHER",
        shape_style.triangleup,
        shape_size.small,
        higher_color,
        shape_location.bottom,
        -1,
        "HIGHER",
        signal_text_color
    )

    plot_shape (
        confirmed_lower,
        "3 OSC 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
  • 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)

  • Reversal
  • Own panel
  • Beginner

RSI Law

Marks the candle on which a short RSI(5) closes back across the 30 or 70 line after an excursion into the extreme zone. This is the RSI Law rule from the related article, shown as completed-candle markers.

Indicators: RSI (5, 30/70)

  • Reversal
  • On price
  • Beginner

STARC Bands Reversal

Marks a bullish or bearish candle that closes back inside the STARC Bands after the previous close was outside them. The bands show where price is stretched in ATR terms.

Indicators: STARC Bands (SMA 6, ATR 15, x2)

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.

GENERAL RISK WARNING

The financial products offered by the company carry a high level of risk and can result in the loss of all your funds. You should never invest money that you cannot afford to lose.
Kindly note that this article does not provide any investment advice. The information presented regarding past events or potential future developments is solely an opinion and cannot be guaranteed as factual, including the provided examples. We caution readers accordingly.