Ultimate Oscillator Cross Script

← All 56 scripts

  • Momentum
  • Own panel
  • Beginner

Marks the Ultimate Oscillator leaving its oversold or overbought zone. The oscillator blends three periods, so it reacts more evenly than a single-period oscillator.

  • File iqow-ultimate-oscillator.lua
  • Version 1.0.0
  • Size 142 lines · 5 KB
  • Timeframes 1-minute to 15-minute candles
  • License MIT
Ultimate Oscillator Cross 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

The Ultimate Oscillator closes above 30 after being at or below it.

LOWER marker

The Ultimate Oscillator closes below 70 after being at or above it.

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 shows the oscillator between 0 and 100 with levels at 30 and 70. A green HIGHER triangle at the bottom of the panel marks the line closing back above 30; a red LOWER triangle at the top marks it closing back below 70.

Indicators used

  • Ultimate Oscillator (7, 14, 28)

Same view with built-in indicators: Add the Ultimate Oscillator (7, 14, 28) with levels 30 and 70.

Default settings

Fast period7
Medium period14
Slow period28
Oversold level30
Overbought level70

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

Key points

  1. The Ultimate Oscillator combines buying pressure over three periods: 7, 14 and 28.
  2. It moves between 0 and 100.
  3. A close back above 30 after being at or below it is marked HIGHER.
  4. A close back below 70 after being at or above it is marked LOWER.
  5. The article also teaches divergence; this script marks the simpler level cross.
  6. Confirm on a completed candle and practise on the Practice balance.

Limitations. In strong trends the oscillator can stay near an extreme and a cross may be followed by a continuation. The article describes divergence signals rather than a level cross, so the cross rule here is a simpler adaptation. 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: ebfb37fb6685346f5cfb3cff204cf7e190caf34282987d089cfe4b7a85dff9f2

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Ultimate Oscillator Cross v1.0.0
--
-- The Ultimate Oscillator (Larry Williams) blends buying pressure over three
-- periods (7, 14, 28) into one 0-100 line, which makes it less jumpy than a
-- single-period oscillator. This script marks the line leaving an extreme.
--
-- HIGHER: the oscillator closes above 30 after being at or below it.
-- LOWER:  the oscillator closes below 70 after being at or above it.
--
-- This is a separate-panel script: markers sit at the bottom (HIGHER) and
-- top (LOWER) of the oscillator panel.
--
-- 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 Ultimate Oscillator Cross",
    short_name = "IQOW UO",
    overlay = false
}

input_group {
    "1. Ultimate Oscillator",
    period_fast = input (7, "Fast period", input.integer, 1, 50),
    period_medium = input (14, "Medium period", input.integer, 2, 100),
    period_slow = input (28, "Slow period", input.integer, 3, 200),
    oversold_level = input (30, "Oversold level", input.double, 5, 45, 1, false),
    overbought_level = input (70, "Overbought level", input.double, 55, 95, 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",
    line_color = input { default = "#DB4931", type = input.color },
    line_width = input { default = 1, type = input.line_width },
    level_color = input { default = rgba(255, 255, 255, 0.35), type = input.color },
    zone_color = input { default = rgba(255, 255, 255, 0.05), type = input.color },
    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 }
}

-- Buying pressure and true range, summed over three periods (official formula).
buying_pressure = close - min (low, close [1])

average_fast = sum (buying_pressure, period_fast) / max (sum (tr, period_fast), 1e-10)
average_medium = sum (buying_pressure, period_medium) / max (sum (tr, period_medium), 1e-10)
average_slow = sum (buying_pressure, period_slow) / max (sum (tr, period_slow), 1e-10)

uo_value = (100 / 7) * (4 * average_fast + 2 * average_medium + average_slow)

local uo_now = get_value (uo_value, nil)
local uo_previous = get_value (uo_value [1], nil)

-- Periods must be ordered fast < medium < slow and levels must not overlap.
local settings_are_valid =
    period_fast < period_medium and
    period_medium < period_slow and
    oversold_level < overbought_level

-- The slowest sum needs period_slow candles plus one for close [1].
local data_is_ready =
    settings_are_valid and
    uo_now ~= nil and
    uo_previous ~= nil and
    get_value (close [period_slow], nil) ~= nil

-- Event: the line closes back across a level on this candle.
higher_setup = conditional (
    data_is_ready and uo_previous <= oversold_level and uo_now > oversold_level
)

lower_setup = conditional (
    data_is_ready and uo_previous >= overbought_level and uo_now < overbought_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)
)

if lines_visible then
    fill_area (overbought_level, oversold_level, "UO zone", zone_color)
    hline (overbought_level, "Overbought", level_color, 1)
    hline (oversold_level, "Oversold", level_color, 1)
    plot (uo_value, "UO", line_color, line_width)
end

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

    plot_shape (
        confirmed_lower,
        "UO 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 momentum scripts

  • Momentum
  • On price
  • Intermediate

Elder Impulse

Marks the first candle where both trend (EMA 13) and momentum (MACD histogram) turn the same way, following Alexander Elder's Impulse System colours. A marker appears only when the state changes, not on every green or red candle.

Indicators: EMA (13) · MACD histogram (12, 26, 9)

  • Momentum
  • On price
  • Beginner

EMA Momentum

Marks the candle that completes two events: price closes across the EMA(20) and the Momentum(20) line crosses zero, within a few candles of each other. Both must still be true on the marked candle.

Indicators: EMA (20) · Momentum (20)

  • Momentum
  • On price
  • Beginner

MACD PSAR 7-14-5

Marks the candle on which the fast MACD line crosses the zero line while the Parabolic SAR sits on the matching side of price. The MACD cross shows momentum changing side and the SAR dot shows which side the trailing stop is on.

Indicators: MACD (7, 14, 5) · Parabolic SAR (0.02, 0.2)

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.