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

楼主  收藏   举报   帖子创建时间:  2019-05-05 05:37 回复:0 关注量:716
上次一个客户拿到一个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[i+1]=Low[i+1]-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)
打赏