HistoryDealsTotal
HistoryDealsTotal
返回历史交易数量,先前调用HistoryDealsTotal(),首先有必要接收交易历史和使用HistorySelect()或者HistorySelectByPosition() 函数的订单。
int HistoryDealsTotal();返回值
整型 值。
注释
不要弄混 订单, 交易 和 仓位。 每笔交易都按照订单执行,每个仓位都是一个或多个交易的值。
示例:
//+------------------------------------------------------------------+
//| 脚本程序起始函数 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 请求账户中的全部历史
if(!HistorySelect(0, TimeCurrent()))
{
Print("HistorySelect() failed. Error ", GetLastError());
return;
}
//--- 取得列表中的交易数量并在日志中显示
int total=HistoryDealsTotal();
Print("Number of historical deals on the account: ", total);
/*
结果:
Number of historical deals on the account: 339
*/
}