iqow-trend-intensity-index.lua 5 KB · 免费,MIT 许可证
对于价格高于约 100 的资产(例如日元货币对),此脚本的面板可能会隐藏其标记,因此也需要导入标记文件:它会在价格图表上绘制这些标记。
如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。
将其添加到 IQ Option 在3步骤中
- 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
- 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
- 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。
风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。
- 趋势
- 自有面板
- 中级
该指标标志着趋势强度指数进入强势区域:高于 80 表示上涨压力,低于 20 表示下跌压力,收盘价位于 60 周期简单移动平均线 (SMA) 的相应一侧。这是一个趋势强度入场标志,而非反转标志。
指标面板中的标记绘制在K线价格上,因此对于价格高于100左右的资产(例如日元货币对),标记会超出面板范围。加载 趋势强度指数标记 在价格图表上看到相同的标记。
观看:安装并跟随练习交易。
规则
更高标记
TII(30) 在收盘价高于其 60 周期 SMA 的蜡烛图上向上穿过 80。
下限标记
TII(30) 在一根收盘价低于其 60 周期 SMA 的蜡烛图上向下穿过 20。
下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。
如何阅读它
红线是位于单独面板中的 TII 指数,数值范围为 0 到 100,水平线分别为 20、50 和 80。面板底部的绿色“更高”三角形表示 TII 指数向上穿过其 SMA 上方 80;顶部的红色“更低”三角形表示 TII 指数向下穿过其 SMA 下方 20。
使用的指标
- 趋势强度指数(30日均线,60日均线)
视图相同,但带有内置指示器: 在价格图表上添加趋势强度指数(主要 60,次要 30),水平线分别为 20 和 80,以及简单移动平均线(60)。
默认设置
| SMA周期(主要) | 60 |
|---|---|
| TII 时期(次要) | 30 |
| 低级 | 20 |
| 高水平 | 80 |
每个值都是脚本设置中的一个输入项。平台提示默认关闭。
关键点
- 趋势强度指数显示近期价格走势中有多少位于 60 周期移动平均线之上或之下。
- 数值范围为 0 到 100:高于 80 表示强劲的上升趋势,低于 20 表示强劲的下降趋势。
- 当 TII 指数向上突破 80 且收盘价高于平均值时,就会出现更高的标记。
- 当价格跌破 20 且收盘价低于平均值时,就会出现一个较低的标记。
- 这是趋势强度读数,而不是超买超卖警告。
- 首先在模拟账户上对照价格图表检查标记。
局限性。 TII 指标需要 60 根 K 线加上 30 根 K 线的历史数据,当 TII 达到 80 或 20 时,趋势通常已经形成,因此它可能出现较晚,也可能恰好在回调之前。文章还提到,可以将 20 和 80 的水平作为反转点进行反向操作;而本脚本则采用相反的趋势延续解读。在投入真实资金之前,请先在模拟账户中进行测试。
完整的源代码
下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:32603606fc4e26178beb4232f51b68039662f86a4c6b1336267d6bdf8c047150
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Trend Intensity Index v1.0.0
--
-- The Trend Intensity Index (TII) compares how much of the recent price
-- distance from a 60-period SMA is above versus below it. It reads 0 to 100:
-- high values mean strong upward pressure, low values strong downward pressure.
-- Formula follows the official IQ Option indicator. Drawn in its own panel.
--
-- HIGHER: TII(30) crosses above 80 while the close is above its SMA 60.
-- LOWER: TII(30) crosses below 20 while the close is below its SMA 60.
--
-- 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 Trend Intensity Index",
short_name = "IQOW TII",
overlay = false
}
input_group {
"1. Trend Intensity Index",
major_period = input (60, "SMA period (major)", input.integer, 3, 300),
minor_period = input (30, "TII period (minor)", input.integer, 2, 200)
}
input_group {
"2. Levels",
low_level = input (20, "Low level", input.double, 5, 45, 1, false),
high_level = input (80, "High level", input.double, 55, 95, 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",
tii_color = input { default = "#DB4931", type = input.color },
level_low_color = input { default = rgba(255, 108, 88, 0.5), type = input.color },
level_high_color = input { default = rgba(37, 225, 84, 0.5), type = input.color },
middle_color = input { default = rgba(255, 255, 255, 0.15), 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 }
}
-- Distance of the close from its SMA, split into the part above and below.
major_sma = sma (close, major_period)
distance = close - major_sma
positive_sum = sum (max (distance, 0), minor_period)
negative_sum = -sum (min (distance, 0), minor_period)
tii_value = 100 * positive_sum / max (positive_sum + negative_sum, 1e-10)
-- Current-bar scalars for the Lua rule logic.
local tii_now = get_value (tii_value, nil)
local tii_before = get_value (tii_value [1], nil)
local close_now = get_value (close, nil)
local sma_now = get_value (major_sma, nil)
local settings_are_valid = minor_period <= major_period and low_level < high_level
local data_is_ready =
settings_are_valid and
tii_now ~= nil and
tii_before ~= nil and
close_now ~= nil and
sma_now ~= nil and
get_value (tii_value [major_period + minor_period], nil) ~= nil
-- Event: TII crosses a level on this candle while the close sits on the same side of the SMA.
higher_setup = conditional (
data_is_ready and tii_before <= high_level and tii_now > high_level and close_now > sma_now
)
lower_setup = conditional (
data_is_ready and tii_before >= low_level and tii_now < low_level and close_now < sma_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)
)
hline { value = high_level, color = level_high_color, width = 1 }
hline { value = low_level, color = level_low_color, width = 1 }
hline { value = 50, color = middle_color, width = 1 }
hline { value = 100, color = "#0000000", show_label = false }
hline { value = 0, color = "#0000000", show_label = false }
if lines_visible then
plot (tii_value, "TII", tii_color, line_width)
end
if signals_visible then
plot_shape (
confirmed_higher,
"TII HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.bottom,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"TII LOWER",
shape_style.triangledown,
shape_size.small,
lower_color,
shape_location.top,
-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
更多趋势脚本
- 趋势
- 关于价格
- 初学者
平金足 EMA
仅当价格收于 50 日均线 (EMA 50) 的对应侧时,才会在连续出现两根方向相反的蜡烛图后,标记出第一根看涨或看跌的 Heikin-Ashi 蜡烛图。Heikin-Ashi 是在脚本内部计算的,因此图表可以保持常规蜡烛图。
指标: Heikin-Ashi蜡烛图(计算值)· EMA(50)
- 趋势
- 关于价格
- 先进的
一目棋纯云
当价格已经位于彩色一目均衡图云图的趋势侧时,基准线(Kijun-sen)的收盘价会再次穿过基准线。云图决定方向,基准线交叉决定时机。
指标: 一目均衡图(9, 26, 52, 位移 26)
- 趋势
- 关于价格
- 中级
KAMA趋势
标记收盘价与考夫曼自适应移动平均线(KAMA)的交叉点,且交叉方向与KAMA的倾斜方向一致。斜率检查会剔除价格仅触及平坦、缓慢移动的KAMA的交叉点。
指标: 卡玛(10,2,30)
下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。