金城谈金 发表于 2015-5-31 14:03:28

求编程老师修复下这个指标

本帖最后由 金城谈金 于 2015-5-31 14:07 编辑

此指标是一个信号指标,但每次报警的窗口显示出一排乱码看不懂。而且声音提示非常杂乱,像收音机一样。求老师修复下//+------------------------------------------------------------------+
//|                                                   Sig_Soch.mq4 |
//|                      Copyright ?2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

extern int PerCCI=24;
extern bool Al=true;
double CCI;
double CCIold;
double ArrShift;
double BufUp[];
double BufDn[];
int s,b;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
   
   SetIndexBuffer(0, BufUp);
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 233);
   
   SetIndexBuffer(1, BufDn);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 234);
   switch (Period()) {
    case PERIOD_M1: ArrShift = Point * 5;   br<astyle="color:">ea</a>k;
    case PERIOD_M5: ArrShift = Point * 10;br<astyle="color:">ea</a>k;
    case PERIOD_M15:    ArrShift = Point * 20;br<astyle="color:">ea</a>k;
    case PERIOD_M30:    ArrShift = Point * 20;br<astyle="color:">ea</a>k;
    case PERIOD_H1: ArrShift = Point * 40;br<astyle="color:">ea</a>k;
    case PERIOD_H4: ArrShift = Point * 80;br<astyle="color:">ea</a>k;
    case PERIOD_D1: ArrShift = Point * 100; br<astyle="color:">ea</a>k;
   }
//----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                     |
//+------------------------------------------------------------------+
int deinit()
{
//----
   
//----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int i,
       Counted_bars=IndicatorCounted();
   i=Bars-Counted_bars-1;
//----
      while(i>=1)                      // 骤觌 镱 礤镱聍栩囗睇?徉疣?   
      {      
         
         CCI=iCCI(NULL,0,PerCCI,PRICE_TYPICAL,i);
         CCIold=iCCI(NULL,0,PerCCI,PRICE_TYPICAL,i+1);
         if (CCI>-100 && CCIold<-100) {BufUp=Low - ArrShift;/*if (b<2 && Al==true) {Alert(Symbol()+" CCI 妙忸痂?镱牦镟?镱 "+Close);b=b+1;s=0;}*/}
         if (CCI<100 && CCIold>100) {BufDn=High + ArrShift;/*if (s<2 && Al==true) {Alert(Symbol()+" CCI 妙忸痂?镳钿噔嚅 镱 "+Close);s=s+1;b=0;}*/}         
         i--;                        // 朽聍蛤 桧溴犟?耠邃簋泐 徉疣
               
      }
//----
   return(0);
}
//+------------------------------------------------------------------+
http://att.i520fx.com/data/attachment/forum/201503/18/024541ktkzj4ni0kcmkz9l.png

诺森 发表于 2015-5-31 19:21:27

这个是用cci来判断超买超卖的吧

bary 发表于 2015-6-1 00:31:08

代码没贴全吧?你把乱码删了就不显示乱码了。

EUR168 发表于 2016-10-8 01:04:18

一直在用.....
页: [1]
查看完整版本: 求编程老师修复下这个指标