顺水外汇EA交易网MT4

标题: 求高手把TS2的顾比MACD指标改成MT4的 [打印本页]

作者: xhzsy    时间: 2018-1-11 16:32
标题: 求高手把TS2的顾比MACD指标改成MT4的
这个指标是根据顾比均线计算的MACD图,下面是源码;
function Init()
    indicator:name("Guppy's Multiple Moving Average Convergence/Divergence");
    indicator:requiredSource(core.Tick);
    indicator:type(core.Oscillator);
    indicator.parameters:addColor("COLOR", "Indicator's Color", "", core.rgb(255, 0, 0));
end
local source = nil;
local GMMA = nil;
local out = nil;
local first = nil;
function Prepare()
    source = instance.source;
    local name;
    -- set the indicator name (use the short name of our indicator: GMMA)
    name = profile:id() .. "(" .. source:name() .. ")";
    instance:name(name);
    GMMA = core.indicators:create("GMMA", source);
    first = GMMA:getStream(11):first();
    out = instance:addStream("H", core.Bar, name .. ".H", "H", instance.parameters.COLOR, first);
    out:addLevel(0);
end
function Update(period, mode)
    GMMA:update(mode);
    if (period >= first) then
        local f, s;
        f = GMMA:getStream(0)[period] + GMMA:getStream(1)[period] + GMMA:getStream(2)[period] +
            GMMA:getStream(3)[period] + GMMA:getStream(4)[period] + GMMA:getStream(5)[period];
        s = GMMA:getStream(6)[period] + GMMA:getStream(7)[period] + GMMA:getStream(9)[period] +
            GMMA:getStream(9)[period] + GMMA:getStream(10)[period] + GMMA:getStream(11)[period];
        out[period] = (f - s) / s * 100;
    end
end

作者: li2816    时间: 2018-1-11 17:14
macd?
作者: xhzsy    时间: 2018-1-11 18:48

我也不知道,他指标是这么写的
[attach]21720[/attach]

作者: sun001002003    时间: 2018-1-11 19:05
一个图里加载2个指标再设置一下参数就可以了
作者: xhzsy    时间: 2018-1-11 19:57

请问,MT4怎么加载

作者: sun001002003    时间: 2018-1-11 20:38
右上角搜索顾比short,或GMMA short,MACD变色,然后转换成Ex4,放入MT4指标文件夹,打开MT4,左边找技术指标-右键-把2个附加到图表,自己再设置一下参数,再对照图上调整参数
作者: SJH    时间: 2018-1-11 22:18
謝謝分享
作者: haitao    时间: 2018-1-11 23:12
路过看看
作者: rhinogreen    时间: 2018-1-12 00:39
过来看看
作者: acong    时间: 2018-1-12 00:55

你用怎样的三斧头?分享一下

作者: 金色十月    时间: 2018-1-12 01:07
过来看看
作者: ziyoufeixiang    时间: 2018-1-12 01:47
路过看看
作者: ziyoufeixiang    时间: 2018-1-12 03:02
路过看看
作者: 雪豹魂    时间: 2018-1-12 03:59
路过看看
作者: jacke22gao    时间: 2018-1-12 05:04
这个应该是FXCM平台上才有的吧    这个有些棘手 嘻嘻




欢迎光临 顺水外汇EA交易网MT4 (http://www.waterforex.com/) Powered by Discuz! X3.2