McGinley Dynamic RSI Script

← All 56 scripts

  • Trend
  • On price
  • Intermediate

Marks closes that cross the McGinley Dynamic line when RSI agrees on the side of 50. The McGinley Dynamic adjusts its own speed to price, and RSI gives a second opinion on momentum.

  • File iqow-mcginley-dynamic-rsi.lua
  • Version 1.0.0
  • Size 137 lines · 4 KB
  • Timeframes 1-minute to 15-minute candles
  • License MIT
McGinley Dynamic RSI 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 close crosses above McGinley Dynamic(14) on a candle where RSI(14) is above 50.

LOWER marker

The close crosses below McGinley Dynamic(14) on a candle where RSI(14) is below 50.

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 blue line is the McGinley Dynamic, which hugs price more closely than a regular moving average. A green HIGHER triangle under a candle marks a close that crossed above the line with RSI above 50; a red LOWER triangle above a candle marks a close that crossed below it with RSI below 50.

Indicators used

  • McGinley Dynamic (14)
  • RSI (14, level 50)

Same view with built-in indicators: Add McGinley Dynamic (14) and Relative Strength Index (14) with a 50 level from the IQ Option indicator list.

Default settings

McGinley period14
RSI period14
RSI middle level50

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

Key points

  1. The McGinley Dynamic is a moving average that speeds up when price runs away and slows down when it is close.
  2. That makes it stick closer to price than an ordinary EMA with the same period.
  3. A HIGHER marker needs the close to cross above the line and RSI to be above 50.
  4. A LOWER marker needs the close to cross below the line and RSI below 50.
  5. RSI above or below 50 simply checks that momentum agrees with the cross.
  6. Practise on a Practice balance and compare it with a normal 14-period average.

Limitations. Because the line follows price closely, crosses are frequent in sideways markets and RSI near 50 adds little there. The RSI 50 filter is a script default chosen for this setup; the article describes the indicator itself, not this rule. 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: 31e9f1c07a9213164ca3b54413d35991c195620b3eb8ed786542b11bdf8ccb8a

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW McGinley Dynamic RSI v1.0.0
--
-- The McGinley Dynamic is a moving average that adjusts its speed to how
-- far price is from it, so it tracks price with less lag and fewer whipsaws.
-- A close crossing it, with RSI on the same side of 50, marks a possible turn.
-- McGinley Dynamic uses the same formula as the official IQ Option indicator.
--
-- HIGHER: the close crosses above McGinley Dynamic(14) and RSI(14) is above 50.
-- LOWER:  the close crosses below McGinley Dynamic(14) and RSI(14) is below 50.
--
-- 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 McGinley Dynamic RSI",
    short_name = "IQOW MG RSI",
    overlay = true
}

input_group {
    "1. McGinley Dynamic",
    mg_period = input (14, "McGinley period", input.integer, 2, 200)
}

input_group {
    "2. RSI filter",
    rsi_period = input (14, "RSI period", input.integer, 2, 100),
    rsi_middle = input (50, "RSI middle level", input.double, 40, 60, 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",
    mg_color = input { default = "#56CEFF", 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 }
}

-- McGinley Dynamic: previous value plus a price-distance adjusted step.
-- The first bar is seeded with an EMA, as in the official indicator.
mg_line = make_series ()
if na (mg_line [1]) then
    mg_line:set (ema (close, mg_period))
else
    mg_line:set (mg_line [1] + (close - mg_line [1]) / (mg_period * (close / max (mg_line [1], 1e-10)) ^ 4))
end

rsi_value = rsi (close, rsi_period)

-- Current-bar scalars for the Lua rule logic.
local close_now = get_value (close, nil)
local close_before = get_value (close [1], nil)
local mg_now = get_value (mg_line, nil)
local mg_before = get_value (mg_line [1], nil)
local rsi_now = get_value (rsi_value, nil)

local data_is_ready =
    close_now ~= nil and
    close_before ~= nil and
    mg_now ~= nil and
    mg_before ~= nil and
    rsi_now ~= nil and
    get_value (rsi_value [rsi_period], nil) ~= nil

-- Event: close crosses the McGinley line on this candle with RSI on the same side of 50.
higher_setup = conditional (
    data_is_ready and close_before <= mg_before and close_now > mg_now and rsi_now > rsi_middle
)
lower_setup = conditional (
    data_is_ready and close_before >= mg_before and close_now < mg_now and rsi_now < rsi_middle
)

-- 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
    plot (mg_line, "McGinley Dynamic", mg_color, line_width)
end

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

    plot_shape (
        confirmed_lower,
        "MG RSI 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 trend scripts

  • Trend
  • Context indicator
  • On price
  • Beginner

EMA Trend Ribbon

Plots a fast and slow exponential moving average over price and shades the space between them with a neutral ribbon, making the relationship between two smoothing speeds easier to see.

Indicators: EMA 9 · EMA 21

  • Trend
  • Signal engine
  • On price
  • Intermediate

IQ_WIKI_SCRIP_V1.0.1

A selective confluence overlay with five readable filters: EMA trend alignment and slope, RSI momentum without chasing extremes, ADX/DMI strength, ATR activity and a candle-quality guard.

Indicators: EMA 9/21/50 · RSI (14) · ADX/DMI (14) · ATR (14)

  • Trend
  • On price
  • Intermediate

ADX EMA28 Cross

Marks a candle that closes through the EMA 28 in the direction that +DI or -DI already favours. The DI lines act as a direction filter, the EMA cross as the trigger.

Indicators: ADX +DI / -DI (5) · EMA (28)

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.