Public Function NewMarketOrder(vSellBuy As ENUM_TRADE_ACTION, SymbolName As String, vLots As Double,Optional Comment As String = "") As Boolean
This function is used to make a new market order at the given trading symbol.To get a result from the server after accepted order, you have to consume OnOrderTrade event (when auto broker off) or OnPositionTrade event (when auto broker on).
||Operation type, value of type ENUM_TRADE_ACTION.
||Trading symbol name, a value of type String.
||Amount of lots, A value of type Double.
||Optional value of type String used to mark the taken orders at the comment field on trade list.
Returns true if successful otherwise, returns false. In order to get an error, call GetLastError() function.
Public Sub main()
If AccountInfoInteger(ACCOUNT_LOGIN) Then ' Check if account is selected.
MsgBox NewMarketOrder(TRADE_ACTION_BUY,"EUR/USD",1,"New Market Order") ' Returns True if buy operation was successful.
Back to VTL Client Script Index