沙夫趋势周期脚本

← 全部 74 个剧本

iqow-schaff-trend-cycle.lua 5 KB · 免费,MIT 许可证

同时获取标记文件

对于价格高于约 100 的资产(例如日元货币对),此脚本的面板可能会隐藏其标记,因此也需要导入标记文件:它会在价格图表上绘制这些标记。

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

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

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

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

  • 动力泉源
  • 自有面板
  • 中级

标记 Schaff 趋势周期离开其低点区域(向上穿过 25)或高点区域(向下穿过 75)的蜡烛图。STC 是 MACD 的快速、有界版本,因此它比单独的 MACD 更早出现转折。

  • 文件 iqow-schaff-trend-cycle.lua
  • 版本 1.0.0
  • 尺寸 150 行 · 5 KB
  • 时限 燃烧时间1分钟至15分钟的蜡烛
  • 执照 麻省理工学院简介

指标面板中的标记绘制在K线价格上,因此对于价格高于100左右的资产(例如日元货币对),标记会超出面板范围。加载 沙夫趋势周期标志 在价格图表上看到相同的标记。

观看:安装并跟随练习交易。

基于合成蜡烛图绘制的沙夫趋势周期
脚本的绘制方式,以测试生成的合成蜡烛图为例进行说明。这只是标记和线条的示意图,并非真实市场数据或结果。

规则

更高标记

STC(10, 23, 50) 在一根蜡烛图上向上穿过 25;标记在前一根完成的蜡烛图上得到确认。

下限标记

STC(10, 23, 50) 在一根蜡烛图上向下穿过 75;标记在前一根完成的蜡烛图上得到确认。

下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。

如何阅读它

红线是单独面板中的 STC,绘制在 25 和 75 之间的水平线上,50 处有一条淡线。面板底部的绿色“更高”三角形表示向上穿过 25,顶部的红色“更低”三角形表示向下穿过 75。

使用的指标

  • 沙夫趋势周期(10、23、50)

视图相同,但带有内置指示器: 从以下数据中添加 Schaff 趋势周期 (10, 23, 50) IQ Option 指标列表,包含 25 级和 75 级。

默认设置

循环周期10
短期指数移动平均线23
做多EMA50
低级25
高水平75

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

关键点

  1. Schaff趋势周期以MACD为基准,并在此基础上运行双重随机指标。
  2. 结果是一条在 0 到 100 之间摆动的线,比 MACD 的摆动速度更快。
  3. 低于 25 为低区,高于 75 为高区。
  4. 向上突破 25 表示“更高”,向下突破 75 表示“更低”。
  5. 标记位于指标面板中,而不是价格蜡烛图上。
  6. 在相信它们之前,请将它们与练习账户主图表上的趋势进行比较。

局限性。 STC指标反应迅速,因此在横盘整理的市场中,它会在各个价位之间波动,产生多次交叉;在强劲的趋势行情中,它可能保持在75上方或25下方,而相反的交叉可能永远不会出现。25和75这两个价位是可调节的。在投入真实资金之前,请先在模拟账户中进行测试。

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

完整的源代码

下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:988c913b15d14a55c711aad2117b97b0297177f6c1779e8e0e3965a5f15d7875

-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW Schaff Trend Cycle v1.0.0
--
-- The Schaff Trend Cycle (STC) applies a double stochastic smoothing to the
-- MACD of two EMAs. It moves between 0 and 100 faster than the MACD itself.
-- Formula follows the official IQ Option Schaff Trend Cycle indicator.
-- The oscillator is drawn in its own panel under the chart.
--
-- HIGHER: STC crosses above 25 (leaves the low zone).
-- LOWER:  STC crosses below 75 (leaves the high zone).
--
-- 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 Schaff Trend Cycle",
    short_name = "IQOW STC",
    overlay = false
}

input_group {
    "1. Schaff Trend Cycle",
    cycle_period = input (10, "Cycle period", input.integer, 2, 100),
    short_cycle = input (23, "Short EMA", input.integer, 2, 100),
    long_cycle = input (50, "Long EMA", input.integer, 3, 250)
}

input_group {
    "2. Levels",
    low_level = input (25, "Low level", input.double, 5, 45, 1, false),
    high_level = input (75, "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",
    stc_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 }
}

-- MACD of two EMAs on the close.
macd_line = ema (close, short_cycle) - ema (close, long_cycle)

-- First stochastic of the MACD, then smoothed (factor 0.5).
local smoothing_factor = 0.5
macd_low = lowest (macd_line, cycle_period)
macd_range = highest (macd_line, cycle_period) - macd_low
first_stoch = iff (macd_range > 0, ((macd_line - macd_low) / macd_range) * 100, nz (first_stoch [1]))
first_smooth = iff (na (first_smooth [1]), first_stoch, first_smooth [1] + smoothing_factor * (first_stoch - first_smooth [1]))

-- Second stochastic on the smoothed series, then smoothed again.
smooth_low = lowest (first_smooth, cycle_period)
smooth_range = highest (first_smooth, cycle_period) - smooth_low
second_stoch = iff (smooth_range > 0, ((first_smooth - smooth_low) / smooth_range) * 100, nz (second_stoch [1]))
stc_value = iff (na (stc_value [1]), second_stoch, stc_value [1] + smoothing_factor * (second_stoch - stc_value [1]))

-- Current-bar scalars for the Lua rule logic.
local stc_now = get_value (stc_value, nil)
local stc_before = get_value (stc_value [1], nil)

local settings_are_valid = short_cycle < long_cycle and low_level < high_level

local data_is_ready =
    settings_are_valid and
    stc_now ~= nil and
    stc_before ~= nil and
    get_value (stc_value [long_cycle + cycle_period * 2], nil) ~= nil

-- Event: STC crosses a level on this candle.
higher_setup = conditional (
    data_is_ready and stc_before <= low_level and stc_now > low_level
)
lower_setup = conditional (
    data_is_ready and stc_before >= high_level and stc_now < 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)
)

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 = 105, color = "#0000000", show_label = false }
hline { value = -5, color = "#0000000", show_label = false }

if lines_visible then
    plot (stc_value, "STC", stc_color, line_width)
end

if signals_visible then
    plot_shape (
        confirmed_higher,
        "STC HIGHER",
        shape_style.triangleup,
        shape_size.small,
        higher_color,
        shape_location.bottom,
        -1,
        "HIGHER",
        signal_text_color
    )

    plot_shape (
        confirmed_lower,
        "STC 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

更多动量脚本

  • 动力泉源
  • 自有面板
  • 初学者
IQOW 评分69排名#1426 个可直接进入的交易窗口 · 测试了 848,314 笔交易

终极振荡器十字

标志着终极振荡器离开超卖或超买区域。该振荡器混合了三个周期,因此其反应比单周期振荡器更加平稳。

指标: 终极振荡器(7、14、28)

  • 动力泉源
  • 自有面板
  • 中级
IQOW 评分51排名#2526 个可直接进入的交易窗口 · 测试了 2,175,030 笔交易

伍迪CCI

伍迪斯CCI指标与零轴交叉:14周期CCI指标在反向运行六根K线后反转,而速度更快的Turbo CCI指标此前已同步反转。零轴是本文用来定义趋势方向的基准线。

指标: CCI(14)· Turbo CCI(6)

  • 动力泉源
  • 上下文指示器
  • 自有面板
  • 初学者
语境无交易信号并非入学考试仅提供背景信息;没有评分标准。

价格EMA距离百分比

以百分比形式显示所选价格源高于或低于 EMA 的程度。可配置的参考区域有助于将当前距离与您选择的刻度进行比较。

指标: EMA(20)距离(百分比)

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

一般风险警告

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