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


Public Function NewMarketOrder(ByVal BuySell As OpertationTypeEnum, ByVal SymbolID As Integer, ByVal Lots As String , Optional ByVal Note As string = "") As CallingResultsEnum 


This function used to create new market order (Trade on a symbol) After NewMarketOrder method executes the NewOrderResult event fires. 
To get result from the server after accepted order, you have to consume OnPositionTrade event.


Parameter  Description 
BuySell Markert order type, value of type OpertionTypeEnum
SymbolID Trading symbol ID, value of type Integer.
Lots Amount of lots, value of type Double.
Note To add note to comments field on trade tap at the client terminal 

Return value

Returns value of type CallingResultsEnum.If the request sent to the server successfully it will return SuccessResult.


   Public Sub Main () 

       Dim TradeSymbolID As VTLGeneral.CSymbol


       Dim Res as VTLGeneral.CallingResultsEnum 'It will return SuccessResult if sent to server successfully 
        Res = ClientCode.NewMarketOrder (1,TradeSymbolID.ID,0.1,"")


     End Sub

See Also

Back to VTL Server Script Index

(0 vote(s))
Not helpful

Comments (2)
Naeem Hasan
18 August 2015 06:47 AM
Thanks for the sample code, it's very helpful to understand any function.
I have another point, can we set comments on positions while opening from the script.
I can see a column 'Comments' in trade and history tab in client terminal
So, there should be a way to set some information for each position to identify whether it created by the script or traded manually.
Rawan Al Hourani
18 August 2015 09:21 AM
We are working on it , and we will updating you soon
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