我用start()函数调用时,用print看不到#property indicator_chart_window /int init() { return(0); } /int deinit() { return(0); } /int start() { double buffer1; double buffer2; buffer1=iMA(NULL,0,5,0,MODE_SMMA,PRICE_MEDIAN,0); buffer2=iMA(NULL,0,8,0,MODE_SMMA,PRICE_MEDIAN,0); if(LineCrossedLine(buffer1,buffer2)==true) {Print("穿过"); Alert("穿穿"); } bool LineCrossedLine(double ExtBuffer1,double ExtBuffer2) //均线ExtBuffer1上穿均线ExtBuffer2(这个上穿是确定性的穿过) { double ma1=iMAOnArray(ExtBuffer1,0,0,0,MODE_SMA,0); double ma2=iMAOnArray(ExtBuffer2,0,0,0,MODE_SMA,0); double ma3=iMAOnArray(ExtBuffer1,0,0,0,MODE_SMA,1); double ma4=iMAOnArray(ExtBuffer2,0,0,0,MODE_SMA,1); IF(MA3小于MA4 && MA1大于等于MA2) return(true); else return(false); } 不知道错在哪。
麻烦你帮忙看看错在那?谢谢,我的邮箱是uosd321@sina.cn再次谢谢!
New article 使用 MetaTrader 4客户端初学者的常见错误 has been published:
Author: Tatyana