- OrderCalcMargin
- OrderCalcProfit
- OrderCheck
- OrderSend
- OrderSendAsync
- PositionsTotal
- PositionGetSymbol
- PositionSelect
- PositionSelectByTicket
- PositionGetDouble
- PositionGetInteger
- PositionGetString
- PositionGetTicket
- OrdersTotal
- OrderGetTicket
- OrderSelect
- OrderGetDouble
- OrderGetInteger
- OrderGetString
- HistorySelect
- HistorySelectByPosition
- HistoryOrderSelect
- HistoryOrdersTotal
- HistoryOrderGetTicket
- HistoryOrderGetDouble
- HistoryOrderGetInteger
- HistoryOrderGetString
- HistoryDealSelect
- HistoryDealsTotal
- HistoryDealGetTicket
- HistoryDealGetDouble
- HistoryDealGetInteger
- HistoryDealGetString
OrderCalcProfit
The function calculates the profit for the current account, in the current market conditions, based on the parameters passed. The function is used for pre-evaluation of the result of a trade operation. The value is returned in the account currency.
bool OrderCalcProfit(
|
Parameters
action
[in] Type of the order, can be one of the two values of the ENUM_ORDER_TYPE enumeration: ORDER_TYPE_BUY or ORDER_TYPE_SELL.
symbol
[in] Symbol name.
volume
[in] Volume of the trade operation.
price_open
[in] Open price.
price_close
[in] Close price.
profit
[out] The variable, to which the calculated value of the profit will be written in case the function is successfully executed. The estimated profit value depends on many factors, and can differ in different market environments.
Return Value
The function returns true in case of success; otherwise it returns false. If an invalid order type is specified, the function will return false. In order to obtain information about the error, call GetLastError().
Example:
|
See also