Ating for MQL5
|
Class to handle the removal of orders based on their type relative to positions. More...
Public Types | |
enum | ENUM_MODES { MODE_REMOVE_SAME_TYPE , MODE_REMOVE_OPPOSITE_TYPE } |
Enumeration to specify the mode of removal. More... | |
Public Member Functions | |
RemoveByOrderType (ENUM_MODES mode_arg=MODE_REMOVE_SAME_TYPE) | |
Constructor for the RemoveByOrderType class. | |
void | UpdateOrders () |
Updates the order arrays based on their types. | |
void | VerifyPositionAndRemove () |
Verifies positions and removes orders based on their type. | |
Public Member Functions inherited from Remove | |
Remove () | |
Default constructor for the Remove class. | |
void | UpdateAtr (ulong magic_arg, string symbol_arg) |
Updates attributes for the Remove class. | |
bool | RemovePendingOrders () |
Removes all pending orders. | |
bool | RemovePositions () |
Removes all positions. | |
Public Attributes | |
CArrayLong | buy_order_tickets |
Arrays to store order tickets for buy and sell orders. | |
CArrayLong | sell_order_tickets |
Protected Member Functions | |
void | ProcessOrder (ulong &ticket) |
Processes an order based on its ticket and mode. | |
void | HandleOrder (ulong ticket, string orderType, CArrayLong &primaryTickets, CArrayLong &secondaryTickets) |
Handles the removal of orders based on the specified type. | |
Protected Member Functions inherited from Remove | |
bool | RemoveOrdersFromCArray (CArrayLong &orders_to_delete) |
Removes orders from an array of order tickets. | |
bool | RemovePositionsFromCArray (CArrayLong &positions_to_delete) |
Removes positions from an array of position tickets. | |
void | UpdateAtrToDetect (ulong magic_arg, string symbol_arg) |
Updates attributes for DetectOrders and DetectPositions objects. | |
Additional Inherited Members | |
Protected Attributes inherited from Remove | |
CTrade | trade |
Trade object for performing trade operations. | |
DetectOrders | detectOrders |
Object for detecting orders. | |
DetectPositions | detectPositions |
Object for detecting positions. | |
ulong | magic |
Magic number for trade operations. | |
string | symbol |
Trading symbol. | |
Class to handle the removal of orders based on their type relative to positions.
RemoveByOrderType::RemoveByOrderType | ( | ENUM_MODES | mode_arg = MODE_REMOVE_SAME_TYPE | ) |
Constructor for the RemoveByOrderType class.
mode_arg | Mode of removal. |
|
protected |
Handles the removal of orders based on the specified type.
ticket | Ticket number of the order to be handled. |
orderType | Type of order to be removed. |
primaryTickets | Array containing primary tickets for removal. |
secondaryTickets | Array containing secondary tickets. |
|
protected |
Processes an order based on its ticket and mode.
ticket | Ticket number of the order. |
void RemoveByOrderType::UpdateOrders | ( | ) |
Updates the order arrays based on their types.
void RemoveByOrderType::VerifyPositionAndRemove | ( | ) |
Verifies positions and removes orders based on their type.
CArrayLong RemoveByOrderType::buy_order_tickets |
Arrays to store order tickets for buy and sell orders.
CArrayLong RemoveByOrderType::sell_order_tickets |