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

Class to handle trade requests. More...

+ Inheritance diagram for Request:
+ Collaboration diagram for Request:

Public Types

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

 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

string symbol
 
double lotSize
 
ulong takeProfit
 
ulong stopLoss
 
ulong deviationTrade
 
ulong magicNumber
 
RoundVolume roundVolume
 
CalcStop calcStop
 

Detailed Description

Class to handle trade requests.

Member Enumeration Documentation

◆ ENUM_ORDER_PENDING_TYPE

Enum for pending order types.

Enumerator
ORDER_PENDING_TYPE_BUY 

Buy pending order type

ORDER_PENDING_TYPE_SELL 

Sell pending order type

◆ ENUM_PRIVATE_ATR_DOUBLE

Enum for private double attributes.

◆ ENUM_PRIVATE_ATR_STRING

Enum for private string attributes.

◆ ENUM_PRIVATE_ATR_ULONG

Enum for private ulong attributes.

Constructor & Destructor Documentation

◆ Request()

Request::Request ( )
inline

Default constructor for the Request class.

Member Function Documentation

◆ BuildCheckPosition()

void Request::BuildCheckPosition ( MqlTradeRequest & request,
ENUM_POSITION_TYPE type,
ENUM_ORDER_TYPE_FILLING filling )

Builds a check position.

Parameters
requestTrade request structure.
typePosition type.
fillingOrder filling type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildPending()

void Request::BuildPending ( MqlTradeRequest & request,
ENUM_ORDER_PENDING_TYPE type,
ENUM_ORDER_TYPE_FILLING filling,
double price )

Builds a pending order.

Parameters
requestTrade request structure.
typePending order type.
fillingOrder filling type.
pricePrice for the pending order.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildPendingOrPosition()

void Request::BuildPendingOrPosition ( MqlTradeRequest & request,
ENUM_ORDER_PENDING_TYPE type,
ENUM_ORDER_TYPE_FILLING filling,
double price )

Builds a pending order or position.

Parameters
requestTrade request structure.
typePending order type.
fillingOrder filling type.
pricePrice for the pending order.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildPosition()

void Request::BuildPosition ( MqlTradeRequest & request,
ENUM_POSITION_TYPE type,
ENUM_ORDER_TYPE_FILLING filling )

Builds a position.

Parameters
requestTrade request structure.
typePosition type.
fillingOrder filling type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPrivateAtr() [1/3]

double Request::GetPrivateAtr ( ENUM_PRIVATE_ATR_DOUBLE atr)

Gets the private double attribute.

Parameters
atrAttribute to get.
Returns
The requested attribute value.

◆ GetPrivateAtr() [2/3]

string Request::GetPrivateAtr ( ENUM_PRIVATE_ATR_STRING atr)

Gets the private string attribute.

Parameters
atrAttribute to get.
Returns
The requested attribute value.

◆ GetPrivateAtr() [3/3]

ulong Request::GetPrivateAtr ( ENUM_PRIVATE_ATR_ULONG atr)

Gets the private ulong attribute.

Parameters
atrAttribute to get.
Returns
The requested attribute value.

◆ UpdateAtr()

void Request::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.

Parameters
symbol_argSymbol of the asset.
lot_size_argLot size.
take_profit_argTake profit value.
stop_loss_argStop loss value.
deviation_trade_argDeviation trade value.
magic_number_argMagic number for the order.
+ Here is the call graph for this function:

Member Data Documentation

◆ calcStop

CalcStop Request::calcStop

Instance of CalcStop class

◆ deviationTrade

ulong Request::deviationTrade

◆ lotSize

double Request::lotSize

Lot size for the order

◆ magicNumber

ulong Request::magicNumber

Various parameters for the order

◆ roundVolume

RoundVolume Request::roundVolume

Instance of RoundVolume class

◆ stopLoss

ulong Request::stopLoss

◆ symbol

string Request::symbol

Symbol of the asset

◆ takeProfit

ulong Request::takeProfit

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