iqow-vortex-macd-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
- 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
- Marker companion
- On price
- Intermediate
Draws the HIGHER and LOWER markers of the Vortex MACD script on the price chart, above and below the candles, so they show on every asset, JPY pairs included. No lines: add Vortex MACD as well for the Vortex lines.
This is the price-chart companion of Vortex MACD. 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.
The rules
HIGHER marker
Vortex VI+(21) crosses above VI- on this candle while the MACD(12, 26, 9) line is above its signal line.
LOWER marker
Vortex VI+(21) crosses below VI- on this candle while the MACD(12, 26, 9) line is below its signal line.
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 Vortex MACD. A marker appears after the next candle opens and does not move. The script draws no line, so add Vortex MACD (it opens in its own panel) to see the Vortex lines. Both scripts use the same settings.
Indicators used
- Vortex Indicator (21)
- MACD (12, 26, 9)
Same view with built-in indicators: Add IQ Option's Vortex Indicator (21) and MACD (12, 26, 9).
Default settings
| Vortex period | 21 |
|---|---|
| MACD fast | 12 |
| MACD slow | 26 |
| MACD signal | 9 |
Every value is an input in the script settings. Platform advice is off by default.
Key points
- This is the price-chart companion of Vortex MACD: the same rule, the same settings and the same HIGHER and LOWER markers.
- 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.
- The companion draws them above and below the candles instead, so they show on every asset.
- Each marker sits on the candle that completed the setup and appears after the next candle opens; it does not move or disappear.
- It draws no lines: add Vortex MACD to see the Vortex lines in its own panel.
- Test both on a Practice balance first.
Limitations. Same setup and same limits as Vortex MACD: 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.
Complete source code
The download and this preview resolve to the same reviewed file. SHA-256: f7935ff0129fc389874799e7c41023acd712236018366455c30e48ae6cedf2da
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Vortex MACD Markers v1.0.0
--
-- Price-chart companion of IQOW Vortex MACD (vortex-macd). 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 Vortex MACD as well
-- to see the Vortex lines. Keep the settings of both scripts equal.
--
-- Combines the Vortex Indicator (21) with MACD (12, 26, 9), as in the related
-- article. A VI+ / VI- cross shows the dominant price movement changing side; the
-- MACD line against its signal line checks that momentum agrees. The article
-- suggests period 21 or 34 on a 5-minute chart; 21 is the default here. The
-- MACD condition is part of the rule only.
--
-- HIGHER: VI+ crosses above VI- while the MACD line is above its signal line.
-- LOWER: VI+ crosses below VI- while the MACD line is below its signal line.
--
-- 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 Vortex MACD Markers",
short_name = "MK VORTEX",
overlay = true
}
input_group {
"1. Vortex Indicator",
vortex_period = input (21, "Vortex period", input.integer, 2, 100)
}
input_group {
"2. MACD",
macd_fast_period = input (12, "Fast EMA period", input.integer, 2, 100),
macd_slow_period = input (26, "Slow EMA period", input.integer, 3, 200),
macd_signal_period = input (9, "Signal period", input.integer, 2, 100)
}
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 }
}
-- Vortex Indicator as in the official indicator.
plus_movement = abs (high - low [1])
minus_movement = abs (low - high [1])
true_range_sum = sum (tr, vortex_period)
vi_plus = sum (plus_movement, vortex_period) / iff (true_range_sum > 1e-10, true_range_sum, 1e-10)
vi_minus = sum (minus_movement, vortex_period) / iff (true_range_sum > 1e-10, true_range_sum, 1e-10)
macd_line = ema (close, macd_fast_period) - ema (close, macd_slow_period)
signal_line = ema (macd_line, macd_signal_period)
local plus_now = get_value (vi_plus, nil)
local minus_now = get_value (vi_minus, nil)
local plus_previous = get_value (vi_plus [1], nil)
local minus_previous = get_value (vi_minus [1], nil)
local macd_now = get_value (macd_line, nil)
local signal_now = get_value (signal_line, nil)
local periods_are_valid = macd_fast_period < macd_slow_period
local data_is_ready =
periods_are_valid and
get_value (close [macd_slow_period + macd_signal_period], nil) ~= nil and
get_value (close [vortex_period + 1], nil) ~= nil and
plus_now ~= nil and
minus_now ~= nil and
plus_previous ~= nil and
minus_previous ~= nil and
macd_now ~= nil and
signal_now ~= nil
-- Event: VI+ crosses VI- on this candle.
local vortex_crosses_up = data_is_ready and plus_previous <= minus_previous and plus_now > minus_now
local vortex_crosses_down = data_is_ready and plus_previous >= minus_previous and plus_now < minus_now
higher_setup = conditional (vortex_crosses_up and macd_now > signal_now)
lower_setup = conditional (vortex_crosses_down and macd_now < signal_now)
-- 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,
"VORTEX MACD HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"VORTEX MACD 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
- Own panel
- Intermediate
Vortex MACD
Marks a Vortex VI+/VI- cross when the MACD line is on the matching side of its signal line. The Vortex cross shows which direction dominates and the MACD checks that momentum agrees.
Indicators: Vortex Indicator (21) · MACD (12, 26, 9)
- Trend
- On price
- Beginner
Well Defined EMA
After the EMA 20 crosses the EMA 50, marks the first pullback of price to the EMA 20 that closes back in the direction of the new trend. It turns the article's two steps (cross, then pullback) into one marker.
Indicators: EMA (20) · EMA (50)
- Trend
- On price
- Beginner
Williams R EMA Pullback
Marks the Williams %R cross back out of its oversold or overbought zone, but only when price is on the matching side of the EMA 50. The EMA turns the article's plain %R cross into a pullback-in-trend setup.
Indicators: Williams %R (14, -80/-20) · EMA (50)
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.