高低点开仓及挂单的EA开仓函数.
- int CheckForOpen()
- {int Limit=30;
- double L = Low[iLowest(NULL,0,MODE_LOW,PeriodX,0)];
- double H = High[iHighest(NULL,0,MODE_HIGH,PeriodX,0)];
- double Lots = MathRound(AccountBalance()/100)/1000;
- if((H-Bid>Limit*Point))
- {OrderSend(Symbol(),OP_BUY,Lots,Ask,1,0,0,"",MAGICMA,0,CLR_NONE);
- for(int
- i=1;
- i<5;
- i++){OrderSend(Symbol(),OP_BUYLIMIT,MathPow(2,i)*Lots,Ask-i*Grid*Point,1,0,0,"",MAGI
- CMA,0,CLR_NONE);}
- }
- if((Bid-L>Limit*Point))
- {OrderSend(Symbol(),OP_SELL,Lots,Bid,1,0,0,"",MAGICMA,0,CLR_NONE);
- for(int
- j=1;
- j<5;
- j++){OrderSend(Symbol(),OP_SELLLIMIT,MathPow(2,j)*Lots,Bid+j*Grid*Point,1,0,0,"",MAG
- ICMA,0,CLR_NONE);}
- }
- }
|