iqow-bb1-bollinger.lua 5 KB · 免费,MIT 许可证
如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。
将其添加到 IQ Option 在3步骤中
- 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
- 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
- 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。
风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。
- 爆发
- 关于价格
- 初学者
标志着在两根K线收于窄布林带(偏差1)内之后,第一根收于窄布林带外的K线。它遵循相关文章中的BB1规则,即突破布林带的方向与突破方向一致。
规则
更高标记
如果前两根K线的收盘价都在布林带上轨(20,偏差1)或以下,则后一根K线的收盘价高于布林带上轨。
下限标记
如果前两根K线的收盘价都在布林带下轨(20,偏差1)之上或之下,则有一根K线的收盘价低于布林带下轨(20,偏差1)。
下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。
如何阅读它
蓝线是高于和低于20根K线均值一个标准差的上下轨,中间还有一条较浅的中间线。K线下方的绿色“更高”三角形表示收盘价刚刚高于上轨;K线上方的红色“更低”三角形表示收盘价刚刚低于下轨。
使用的指标
- 布林带(20,偏差 1)
视图相同,但带有内置指示器: 在 5 分钟日本蜡烛图上添加周期为 20、偏差为 1 的布林带。
默认设置
| 布林带 | 20 |
|---|---|
| 偏差 | 1 |
| 闭幕前,屋内燃起蜡烛 | 2 |
每个值都是脚本设置中的一个输入项。平台提示默认关闭。
关键点
- BB1 是布林带,其偏差设置为 1 而不是 2。
- 由于波动区间变窄,价格更常收于波动区间之外。
- 这条规则需要重新调整:前两根K线必须收于带内。
- 收盘价高于上轨标记为“HIGHER”,收盘价低于下轨标记为“LOWER”。
- 这篇文章在 5 分钟图表上运用了这种方法,并且偏爱趋势市场。
- 在模拟账户上进行测试,并比较趋势行情和横盘整理的走势。
局限性。 本文将BB1指标描述为一种趋势市场工具,但在横盘整理的市场中,当价格跌破窄轨后回落时,其表现可能不佳。偏差1较为狭窄,因此收盘价跌破窄轨的情况较为常见,而非极端情况。该指标跟随突破而变化,与窄轨反转指标相反。在投入真实资金之前,请先在模拟账户中进行测试。
完整的源代码
下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:9339d745e157d9a183a94c38aa1b001e1e352e0b8583031769a2efed16d152af
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW BB1 Bollinger v1.0.0
--
-- BB1 is a Bollinger Bands setup with a deviation of 1 instead of the usual 2,
-- as described in the IQOptionWiki article. Price closing outside the narrow
-- band after sitting inside it marks a push away from the average.
--
-- HIGHER: this candle closes above the upper band after the previous two
-- candles closed at or below the upper band.
-- LOWER: this candle closes below the lower band after the previous two
-- candles closed at or above the lower band.
--
-- 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 BB1 Bollinger",
short_name = "IQOW BB1",
overlay = true
}
input_group {
"1. Bollinger Bands",
bb_period = input (20, "Period", input.integer, 2, 200),
bb_deviation = input (1, "Deviation", input.double, 0.1, 5, 0.1, false),
quiet_candles = input (2, "Candles inside before the close", input.integer, 1, 5)
}
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",
band_color = input { default = "#56CEFF", type = input.color },
band_fill_color = input { default = rgba(86, 206, 255, 0.06), type = input.color },
middle_color = input { default = rgba(255, 255, 255, 0.35), 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 }
}
-- Bollinger Bands: SMA of close plus and minus deviation times stdev.
middle_band = sma (close, bb_period)
band_offset = stdev (close, bb_period) * bb_deviation
upper_band = middle_band + band_offset
lower_band = middle_band - band_offset
local close_now = get_value (close, nil)
local upper_now = get_value (upper_band, nil)
local lower_now = get_value (lower_band, nil)
local data_is_ready = close_now ~= nil and upper_now ~= nil and lower_now ~= nil
-- The earlier candles must have closed on the inner side of the band.
local was_inside_upper = data_is_ready
local was_inside_lower = data_is_ready
for back = 1, quiet_candles do
local past_close = get_value (close [back], nil)
local past_upper = get_value (upper_band [back], nil)
local past_lower = get_value (lower_band [back], nil)
if past_close == nil or past_upper == nil or past_lower == nil then
was_inside_upper = false
was_inside_lower = false
else
was_inside_upper = was_inside_upper and past_close <= past_upper
was_inside_lower = was_inside_lower and past_close >= past_lower
end
end
higher_setup = conditional (data_is_ready and close_now > upper_now and was_inside_upper)
lower_setup = conditional (data_is_ready and close_now < lower_now and was_inside_lower)
-- 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_band, lower_band, "Bollinger area", band_fill_color)
plot (upper_band, "Upper band", band_color, line_width)
plot (lower_band, "Lower band", band_color, line_width)
end
if middle_visible then
plot (middle_band, "Middle band (SMA)", middle_color, 1)
end
if signals_visible then
plot_shape (
confirmed_higher,
"BB1 HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"BB1 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
更多突破脚本
下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。