查看: 1320|回复: 0
打印 上一主题 下一主题

[指标分享] MACD叠加VOL

[复制链接]
跳转到指定楼层
1
 楼主| 发表于 2018-11-14 09:15:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
//------------------------------------------------------------------------
// 简称:MACDVOL
// 名称:MACD叠加VOL
// 类别: 交易指令
// 类型: 用户应用
//------------------------------------------------------------------------
Params         
        //参数定义
        Integer LongPrd(26);
        Integer ShortPrd(12);
        Integer M(9);
        Integer M1(5);
        Integer M2(10);
        Integer M3(20);
GlobalVars       
        //全局变量定义
Vars               
        //局部变量定义
Begin               
        //策略执行区
        Numeric DIFF = EMA(Close,ShortPrd) - EMA(Close,LongPrd);
        Numeric DEA = EMA(DIFF,M);
        Numeric ret = 2*(DIFF-DEA);
       
        PlotNumeric("DIFF",DIFF, DarkGreen);
        PlotNumeric("DEA",DEA,DarkBrown);
        SetOwnAxis("DIFF");
        SetOwnAxis("DEA");
        if(ret>0)
        {
                PlotBar("MACD",ret,0, True,ColorUp());
        }
        Else
        {
                PlotBar("MACD",ret,0, True,Green);
        }
        SetOwnAxis("MACD");
       
        if(Close>Open)
                PlotStickLine("VOL",Vol,0,Red);
        Else
                PlotStickLine("VOL",Vol,0,ColorDown());
               
        //PlotNumeric("MA1",MA(Vol,M1));
        //PlotNumeric("MA2",MA(Vol,M2));
        //PlotNumeric("MA3",MA(Vol,M3));
       
        PlotNumeric("持仓",OpenInt,0);
        SetOwnAxis("持仓");

End





您需要登录后才可以回帖 登录 | 注册入住  

本版积分规则

易家网  ©2015-2023  郑州期米信息技术有限公司版权所有  豫公网安备 41010502005136号 豫ICP备16010300号