高低点开仓及挂单的EA开仓函数

楼主  收藏   举报   帖子创建时间:  2019-05-05 13:07 回复:0 关注量:95
高低点开仓及挂单的EA开仓函数.

  1. int CheckForOpen()
  2. {int Limit=30;
  3. double L = Low[iLowest(NULL,0,MODE_LOW,PeriodX,0)];
  4. double H = High[iHighest(NULL,0,MODE_HIGH,PeriodX,0)];
  5. double Lots = MathRound(AccountBalance()/100)/1000;
  6. if((H-Bid>Limit*Point))
  7. {OrderSend(Symbol(),OP_BUY,Lots,Ask,1,0,0,"",MAGICMA,0,CLR_NONE);
  8. for(int
  9. i=1;
  10. i<5;
  11. i++){OrderSend(Symbol(),OP_BUYLIMIT,MathPow(2,i)*Lots,Ask-i*Grid*Point,1,0,0,"",MAGI
  12. CMA,0,CLR_NONE);}
  13. }
  14. if((Bid-L>Limit*Point))
  15. {OrderSend(Symbol(),OP_SELL,Lots,Bid,1,0,0,"",MAGICMA,0,CLR_NONE);
  16. for(int
  17. j=1;
  18. j<5;
  19. j++){OrderSend(Symbol(),OP_SELLLIMIT,MathPow(2,j)*Lots,Bid+j*Grid*Point,1,0,0,"",MAG
  20. ICMA,0,CLR_NONE);}
  21. }
  22. }
打赏