Libraries: CPairedDealInfo Class

 

CPairedDealInfo Class:

A class to reconstruct trades (paired in/out deals) from history and sort them by close time.

Author: amrali

 
         double   price_open_request        = trade.PriceOpenRequest();
         double   price_close_request       = trade.PriceCloseRequest();
 
fxsaber:
You can use OrderOpen() and OrderClose() in your code to get the requested prices for opening and closing deals. 
However, I try to be as close as possible to CDealInfo class and prefer not to include them in the public interface. 
 
Unfortunately this code does not show balance type transactions, only buy/sell.
 
@Saeed Al Junaibi #: Unfortunately this code does not show balance type transactions, only buy/sell.

Obviously! As the description says, it is about the trades, not about balance.

 
Fernando Carreiro #:

Obviously! As the description says, it is about the trades, not about balance.

DEAL_TYPE shows all sorts of deals such as balance, correction etc...
CPairedDealInfo Class clearly shows those in the code

   switch(action)
     {
      case DEAL_TYPE_BUY                     : str="buy";                      break;
      case DEAL_TYPE_SELL                    : str="sell";                     break;
      case DEAL_TYPE_BALANCE                 : str="balance";                  break;
      case DEAL_TYPE_CREDIT                  : str="credit";                   break;
      case DEAL_TYPE_CHARGE                  : str="charge";                   break;
      case DEAL_TYPE_CORRECTION              : str="correction";               break;
      case DEAL_TYPE_BONUS                   : str="bonus";                    break;
      case DEAL_TYPE_COMMISSION              : str="commission";               break;
      case DEAL_TYPE_COMMISSION_DAILY        : str="daily commission";         break;
      case DEAL_TYPE_COMMISSION_MONTHLY      : str="monthly commission";       break;
      case DEAL_TYPE_COMMISSION_AGENT_DAILY  : str="daily agent commission";   break;
      case DEAL_TYPE_COMMISSION_AGENT_MONTHLY: str="monthly agent commission"; break;
      case DEAL_TYPE_INTEREST                : str="interest rate";            break;
      case DEAL_TYPE_BUY_CANCELED            : str="canceled buy";             break;
      case DEAL_TYPE_SELL_CANCELED           : str="canceled sell";            break;
      default                                : str="unknown deal type "+(string)action;

However it's not showing any of them for some reason.

CPairedDealInfo Class
CPairedDealInfo Class
  • www.mql5.com
A class to reconstruct closed trades (paired in/out deals) from history sorted by close time.
 
@Saeed Al Junaibi #: DEAL_TYPE shows all sorts of deals such as balance, correction etc... CPairedDealInfo Class clearly shows those in the code However it's not showing any of them for some reason.

As the description states, the main purpose of this code is for finding information about closed trades, not about other types of deals.

 
Fernando Carreiro #:

As the description states, the main purpose of this code is for finding information about closed trades, not about other types of deals.

Would you happen to know where I can find a code that exports all deals including balance?

I tried looking everywhere...

 
Saeed Al Junaibi #: Would you happen to know where I can find a code that exports all deals including balance? I tried looking everywhere...
If you can't find it anywhere (CodeBase, Market, Articles, Forum), then consider hiring someone to code it for you