iqow-ema-momentum.lua 6 KB · 免费,MIT 许可证
如报名参加 IQ Option 网络交易室。Quadcode 在移动设备上不会绘制“更高”和“更低”标记。
将其添加到 IQ Option 在3步骤中
- 获取文件。 点击“获取脚本”。浏览器会保存一个 .lua 文件。
- 导入 IQ Option. 在模拟账户中打开网页交易室。点击图表左下角的波浪图标,打开“脚本”选项卡,点击“导入脚本”并选择文件。
- 将其添加到图表中。 代码会在编辑器中打开。点击代码下方的加号按钮(添加到图表)。只有在编辑完代码后才需要保存。
风险。 交易可能亏损。标记是基于图表观察得出的结论,并非预测,且此脚本已在测试数据上验证,未经实盘交易验证。请先在模拟账户上进行测试。
- 动力泉源
- 关于价格
- 初学者
标记的K线需满足两个条件:价格收盘价穿过20周期指数移动平均线(EMA(20)),且动量线(Momentum(20))穿过零轴,这两个条件必须在几个K线之内相隔。标记的K线必须同时满足这两个条件。
规则
更高标记
动量(20)向上穿过零轴,并且一根蜡烛收盘价高于EMA(20),这两个事件之间的时间间隔不超过3根蜡烛,收盘价高于EMA,动量在标记的蜡烛上高于零轴。
下限标记
动量(20)向下穿过零轴,并且一根蜡烛收盘价低于EMA(20),这两个事件之间的时间间隔不超过3根蜡烛,收盘价低于EMA,动量在标记的蜡烛上低于零轴。
下一个K线开盘后,会在完成该形态的K线上绘制一个标记。这只是一个图表观察结果,并非交易指令。
如何阅读它
黄线是 EMA(20)。K线下方的绿色高三角形表示价格已上穿 EMA,且动量指标在最近几根K线内也已上穿零轴;K线上方的红色低三角形则表示相反的情况。动量指标本身并未绘制在价格图表上。
使用的指标
- EMA(20)
- 势头 (20)
视图相同,但带有内置指示器: 添加 IQ Option's EMA(20)类型的移动平均线和动量指标(20)。
默认设置
| EMA周期 | 20 |
|---|---|
| 动量期 | 20 |
| 事件间的最大蜡烛图 | 3 |
每个值都是脚本设置中的一个输入项。平台提示默认关闭。
关键点
- 动量指标简单地将今天的收盘价与 20 根 K 线前的收盘价进行比较。
- 当动量指标上穿零轴时,价格高于 20 根 K 线前的价格。
- EMA 20 告诉我们价格收盘价是高于还是低于其近期均值。
- 我们需要这两个事件:EMA 交叉和动量零交叉,两者之间间隔不超过三根K线。
- 标记出现在构成该对蜡烛图的最后一根蜡烛上,并在下一根蜡烛图后得到确认。
- 文章警告人们要警惕横盘整理的市场,所以先查看趋势并使用练习余额。
局限性。 文章指出,这种策略适用于趋势行情,但不适用于横盘整理行情,因为在横盘整理行情中,价格和动量指标会反复交叉。文章中并未标出退出信号。在投入真实资金之前,请先在模拟账户中进行测试。
完整的源代码
下载的文件和预览文件指向的是同一个已审核的文件。SHA-256:b5f17a80480b558b225ae63d82e862119a24164bcbe0df2892a6587dca972b63
-- SPDX-License-Identifier: MIT
-- IQOptionWiki QCS Library
-- IQOW EMA Momentum v1.0.0
--
-- Combines an EMA (20) with the Momentum indicator (20), as in the related
-- article. Momentum is the close minus the close N candles ago, so crossing zero
-- means price is now above or below where it was N candles back. The EMA shows
-- which side of the average price closed. The article allows the two events to
-- happen up to 3 candles apart.
--
-- HIGHER: Momentum crosses above zero and a candle closes above the EMA, both
-- events within the last 3 candles, with both conditions true now.
-- LOWER: Momentum crosses below zero and a candle closes below the EMA, both
-- events within the last 3 candles, with both conditions true now.
--
-- 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 EMA Momentum",
short_name = "IQOW EMA MOM",
overlay = true
}
input_group {
"1. EMA and Momentum",
ema_period = input (20, "EMA period", input.integer, 2, 300),
momentum_period = input (20, "Momentum period", input.integer, 2, 200),
event_window = input (3, "Max candles between the two events", input.integer, 1, 5)
}
input_group {
"Display and advice",
ema_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",
ema_color = input { default = "#FFD166", type = input.color },
ema_width = input { default = 2, 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 }
}
trend_ema = ema (close, ema_period)
-- Momentum = close minus the close N candles ago (official Momentum indicator).
momentum_value = close - close [momentum_period]
local ema_now = get_value (trend_ema, nil)
local ema_previous = get_value (trend_ema [1], nil)
local momentum_now = get_value (momentum_value, nil)
local momentum_previous = get_value (momentum_value [1], nil)
local close_now = get_value (close, nil)
local close_previous = get_value (close [1], nil)
local data_is_ready =
get_value (close [ema_period], nil) ~= nil and
ema_now ~= nil and
ema_previous ~= nil and
momentum_now ~= nil and
momentum_previous ~= nil and
close_now ~= nil and
close_previous ~= nil
-- Events on this candle.
local momentum_up = data_is_ready and momentum_previous <= 0 and momentum_now > 0
local momentum_down = data_is_ready and momentum_previous >= 0 and momentum_now < 0
local price_over_ema = data_is_ready and close_previous <= ema_previous and close_now > ema_now
local price_under_ema = data_is_ready and close_previous >= ema_previous and close_now < ema_now
momentum_up_event = conditional (momentum_up)
momentum_down_event = conditional (momentum_down)
price_over_ema_event = conditional (price_over_ema)
price_under_ema_event = conditional (price_under_ema)
-- True when the event happened on this candle or one of the previous candles.
local function happened_recently (event_series)
for age = 0, event_window - 1 do
if get_value (event_series [age], false) then
return true
end
end
return false
end
-- Both events inside the window, and both conditions still true now. The setup
-- fires on the candle that completes the pair.
local completes_pair_up = momentum_up or price_over_ema
local completes_pair_down = momentum_down or price_under_ema
higher_setup = conditional (
data_is_ready and completes_pair_up and
close_now > ema_now and momentum_now > 0 and
happened_recently (momentum_up_event) and happened_recently (price_over_ema_event)
)
lower_setup = conditional (
data_is_ready and completes_pair_down and
close_now < ema_now and momentum_now < 0 and
happened_recently (momentum_down_event) and happened_recently (price_under_ema_event)
)
-- 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 ema_visible then
plot (trend_ema, "EMA", ema_color, ema_width)
end
if signals_visible then
plot_shape (
confirmed_higher,
"EMA MOM HIGHER",
shape_style.triangleup,
shape_size.small,
higher_color,
shape_location.belowbar,
-1,
"HIGHER",
signal_text_color
)
plot_shape (
confirmed_lower,
"EMA MOM 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
更多动量脚本
- 动力泉源
- 自有面板
- 中级
伍迪CCI
伍迪斯CCI指标与零轴交叉:14周期CCI指标在反向运行六根K线后反转,而速度更快的Turbo CCI指标此前已同步反转。零轴是本文用来定义趋势方向的基准线。
指标: CCI(14)· Turbo CCI(6)
- 动力泉源
- 上下文指示器
- 自有面板
- 初学者
价格EMA距离百分比
以百分比形式显示所选价格源高于或低于 EMA 的程度。可配置的参考区域有助于将当前距离与您选择的刻度进行比较。
指标: EMA(20)距离(百分比)
- 动力泉源
- 信号引擎
- 关于价格
- 先进的
IQ_WIKI_SCRIP_V1.1.0
这是基于完整K线图的IQOptionWiki Signals评分系统。它将RSI、MACD、布林带%B指标、五种方向性K线形态以及可选的成交量确认信息综合为一个评分,并标记出新的合格交易设置。
指标: 相对强弱指标 (RSI) · 移动平均收敛/发散指标 (MACD) · 布林带 %B(人口偏差) · 五种K线形态 · 可选图表成交量
下载全部 74 个脚本,打包成一个 ZIP 文件 · 本软件采用 MIT 许可证,按“原样”提供,不提供任何担保。IQOptionWiki 独立于…… IQ Option 平台运营商。本平台内容不构成投资建议或收益保证。