Download MetaTrader 5
To add comments, please log in or register
The Market has more than 400 indicators. Try any of them!
MetaQuotes Software Corp.
Moderator
180322
MetaQuotes Software Corp. 2011.02.13 18:53 

New article Trade Events in MetaTrader 5 is published:

A monitoring of the current state of a trade account implies controlling open positions and orders. Before a trade signal becomes a deal, it should be sent from the client terminal as a request to the trade server, where it will be placed in the order queue awaiting to be processed. Accepting of a request by the trade server, deleting it as it expires or conducting a deal on its basis - all those actions are followed by trade events; and the trade server informs the terminal about them.

Generation of Trade Events

Author: MetaQuotes

NFTrader
597
NFTrader 2011.02.14 18:44  
Links are for the russian site!
NFTrader
597
NFTrader 2011.02.14 22:18  
Nice article indeed.
noonehastherighttojudgeanother
211
noonehastherighttojudgeanother 2011.04.17 02:53  
void CheckStartDateInTradeHistory()
  {
//--- initial interval, as if we started working right now
   datetime curr_start=TimeCurrent()-days*PeriodSeconds(PERIOD_D1);
//--- make sure that the start limit of the trade history has not gone 
//--- more than 1 day over intended date
   if(curr_start-start>PeriodSeconds(PERIOD_D1))
     {
      //--- we should correct the start date of history to be loaded in the cache 
      start=curr_start;
      PrintFormat("New start limit of the trade history to be loaded: start => %s",
                  TimeToString(start));

      //--- now load the trade history for the corrected period again
      HistorySelect(start,end);

      //--- correct the number of deals and orders in the history for further comparison
      history_orders=HistoryOrdersTotal();
      deals=HistoryOrdersTotal();
     }
  }

see the last two lines?

should they be:

history_orders=HistoryOrdersTotal();  // okay, looks correct

deals=HistoryDealsTotal();  //a typing error, perhaps? 

 

Umer Aziz Malik
73
Umer Aziz Malik 2012.02.13 07:01  

Thanks a lot. This really helped me solve some confusions.

 Regards,

Umer Aziz  

/
To add comments, please log in or register