资源描述:
《自己写的能赚钱的ea》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、//+------------------------------------------------------------------+//
2、ma+atr.mq4
3、//
4、lipju
5、//
6、
7、//+------------------------------------------------------------------+#propertycopyright"lipju"#propertylink""#defineMAGICMA20101205externdoublemylot;externdoublemyequ1,mye
8、qu2;//+------------------------------------------------------------------+//
9、expertstartfunction
10、//+------------------------------------------------------------------+intstart(){doublema1=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);doublema2=iMA(NULL,0,120,0,MODE_EMA,PRICE
11、_CLOSE,0);doublema3=iMA(NULL,0,40,0,MODE_SMA,PRICE_CLOSE,0);doubleatr1=iATR(NULL,0,5,0);doubleatr2=iATR(NULL,0,10,0);doubleslipp=3*Point;doublestoploss=3*atr2+slipp;doubletakeprofit=30*atr2+slipp;intmytick;//????intpos=0;doublemycloseprice;intmyordertype;intmydigit;dou
12、blemyprofit;mydigit=Digits;//----buyconditionsif(Close[1]>ma2&&atr2>0.0003){if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0)&&iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,1)13、_SIGNAL,1)){if(OrdersTotal()==0){myequ2=AccountBalance();Print("myequ1",myequ1,"myequ2",myequ2,"balance",AccountBalance());if(myequ114、CMA,0,Blue);return;}}}//----sellconditionsif(Close[1]0.0003){if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIG
15、NAL,1)){if(OrdersTotal()==0){myequ2=AccountBalance();Print("myequ1",myequ1,"myequ2",myequ2,"balance",AccountBalance());if(myequ116、,0,Red);return;}}}return(0);}