Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 14 September 2020 12:52 PM


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).


Key Description 
vSellBuy Operation type, value of type ENUM_TRADE_ACTION.
SymbolName Trading symbol name, a value of type String.
vLots Amount of lots, A value of type Double.
Comment Optional value of type String used to mark the taken orders at the comment field on trade list.

Return value

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.

End If

End Sub

See Also

Back to VTL Client Script Index

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions