资金检查
extern double Lots = 0.1;if(AccountFreeMargin()<(1000*Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); }
手数计算
double calculatelot() { extern double MaxLot extern double MaxMargin = 0.3; lot=NormalizeDouble(MaxMargin * AccountBalance()/AccountLeverage(),1); if(lot<0.1) lot=0.1; if(lot>MaxLot) lot=MaxLot; return(lot); }