HistoryOrdersTotal

在历史中返回订单数量。优先调用HistoryOrdersTotal(),首先需要接收使用HistorySelect()或者 HistorySelectByPosition() 函数的交易和订单历史记录。

int  HistoryOrdersTotal();

返回值

整型 值。

注释

不能把出现在客户端"工具箱"的"交易" 标签中的当前挂单和交易历史订单弄乱。取消的或者导致的交易的订单列表可以在"工具箱"客户端中的"历史记录"标签浏览。

示例:

//+------------------------------------------------------------------+
//| 脚本程序起始函数                                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- 请求账户中的全部历史
   if(!HistorySelect(0TimeCurrent()))
     {
      Print("HistorySelect() failed. Error "GetLastError());
      return;
     }
 
//--- 取得列表中的订单数量并在日志中显示
   int total=HistoryOrdersTotal();
   Print("Number of historical orders on the account: "total);
   /*
  结果:
   Number of historical orders on the account496
   */
  }

另见

HistorySelect()HistoryOrderSelect()HistoryOrderGetTicket()订单属性

OSZAR »