///x 最后几单 double getLastProfit(int x) { HistorySelect(0,TimeCurrent()); double profit ; long ticket ; int count = 0 ; double lastProfit = 0.0 ; for(int i=HistoryDealsTotal()-1;i>=0;i--) { ticket = HistoryDealGetTicket(i); if(HistoryDealGetInteger(ticket,DEAL_ENTRY)==1) { count++ ; lastProfit += HistoryDealGetDouble(ticket,DEAL_PROFIT)+HistoryDealGetDouble(ticket,DEAL_SWAP)+HistoryDealGetDouble(ticket,DEAL_COMMISSION); if(count ==x) return lastProfit ; } } return 0 ;