BB1 布林带指数

← 全部 74 个剧本

iqow-bb1-bollinger.lua 5 KB · 免费,MIT 许可证

如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。

将其添加到 IQ Option 在3步骤中

  1. 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
  2. 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
  3. 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。

风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。

  • 爆发
  • 关于价格
  • 初学者

标志着在两根K线收于窄布林带(偏差1)内之后,第一根收于窄布林带外的K线。它遵循相关文章中的BB1规则,即突破布林带的方向与突破方向一致。

  • 文件 iqow-bb1-bollinger.lua
  • 版本 1.0.0
  • 尺寸 140 行 · 5 KB
  • 时限 5分钟蜡烛
  • 执照 麻省理工学院简介
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

每个值都是脚本设置中的一个输入项。平台提示默认关闭。

关键点

  1. BB1 是布林带,其偏差设置为 1 而不是 2。
  2. 由于波动区间变窄,价格更常收于波动区间之外。
  3. 这条规则需要重新调整:前两根K线必须收于带内。
  4. 收盘价高于上轨标记为“HIGHER”,收盘价低于下轨标记为“LOWER”。
  5. 这篇文章在 5 分钟图表上运用了这种方法,并且偏爱趋势市场。
  6. 在模拟账户上进行测试,并比较趋势行情和横盘整理的走势。

局限性。 本文将BB1指标描述为一种趋势市场工具,但在横盘整理的市场中,当价格跌破窄轨后回落时,其表现可能不佳。偏差1较为狭窄,因此收盘价跌破窄轨的情况较为常见,而非极端情况。该指标跟随突破而变化,与窄轨反转指标相反。在投入真实资金之前,请先在模拟账户中进行测试。

学习策略: 在 IQOptionWiki 上阅读完整指南 →

完整的源代码

下载的文件和预览文件指向的是同一个已审核的文件。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

更多突破脚本

  • 爆发
  • 关于价格
  • 中级
IQOW 评分2排名#5426 个可直接进入的交易窗口 · 测试了 999,260 笔交易

唐奇安海龟逃脱

当ATR高于其50周期均值时,收盘价突破前20根K线的最高价或最低价。这是一种简化的通道突破形态,遵循海龟交易策略,并利用ATR指标来判断波动性是否扩大。

指标: 唐奇安突破(20)· ATR(14)· ATR 简单移动平均线(50)

  • 爆发
  • 关于价格
  • 中级
IQOW 评分13排名#4726 个可直接进入的交易窗口 · 测试了 4,836,424 笔交易

分形混沌带断裂

标志着价格已穿过分形混沌带:上轨是最后一个已确认的分形高点,下轨是最后一个已确认的分形低点。

指标: 分形混沌带

下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。

一般风险警告

公司提供的金融产品具有高风险,可能导致您损失所有资金。 你永远不应该投资你不能承受损失的钱。
请注意,本文不提供任何投资建议。 所提供的有关过去事件或未来潜在发展的信息仅是一种意见,不能保证是真实的,包括所提供的示例。 我们相应地提醒读者。