Thread: MQL4 Guide
View Single Post
  #13 (permalink)  
Old 06-17-2007, 06:11 PM
RickD's Avatar
RickD RickD is offline
Member
 
Join Date: Jan 2006
Location: Eastern Europe
Posts: 52
RickD is on a distinguished road
Quote:
Originally Posted by DooMGuarD
hi all

How i obtain the initial deposit in account for statistical questions?

regards
Code:
#define OP_BALANCE          6

int cnt = OrdersHistoryTotal();
for (int i=0; i<cnt; i++) 
{
  if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;

  if (OrderType() == OP_BALANCE)
  {
    Alert(OrderProfit());
    break;
  }
}
And do not forget to set Show All History option.
Reply With Quote