📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    乾隆算法的 MACD

    2011-12-21 · 9747 阅读
    学了一下 模板  ,写了第一个指标,请老坛友请教。
      《MACD  标准》
      #property copyright \"liu\"
      #property link      \"\"
      
      #property indicator_buffers 4        //定义为4根线
      #property indicator_separate_window   //在附图显示
      #property indicator_color1 White      //定义各线颜色
      #property indicator_color2 Yellow
      #property indicator_color3 Red
      #property indicator_color4 Lime
      double Buffer1[];   //对应数组
      double Buffer2[];
      double Buffer3[];
      double Buffer4[];
      extern int Fast = 12;//3个参数
      extern int Slow = 26;
      extern int Signal = 9;
      int init() //初始化
        {
         SetIndexStyle(0,DRAW_LINE,0,1);//前2条画‘线】
         SetIndexStyle(1,DRAW_LINE,0,1);
         SetIndexStyle(2,DRAW_HISTOGRAM,0,1);//后一个 画 柱图  两种颜色
         SetIndexStyle(3,DRAW_HISTOGRAM,0,1);
         SetIndexBuffer(0,Buffer1);//预定义对应的缓冲
         SetIndexBuffer(1,Buffer2);
         SetIndexBuffer(2,Buffer3);
         SetIndexBuffer(3,Buffer4);
         IndicatorShortName(\"MACD(\"+Fast+\",\"+Slow+\",\"+Signal+\")\");//显示名称和参数
         SetIndexLabel(0,\"DIFF\");//对各线的描述
         SetIndexLabel(1,\"EDA\");
         SetIndexLabel(2,\"MACD\");
         SetIndexLabel(3,\"MACD\");
         IndicatorDigits(Digits+2);//小数位
         return(0);
        }
      int deinit()
      {
      return(0);
      }
      int start()
        {
         int limit,counted_bars=IndicatorCounted();
         if(counted_bars0) counted_bars--;
         limit=Bars-counted_bars;
         for(int i=0; i0)
            Buffer3[i]=(Buffer1[i] - Buffer2[i])*2;
            else
            Buffer4[i]=(Buffer1[i] - Buffer2[i])*2;}}
         return(0);
        }
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 28 个

    dmpdc LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    一楼的位置好啊..  

    ea大师 LV15

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    不错啊! 一个字牛啊!  

    野狗 LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    华尔街EA研发中心,最具权威的EA开发服务商  

    sky LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    怎么就没人拜我为偶像那?? ~  

    一生跟随 LV5

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    刚刚接触EA ,楼主请发份给我…  

    掘金帮 LV4

    发表于 2012-11-22 00:05:51 | 显示全部楼层

    楼上的话等于没说~~~  

    小企 LV3

    发表于 2015-1-3 05:09:20 | 显示全部楼层

    [s:136]

    付黄包岱 LV3

    发表于 2015-1-3 16:38:48 | 显示全部楼层

    看看,看看。谢谢。你要发,我也要发。

    离孩农高会 LV3

    发表于 2015-1-4 18:29:40 | 显示全部楼层

    看看什么EA,,,
    123下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服