kxzhong 发表于 2011-9-13 11:54:23

第一个公式终于通过了难呀!

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
extern int变色均线=18;
double duo[];
double kong[];
int init()
    {
   SetIndexBuffer(0,duo);
   SetIndexBuffer(1,kong);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexDrawBegin(0,变色均线);
   SetIndexDrawBegin(1,变色均线);
   IndicatorDigits(Digits);
   return(0);
    }
int start()
    {
   double temp0,temp1;
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars0) counted_bars--;
   limit=Bars-counted_bars;
   for(int i=limit; i>=0; i--)
      {   
      duo<i>=EMPTY_VALUE;
      kong<i>=EMPTY_VALUE;
      temp0=iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i);
      temp1=iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i+1);
      if(iClose(NULL,0,i)>=iMA(NULL,0,变色均线,0,MODE_SMA,PRICE_CLOSE,i))
            {duo<i>=temp0; duo=temp1;}
      else{kong<i>=temp0; kong=temp1;}
      }      
   return(0);
    }

ccn无耻 发表于 2012-11-22 00:05:51

HOHO~~~~~~

music 发表于 2012-11-22 00:05:51

#无语

桃太郎 发表于 2012-11-22 00:05:51

小心大家盯上你哦

引章小姐 发表于 2012-11-22 00:05:51

好帖,有才

newer 发表于 2012-11-22 00:05:51

呵呵 哪天得看看 `~~~~

dcyhm 发表于 2012-11-22 00:05:51

老大,我好崇拜你哟

苍老师学外汇 发表于 2012-11-22 00:05:51

支持一下吧

5511880 发表于 2014-12-18 06:20:56

研究研究

goodsss241 发表于 2014-12-18 07:43:24


继续,学习了
页: [1] 2 3
查看完整版本: 第一个公式终于通过了难呀!