HistoryDealsTotal

履歴内の約定数を返します。HistoryDealsTotal() を呼び出す前に HistorySelect() または HistorySelectByPosition() 関数を使用して約定と注文の履歴を受信するべきです。

int  HistoryDealsTotal();

戻り値

int 型の値

注意事項

注文約定 及び ポジションは混乱されてはなりません。 約定は注文実行の結果で、ポジションは 1 つ以上の 約定の結果の概要です。

例:

//+------------------------------------------------------------------+
//| スクリプトプログラム開始関数                                              |
//+------------------------------------------------------------------+
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
  */
 }

参照

HistorySelect()HistoryDealGetTicket() 約定プロパティ