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


Public Function NewLimitOrder(ByVal OrderType As OperationTypeEnum, ByVal SymbolId As Integer, ByVal Lots As Double, ByVal AtPrice As Double, Optional ByVal SL As Object = "", Optional ByVal TP As Object = "",Optional ByVal Note As String = "") As CallingResultsEnum


This function used to make new pending order at specific given price, After NewLimitOrder method executes the NewLimitOrderResult event fires.
To get result from the server after accepted the order you have to consume OnOrderTrade event.


Parameter  Description 
OrderType Open operation type, value of type OperationTypeEnum
Lots Amount of lots , value of type Double.
AtPrice Requested limit price, value of type double.
SymbolID  Requested limit price, value of type double.
SL Stop Loss, optional value of type Double.
TP Take Profit, optional 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 server successfully it will return SuccessResult.


 Public Sub Main () 

       Dim Result As VTLGeneral.callingResultsEnum

       Dim Sym As VTLGeneral.CSymbol    

       Dim Price as Double = 20                           

       Dim point1 as double= 0

       Dim piploc as Integer  

      Sym = ClientCode.GetSymbolByID (6)         


      point1 = 10^ piploc

      Result = ClientCode.NewlimitOrder (1, sym.ID, 1, Sym.Ask+price * point1, , ,"")

      GUI.msgDialog (Result)


     End Sub

See Also

Back to VTL Server 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