2楼 
貌似找到了些解决方法:
均线是内置系统函数iMa,所以均线的比较要先通过调用iMa算出今日和昨日的均线数值,然后进行比较,举例如下:
double MaPrev=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,1);这是昨日的均线,其中10是均线周期,最后那个1是代表昨天。
double MaNow=iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0);这是昨日的均线,其中10是均线周期,最后那个0是代表今天。
判断语句如下:
if (MaNow
韬客社区www.talkfx.co
发表于:2008-05-08 05:03只看该作者
3楼 
#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  DarkGray
#property  indicator_level1  0
extern int MY_SMA=20;
extern int SHIFT=10;
double     Ma_line;
int init()
  {
   IndicatorBuffers(1);
   SetIndexBuffer(0,Ma_line);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexDrawBegin(0,Ma_line);
   return(0);
  }
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(int i=0; i















