RSI Law Markers

← All 70 scripts

iqow-rsi-law-markers.lua 5 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

  1. Get the file. Press Get the script. Your browser saves a .lua file.
  2. 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.
  3. 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.

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
  • Beginner

Draws the HIGHER and LOWER markers of the RSI Law script on the price chart, above and below the candles, so they show on every asset, JPY pairs included. No lines: add RSI Law as well for the RSI line.

  • File iqow-rsi-law-markers.lua
  • Version 1.0.0
  • Size 129 lines · 5 KB
  • Timeframes 5-minute candles (1-minute to 15-minute also usable)
  • License MIT

This is the price-chart companion of RSI Law. 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.

RSI Law Markers 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

RSI(5) was at or below 30 on the previous candle and closes above 30.

LOWER marker

RSI(5) was at or above 70 on the previous candle and closes below 70.

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 RSI Law. A marker appears after the next candle opens and does not move. The script draws no line, so add RSI Law (it opens in its own panel) to see the RSI line. Both scripts use the same settings.

Indicators used

  • RSI (5, 30/70)

Same view with built-in indicators: Add the Relative Strength Index with period 5 and levels 30, 50 and 70.

Default settings

RSI period5
Oversold level30
Overbought level70

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

Key points

  1. This is the price-chart companion of RSI Law: the same rule, the same settings and the same HIGHER and LOWER markers.
  2. 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.
  3. The companion draws them above and below the candles instead, so they show on every asset.
  4. Each marker sits on the candle that completed the setup and appears after the next candle opens; it does not move or disappear.
  5. It draws no lines: add RSI Law to see the RSI line in its own panel.
  6. Test both on a Practice balance first.

Limitations. Same setup and same limits as RSI Law: 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.

Learn the strategy: read the full guide on IQOptionWiki →

Complete source code

The download and this preview resolve to the same reviewed file. SHA-256: 6588aae49f778ccc4775e9897764d3913dc9ba715d5da0d6bf53d689ab6367c5

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW RSI Law Markers v1.0.0
--
-- Price-chart companion of IQOW RSI Law (rsi-law). 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 RSI Law as well to see the
-- RSI line. Keep the settings of both scripts equal.
--
-- RSI Law uses a short RSI (period 5) on the 5-minute chart, as described in
-- the IQOptionWiki article. The setup is the RSI leaving its extreme zone:
-- price was oversold or overbought, and the candle closes with RSI back across
-- the 30 or 70 line. Because RSI(5) is very sensitive, the line crosses often.
--
-- 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: RSI(5) was at or below 30 and closes back above 30.
-- LOWER:  RSI(5) was at or above 70 and closes back below 70.
--
-- 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 RSI Law Markers",
    short_name = "MK RSI Law",
    overlay = true
}

input_group {
    "1. RSI",
    rsi_period = input (5, "RSI period", input.integer, 2, 100),
    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",
    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)

local rsi_now = get_value (rsi_value, nil)
local rsi_before = get_value (rsi_value [1], nil)

local levels_are_valid = oversold_level < 50 and overbought_level > 50
local data_is_ready = levels_are_valid and rsi_now ~= nil and rsi_before ~= nil

-- Event: RSI crosses back across its level on this candle.
local rsi_recovers = data_is_ready and rsi_before <= oversold_level and rsi_now > oversold_level
local rsi_fades = data_is_ready and rsi_before >= overbought_level and rsi_now < overbought_level

higher_setup = conditional (rsi_recovers)
lower_setup = conditional (rsi_fades)

-- 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,
        "RSI Law HIGHER",
        shape_style.triangleup,
        shape_size.small,
        higher_color,
        shape_location.belowbar,
        -1,
        "HIGHER",
        signal_text_color
    )

    plot_shape (
        confirmed_lower,
        "RSI Law 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
  • 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)

  • Reversal
  • On price
  • Beginner

Stochastic PSAR

Marks a Stochastic %K/%D cross that starts in the oversold or overbought zone while the Parabolic SAR dot is on the matching side of price. The Stochastic gives the timing and the SAR checks the trailing stop agrees.

Indicators: Stochastic (14, 3, 3) · Parabolic SAR (0.02, 0.2)

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.

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.