iqow-keltner-reentry.lua 5 KB · 免费,MIT 许可证
如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。
将其添加到 IQ Option 在3步骤中
- 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
- 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
- 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。
风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。
- 翻转
- 关于价格
- 初学者
这条标志是前一根K线收盘价在通道外,而后一根K线收盘价又回到通道内。通道宽度与波动率相关,因此收盘价在通道外表明价格波动幅度异常大。
观看:安装并跟随练习交易。
规则
更高标记
前一个收盘价低于 Keltner 下轨(hlc3 的 EMA 20,2 x ATR),而当前收盘价已回到通道内。
下限标记
前一个收盘价高于上凯尔特纳带,而当前收盘价又回到了通道内。
下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。
如何阅读它
图中绿色线条分别代表上下两条凯特纳带,中间是指数移动平均线(EMA)。K线下方的绿色“上升”三角形表示价格收盘价低于下轨后又回到下轨内;K线上方的红色“下降”三角形则表示上轨的情况与之相反。
使用的指标
- Keltner通道(EMA 20,2 x ATR)
视图相同,但带有内置指示器: 添加 IQ Option周期为 20、偏移量为 2、平均类型为指数移动平均线的 Keltner 通道。
默认设置
| 周期 | 20 |
|---|---|
| ATR 乘数 | 2 |
每个值都是脚本设置中的一个输入项。平台提示默认关闭。
关键点
- Keltner通道是一个EMA,它有两个波段,波段大小为平均真实波幅的倍数。
- 收盘价超出通道范围意味着价格变动幅度超过了通道的正常波动范围。
- 我们不做突破本身的交易,而是等待价格再次收于通道内。
- 收盘价低于下轨,随后收盘价回升至下轨以内,则标记为“更高”;上轨则标记为“更低”。
- 标记是在蜡烛收盘后绘制的,不会重新绘制。
- 观察练习余额在价格沿区间波动时的表现。
局限性。 在强劲的趋势中,价格可能连续多次收于区间外,短暂回落后再次突破,因此回落本身并不代表趋势反转。此外,在快速上涨的市场中,中线也存在滞后现象。在投入真实资金之前,请先在模拟账户中进行测试。
完整的源代码
下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:b1d5cae25ace0e895bcff4df6ebf07695a696496750f5df5b461986d9232a117
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Keltner Re-entry v1.0.0
--
-- Keltner Channel: EMA of the typical price (hlc3) in the middle, with bands
-- set a multiple of ATR (RMA of the true range) above and below, as in the
-- official Quadcode Keltner Channels script. A close outside a band shows
-- stretched price; the next close back inside is the marked event.
--
-- HIGHER: the previous close was below the lower band and the current close
-- is back inside the channel.
-- LOWER: the previous close was above the upper band and the current close
-- is back inside the channel.
--
-- 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 Keltner Re-entry",
short_name = "IQOW KC REENT",
overlay = true
}
input_group {
"1. Keltner Channel",
channel_period = input (20, "Period (EMA and ATR)", input.integer, 2, 200),
channel_multiplier = input (2, "ATR multiplier", input.double, 0.1, 10, 0.1)
}
input_group {
"Display and advice",
channel_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",
channel_color = input { default = "#21B190", type = input.color },
middle_color = input { default = rgba(33, 177, 144, 0.6), type = input.color },
channel_fill_color = input { default = rgba(33, 177, 144, 0.08), type = input.color },
channel_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 }
}
-- Keltner Channel as in the official library script.
middle_line = ema (hlc3, channel_period)
band_offset = rma (tr, channel_period) * channel_multiplier
upper_band = middle_line + band_offset
lower_band = middle_line - band_offset
-- Current-bar scalars for the Lua rule logic.
local close_now = get_value (close, nil)
local close_previous = get_value (close [1], nil)
local upper_now = get_value (upper_band, nil)
local lower_now = get_value (lower_band, nil)
local upper_previous = get_value (upper_band [1], nil)
local lower_previous = get_value (lower_band [1], nil)
local has_history = get_value (close [channel_period], nil) ~= nil
local data_is_ready =
has_history and
close_now ~= nil and
close_previous ~= nil and
upper_now ~= nil and
lower_now ~= nil and
upper_previous ~= nil and
lower_previous ~= nil
-- "Back inside": the current close is between the two bands.
local closes_inside = data_is_ready and close_now > lower_now and close_now < upper_now
-- Event: previous close outside one band, this close back inside.
higher_setup = conditional (
closes_inside and close_previous < lower_previous
)
lower_setup = conditional (
closes_inside and close_previous > upper_previous
)
-- 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 channel_visible then
fill (upper_band, lower_band, "Keltner area", channel_fill_color)
plot (upper_band, "Upper Keltner", channel_color, channel_width)
plot (lower_band, "Lower Keltner", channel_color, channel_width)
end
if middle_visible then
plot (middle_line, "Keltner middle", middle_color, 1)
end
if signals_visible then
plot_shape (
confirmed_higher,
"KC REENT HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"KC REENT 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
更多反转脚本
- 翻转
- 自有面板
- 中级
KDJ Cross
标记 K/D 交叉点,该交叉点发生在较快的 J 线已经拉伸到 20 以下或 80 以上时。J 线首先达到极端值,因此其后的交叉点被用作计时事件。
指标: KDJ(9, 3, 3)
- 翻转
- 关于价格
- 中级
晨星RSI
当中间那根K线的RSI指标处于低位或高位时,该指标会标记出晨星和黄昏星K线形态。RSI指标有助于检查该形态是否会向相反方向发展。
指标: 晨星和昏星烛光 · RSI(14,40/60)
- 翻转
- 自有面板
- 初学者
RSI 法律
标记短线RSI(5)在突破极端区域后,收盘价回落至30或70线上方的K线。这是相关文章中提到的RSI法则,以已完成K线标记的形式呈现。
指标: RSI(5,30/70)
下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。