#property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 2 #property indicator_color1 White #property indicator_level1 0 #property indicator_color2 Red #property strict extern int FMA=12; extern int SMA=26; double buf1[]; double buf2[]; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int init(){ IndicatorBuffers(2); SetIndexBuffer(0,buf1); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(1,buf2); SetIndexStyle(1,DRAW_LINE); return(0); } int start() { int limit=Bars-IndicatorCounted(); for(int i=0; i<limit; i++) { buf1[i]=iMA(NULL,0,FMA,0,1,0,i); buf2[i]=iMA(NULL,0,SMA,0,1,0,i); } return(0); }
代码如上,求指教