艾凯 发表于 2011-12-18 23:41:08

怎么画指标的特殊符号(举例)

上次一个客户拿到一个CoeffoLine_Hist2.ex4指标,
但是这个指标提示功能不是很强,他说你能不能让它出信号时加一个"箭头"提示,
再加一个声音提示,但是他没有这个指标的源码.
我说:完全可以,运行的时候,你首先得加载这个指标,然后我再给你写一个指标,再把我的指标也加载进去;
我写的指标会根据你那个指标出信号时在图上加上"箭头"提示和声音提示.
下面就是我给他写的另一个指标,以此来说明下,一些特殊"箭头"是怎么画上去的.
                2008-7-28 09:51 上传
下载附件 (62.12 KB)   


      
#property indicator_chart_window   
#property indicator_buffers 2         
#property indicator_color1 Yellow      
#property indicator_color2 Red
double up[];                        
double down[];                     
int init()//初始化函数
      {
      IndicatorBuffers(2);          //要画两条线            
      SetIndexStyle(0,DRAW_ARROW,EMPTY,2); //画线类型是"箭头"形式,箭头大小是 "2"号   
      SetIndexArrow(0,233);//看见上面的特殊符号图表了吧,我这里写233,就对应上面图里的233箭头   
      SetIndexBuffer(0,up);         
      SetIndexStyle(1,DRAW_ARROW,EMPTY,2);
      SetIndexArrow(1,234);    //看见上面的特殊符号图表了吧,我这里写234,就对应上面图里的234箭头   
      SetIndexBuffer(1,down);                           
      return(0);
      }
int deinit()//反初始化函数
      {
      return(0);
      }
int start()
      {
         int i;   
         int limit;
         int counted_bars=IndicatorCounted();   
         if(counted_bars0) counted_bars--;
         limit=Bars-counted_bars;   
         for (i=limit-1;i>=0;i--)      
            {
                if((iCustom(NULL,0,"CoeffoLine_Hist2",0,i+2)=0))
                  {
                  up=Low-20*MarketInfo(Symbol(),MODE_POINT);
                  PlaySound("alert.wav");//发出1号提示音
                  
                  }
                if((iCustom(NULL,0,"CoeffoLine_Hist2",0,i+2)>0)&&(iCustom(NULL,0,"CoeffoLine_Hist2",0,i+1)

白眉大侠 发表于 2012-11-21 22:58:35

加油啊!!!!顶哦!!!!!

金银 发表于 2012-11-21 22:58:35

呵呵 那就好好玩吧~~~~

qqboy 发表于 2012-11-21 23:00:23

i love you

hdadad1 发表于 2012-11-21 23:00:23

这贴?不回都不行啊

依百分hq 发表于 2014-12-13 04:18:14

xiexiefenxiang

Wing 发表于 2014-12-18 01:55:44

支持楼主

wzs7808 发表于 2015-2-16 04:45:31

看看吧,谢谢分享

wf4831 发表于 2015-2-26 17:25:56

路过。。看下先。
页: [1]
查看完整版本: 怎么画指标的特殊符号(举例)