Ating for MQL5
Loading...
Searching...
No Matches
RemoveByOrderType Class Reference

Class to handle the removal of orders based on their type relative to positions. More...

+ Inheritance diagram for RemoveByOrderType:
+ Collaboration diagram for RemoveByOrderType:

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.
 

Detailed Description

Class to handle the removal of orders based on their type relative to positions.

Member Enumeration Documentation

◆ ENUM_MODES

Enumeration to specify the mode of removal.

Enumerator
MODE_REMOVE_SAME_TYPE 

Remove orders of the same type as the position.

MODE_REMOVE_OPPOSITE_TYPE 

Remove orders of the opposite type of the position.

Constructor & Destructor Documentation

◆ RemoveByOrderType()

RemoveByOrderType::RemoveByOrderType ( ENUM_MODES mode_arg = MODE_REMOVE_SAME_TYPE)

Constructor for the RemoveByOrderType class.

Parameters
mode_argMode of removal.

Member Function Documentation

◆ HandleOrder()

void RemoveByOrderType::HandleOrder ( ulong ticket,
string orderType,
CArrayLong & primaryTickets,
CArrayLong & secondaryTickets )
protected

Handles the removal of orders based on the specified type.

Parameters
ticketTicket number of the order to be handled.
orderTypeType of order to be removed.
primaryTicketsArray containing primary tickets for removal.
secondaryTicketsArray containing secondary tickets.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ProcessOrder()

void RemoveByOrderType::ProcessOrder ( ulong & ticket)
protected

Processes an order based on its ticket and mode.

Parameters
ticketTicket number of the order.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateOrders()

void RemoveByOrderType::UpdateOrders ( )

Updates the order arrays based on their types.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VerifyPositionAndRemove()

void RemoveByOrderType::VerifyPositionAndRemove ( )

Verifies positions and removes orders based on their type.

+ Here is the call graph for this function:

Member Data Documentation

◆ buy_order_tickets

CArrayLong RemoveByOrderType::buy_order_tickets

Arrays to store order tickets for buy and sell orders.

◆ sell_order_tickets

CArrayLong RemoveByOrderType::sell_order_tickets

The documentation for this class was generated from the following file: