iqow-envelopes-rsi.lua 6 KB · 免费,MIT 许可证
如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。
将其添加到 IQ Option 在3步骤中
- 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
- 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
- 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。
风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。
- 翻转
- 关于价格
- 初学者
这标志着价格从包络线反弹:一根K线触及外线,收盘价又回到内线,RSI指标确认价格被拉高。这与相关文章中提到的“从两侧反弹”的方法一致。
规则
更高标记
蜡烛图的最低价触及或跌破下包络线(20日简单移动平均线,偏差1 = 0.1%),收盘价回升至该线上方,且RSI(14)低于35。
下限标记
蜡烛图最高点触及或突破上包络线,随后收盘价回落至该线下方,且 RSI(14) 高于 65。
下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。
如何阅读它
蓝线代表上下包络线,橙线代表它们之间的简单移动平均线(SMA)。K线下方的绿色“更高”三角形表示RSI低于35时,价格从下包络线反弹;K线上方的红色“更低”三角形表示RSI高于65时,价格从上包络线反弹。
使用的指标
- 移动平均线包络线(SMA 20,偏差 1)
- RSI(14,35/65)
视图相同,但带有内置指示器: 在价格图表上添加包络线(SMA 20,偏差 1),并在其下方添加相对强弱指数(14)。
默认设置
| SMA周期 | 20 |
|---|---|
| 偏差 (IQ Option 单位,1 = 0.1%) | 1 |
| RSI时期 | 14 |
| RSI 水平较高 | 35 |
| RSI 水平较低 | 65 |
每个值都是脚本设置中的一个输入项。平台提示默认关闭。
关键点
- 包络线是一种移动平均线,它有两条平行线,分别位于其上方和下方固定百分比处。
- On IQ Option 偏差以十分之一百分比表示,因此 1 表示 0.1%。
- 文章中提到的反弹方法是指观察价格触及外线后反弹的情况。
- 我们添加 RSI:低于 35 表示下跌趋势线反弹,高于 65 表示上涨趋势线反弹。
- 蜡烛必须闭合回信封内,因此突破线的部分不会被标记出来。
- 根据您的时间范围调整偏差,并在模拟账户上进行测试。
局限性。 文章指出,反弹适用于低波动性市场,而突破线则适用于波动性较大的市场。固定的百分比宽度无法适应波动性,因此偏差应根据每个时间框架和交易品种进行调整;文章示例使用 9 日均线,而本脚本使用 20 日均线。在投入真实资金之前,请先在模拟账户中进行测试。
完整的源代码
下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:3c6ad37d98b160161b38b67515ed9c8d06c8124e6a6c09a7ce27dfffab60ec33
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Envelopes RSI v1.0.1
--
-- Moving Average Envelopes draw two lines a fixed percentage above and below
-- a simple moving average. The article's "bounce from the sides" idea is used:
-- price dips through an envelope line, closes back inside, and RSI agrees that
-- the move was stretched. Deviation uses IQ Option's unit: 1 = 0.1% of the average.
--
-- 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 low touches or pierces the lower envelope, the candle closes back
-- above it, and RSI(14) is below 35.
-- LOWER: the high touches or pierces the upper envelope, the candle closes back
-- below it, and RSI(14) is above 65.
--
-- 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 Envelopes RSI",
short_name = "IQOW ENV RSI",
overlay = true
}
input_group {
"1. Envelopes",
envelope_period = input (20, "SMA period", input.integer, 2, 200),
envelope_deviation = input (1, "Deviation (1 = 0.1%)", input.double, 0.01, 300, 0.01, false)
}
input_group {
"2. RSI filter",
rsi_period = input (14, "RSI period", input.integer, 2, 100),
rsi_low_level = input (35, "RSI below this for HIGHER", input.double, 5, 50, 1, false),
rsi_high_level = input (65, "RSI above this for LOWER", input.double, 50, 95, 1, false)
}
input_group {
"Display and advice",
lines_visible = input { default = true, type = input.plot_visibility },
middle_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",
envelope_color = input { default = "#2384C2", type = input.color },
envelope_fill_color = input { default = rgba(86, 206, 255, 0.10), type = input.color },
middle_color = input { default = "#FF7700", type = input.color },
line_width = input { default = 1, 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 }
}
-- Envelopes as on the IQ Option chart: SMA plus and minus deviation / 1000.
middle_line = sma (close, envelope_period)
envelope_offset = envelope_deviation / 1000 * middle_line
upper_line = middle_line + envelope_offset
lower_line = middle_line - envelope_offset
-- 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 high_now = get_value (high, nil)
local low_now = get_value (low, nil)
local close_now = get_value (close, nil)
local upper_now = get_value (upper_line, nil)
local lower_now = get_value (lower_line, nil)
local rsi_now = get_value (rsi_value, nil)
local levels_are_valid = rsi_low_level < 50 and rsi_high_level > 50
local data_is_ready =
levels_are_valid and
high_now ~= nil and low_now ~= nil and close_now ~= nil and
upper_now ~= nil and lower_now ~= nil and rsi_now ~= nil
-- Touch the envelope, close back inside, and RSI shows the stretch.
higher_setup = conditional (
data_is_ready and low_now <= lower_now and close_now > lower_now and rsi_now < rsi_low_level
)
lower_setup = conditional (
data_is_ready and high_now >= upper_now and close_now < upper_now and rsi_now > rsi_high_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 (upper_line, lower_line, "Envelope area", envelope_fill_color)
plot (upper_line, "Upper envelope", envelope_color, line_width)
plot (lower_line, "Lower envelope", envelope_color, line_width)
end
if middle_visible then
plot (middle_line, "Envelope middle (SMA)", middle_color, 1)
end
if signals_visible then
plot_shape (
confirmed_higher,
"ENV RSI HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"ENV 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
更多反转脚本
- 翻转
- 自有面板
- 中级
双重随机
标记慢速随机指标确认反转交叉的K线,该反转交叉此前已在快速随机指标显示的超卖或超买区域出现。使用两种设置,会在标记出现之前,在两个不同的时间尺度上提出相同的问题。
指标: 随机快(8, 3, 5)· 随机慢(17, 3, 7)
- 翻转
- 自有面板
- 中级
Fisher变换反转
当指标处于极端区域时,Fisher变换曲线与其触发线发生交叉。这正是相关文章中描述的“极端-交叉”确认信号。
指标: 埃勒斯-费舍尔变换(10)
- 翻转
- 关于价格
- 初学者
哈拉米 RSI
当RSI处于低位或高位区域时,RSI会标记出看涨或看跌的孕线形态。RSI有助于判断该货币对是否会朝着相反的方向发展。
指标: Harami 蜡烛对 · RSI (14, 40/60)
下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。