|
GTrade.Open()
Opens a trade. Only a stop loss is required. Everything else is determined automatically.
int GTrade.Open( |
Parameters
stopLoss
[in] StopLoss price. This value is required for automation.
takeProfit
[in] Optional TakeProfit price. 0 to not specify a value.
pendingPrice
[in] Optional pending price. Whether Buy-Limit, Sell-Stop, ... is calculated automatically based on the positions of the StopLoss - Pending - Current Bid. 0 to specify no value.
comment
[in] Comment on the order. Comments can facilitate access via GTrade to certain positions.
Return value
If an error occurs during the calculation, -1 is returned. If the request can be forwarded to the server, the RetCode of the broker is returned.
Note
As which type (Buy, Sell, Buy-Stop, ...) an order is opened is automatically calculated by the positions of the different prices (StopLoss, Pending, ...) to each other and to the current market price.
Example:
//--- Include Glib classes |
See also
GTrade.Init, GTrade.CloseAllOnSymbol, GTrade.CloseWithComment