编译无错,不能下单调试,求大神指导
//+------------------------------------------------------------------+ //| TJW-MACD.mq4 | //| QQ;9393447 | //| 15698855297 | //+------------------------------------------------------------------+ #property copyright "QQ;9393447" #property link "15698855297" #property version "1.00" #property strict //--- input paramete //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int onInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void onDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void onTick(void) { double MA1=iMA(Symbol(),0,5,0,MODE_SMA,PRICE_CLOSE,1); double MA2=iMA(Symbol(),0,10,0,MODE_SMA,PRICE_CLOSE,1); double SIGNAL=iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0); double SIGNALP=iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1); double base=iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_MAIN,0); double baseP=iMACD(Symbol(),0,12,26,9,PRICE_CLOSE,MODE_MAIN,1); if((baseP<SIGNALP)&&(baseP>SIGNALP)) { buy(0.1,1000,2000,"b",0); } if((baseP>SIGNALP)&&(baseP<SIGNALP)) { sell(0.1,300,500,"s",0); } //return(0); } int buy(double Lots,int sun,int ying,string comment,int magic) { int com=0; int ticket=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true) { if(OrderComment()==comment) { com=1; } } } if(com==0) { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,30,Ask-sun*Point,Ask+ying*Point,comment,magic,0,clrRed); } return(ticket); } int sell(double Lots,int sun,int ying,string comment,int magic) { int com=0; int ticket=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true) { if(OrderComment()==comment) { com=1; } } } if(com==0) { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,30,Bid+sun*Point,Bid-ying*Point,comment,magic,0,clrGreen); } return(ticket); } |
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1
本作者推荐供应货源 进入商铺>>
-
了解更多外汇信息
微信扫描关注
-
用户反馈