|
Ating for MQL5
|
Class to handle trading transactions, inheriting from Request. More...
Inheritance diagram for Transaction:
Collaboration diagram for Transaction:Public Types | |
| enum | ENUM_CHECK { CHECK_ARG_TRANSACTION_PASSED , ERR_SYMBOL_NOT_AVAILABLE , ERR_INVALID_LOT_SIZE , ERR_DEVIATION_INSUFFICIENT } |
| Enum to handle different types of check transactions. More... | |
| enum | ENUM_ORDER_TRANSACTION { ORDER_PLACED_SUCCESSFULLY = 1 , ERR_SEND_FAILED = 0 } |
| Enum to handle different types of order transactions. More... | |
| enum | ENUM_FIX_FILLING_MODE { FILLING_MODE_FOUND , ERR_FILLING_MODE_NO_FOUND , ERR_INVALID_REQUEST } |
| Enum to handle different types of fix filling modes. More... | |
Public Types inherited from Request | |
| enum | ENUM_ORDER_PENDING_TYPE { ORDER_PENDING_TYPE_BUY = POSITION_TYPE_BUY , ORDER_PENDING_TYPE_SELL = POSITION_TYPE_SELL } |
| Enum for pending order types. More... | |
| enum | ENUM_PRIVATE_ATR_STRING { SYMBOL } |
| Enum for private string attributes. More... | |
| enum | ENUM_PRIVATE_ATR_DOUBLE { LOT_SIZE } |
| Enum for private double attributes. More... | |
| enum | ENUM_PRIVATE_ATR_ULONG { TAKE_PROFIT , STOP_LOSS , DEVIATION_TRADE , MAGIC_NUMBER } |
| Enum for private ulong attributes. More... | |
Public Member Functions | |
| Transaction (void) | |
| Constructor for the Transaction class. | |
| ENUM_CHECK | CheckArg () |
| Checks the arguments for the transaction. | |
| void | Update () |
| Updates the transaction parameters. | |
| ENUM_FIX_FILLING_MODE | FixFillingMode () |
| Fixes the filling mode for the transaction. | |
| ENUM_ORDER_TRANSACTION | SendPosition (ENUM_POSITION_TYPE order_type) |
| Sends a position order for the transaction. | |
| ENUM_ORDER_TRANSACTION | SendPendingDefault (double open_price, ENUM_ORDER_PENDING_TYPE order_type) |
| Sends a pending order with default parameters for the transaction. | |
| ENUM_ORDER_TRANSACTION | SendPendingOrPosition (double open_price, double comparative_price, ENUM_ORDER_PENDING_TYPE order_type) |
| Sends a pending or position order for the transaction. | |
| string | EnumCheckTransactionToString (ENUM_CHECK enum_result) |
| Converts the check transaction result to a string. | |
| string | EnumOrderTransactionToString (ENUM_ORDER_TRANSACTION enum_result) |
| Converts the order transaction result to a string. | |
| string | EnumFixFillingModeToString (ENUM_FIX_FILLING_MODE enum_result) |
| Converts the fix filling mode result to a string. | |
| string | CommentToShow () |
| Returns a formatted string with details of the transaction. | |
Public Member Functions inherited from Request | |
| Request () | |
| Default constructor for the Request class. | |
| void | UpdateAtr (string symbol_arg, double lot_size_arg, uint take_profit_arg, uint stop_loss_arg, uint deviation_trade_arg, ulong magic_number_arg) |
| Updates the attributes of the request. | |
| string | GetPrivateAtr (ENUM_PRIVATE_ATR_STRING atr) |
| Gets the private string attribute. | |
| double | GetPrivateAtr (ENUM_PRIVATE_ATR_DOUBLE atr) |
| Gets the private double attribute. | |
| ulong | GetPrivateAtr (ENUM_PRIVATE_ATR_ULONG atr) |
| Gets the private ulong attribute. | |
| void | BuildCheckPosition (MqlTradeRequest &request, ENUM_POSITION_TYPE type, ENUM_ORDER_TYPE_FILLING filling) |
| Builds a check position. | |
| void | BuildPosition (MqlTradeRequest &request, ENUM_POSITION_TYPE type, ENUM_ORDER_TYPE_FILLING filling) |
| Builds a position. | |
| void | BuildPending (MqlTradeRequest &request, ENUM_ORDER_PENDING_TYPE type, ENUM_ORDER_TYPE_FILLING filling, double price) |
| Builds a pending order. | |
| void | BuildPendingOrPosition (MqlTradeRequest &request, ENUM_ORDER_PENDING_TYPE type, ENUM_ORDER_TYPE_FILLING filling, double price) |
| Builds a pending order or position. | |
Public Attributes | |
| MqlTradeRequest | tradeRequest |
| MqlTradeResult | tradeResult |
| MqlTradeCheckResult | tradeCheckResult |
Public Attributes inherited from Request | |
| string | symbol |
| double | lotSize |
| ulong | takeProfit |
| ulong | stopLoss |
| ulong | deviationTrade |
| ulong | magicNumber |
| RoundVolume | roundVolume |
| CalcStop | calcStop |
Protected Member Functions | |
| string | failSendingOrder () |
| Returns a formatted string describing the failure of sending an order. | |
Protected Attributes | |
| double | priceAsk |
| double | priceBid |
| double | tickSize |
| ENUM_ORDER_TYPE_FILLING | typeFilliingMode |
Class to handle trading transactions, inheriting from Request.
|
inline |
Constructor for the Transaction class.
| Transaction::ENUM_CHECK Transaction::CheckArg | ( | ) |
Checks the arguments for the transaction.
| string Transaction::CommentToShow | ( | ) |
Returns a formatted string with details of the transaction.
| string Transaction::EnumCheckTransactionToString | ( | ENUM_CHECK | enum_result | ) |
Converts the check transaction result to a string.
| enum_result | The result of the check transaction. |
| string Transaction::EnumFixFillingModeToString | ( | ENUM_FIX_FILLING_MODE | enum_result | ) |
Converts the fix filling mode result to a string.
| enum_result | The result of the fix filling mode. |
| string Transaction::EnumOrderTransactionToString | ( | ENUM_ORDER_TRANSACTION | enum_result | ) |
Converts the order transaction result to a string.
| enum_result | The result of the order transaction. |
|
protected |
Returns a formatted string describing the failure of sending an order.
Here is the caller graph for this function:| Transaction::ENUM_FIX_FILLING_MODE Transaction::FixFillingMode | ( | ) |
Fixes the filling mode for the transaction.
Here is the call graph for this function:| Transaction::ENUM_ORDER_TRANSACTION Transaction::SendPendingDefault | ( | double | open_price, |
| ENUM_ORDER_PENDING_TYPE | order_type ) |
Sends a pending order with default parameters for the transaction.
| open_price | The price at which the pending order will open. |
| order_type | The type of pending order. |
Here is the call graph for this function:| Transaction::ENUM_ORDER_TRANSACTION Transaction::SendPendingOrPosition | ( | double | open_price, |
| double | comparative_price, | ||
| ENUM_ORDER_PENDING_TYPE | order_type ) |
Sends a pending or position order for the transaction.
| open_price | The price at which the order will open. |
| comparative_price | The comparative price for the order. |
| order_type | The type of pending order. |
Here is the call graph for this function:| Transaction::ENUM_ORDER_TRANSACTION Transaction::SendPosition | ( | ENUM_POSITION_TYPE | order_type | ) |
Sends a position order for the transaction.
| order_type | The type of position order. |
Here is the call graph for this function:| void Transaction::Update | ( | ) |
Updates the transaction parameters.
Here is the caller graph for this function:
|
protected |
|
protected |
|
protected |
Ask price, Bid price, and Tick size for the transaction
| MqlTradeCheckResult Transaction::tradeCheckResult |
Trade check result for the transaction
| MqlTradeRequest Transaction::tradeRequest |
Trade request for the transaction
| MqlTradeResult Transaction::tradeResult |
Trade result for the transaction
|
protected |
Filling mode for the transaction