///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 ;
 

 

相关文章:

  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案