iqow-mcginley-dynamic-rsi.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
- 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.
- 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.
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 period | 14 |
|---|---|
| RSI period | 14 |
| RSI middle level | 50 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- The McGinley Dynamic is a moving average that speeds up when price runs away and slows down when it is close.
- That makes it stick closer to price than an ordinary EMA with the same period.
- A HIGHER marker needs the close to cross above the line and RSI to be above 50.
- A LOWER marker needs the close to cross below the line and RSI below 50.
- RSI above or below 50 simply checks that momentum agrees with the cross.
- 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.
Complete source code
The download and this preview resolve to the same reviewed file. SHA-256: cd1c02309853e4a87f3a12f565ad49e72ee15687ceec670246928a8e37846a08
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW McGinley Dynamic RSI v1.0.1
--
-- 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.
--
-- 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)). Version 1.0.1 (9 October 2026) changed this from Wilder smoothing; the
-- inputs, periods and levels are unchanged.
--
-- 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 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)
-- 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 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.