获取订单盈利总和
- double subTotalProfit()
- {
- int
- cnt,
- total = 0;
- double Profit = 0;
- for(cnt=0;cnt<OrdersTotal();cnt++)
- {
- OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
- if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&&
- (OrderMagicNumber()==MagicNumber))Profit = Profit +OrderProfit();
- }
- return(Profit);
- }
|