Posted by Angham Al-Banawien, Last modified by Abdullah Almasharfah on 07 December 2018 05:47 PM


Public Function CloseMulitPositions (ByVal tickets As String, ByVal lots As String) As CallingResultsEnum.

This function is used to close multiple open positions after CloseMulitPositions method executes with acceptance the CloseOrderResult. To get the result from the server after accepting the order, you have to call OnOrderTrade event


Parameter  Description 

Open positions tickets numbers to be closed delaminate by (,). Value of type is String.


Amount of lots for each ticket to be closed delaminate by (,). Value of type is String

Return value

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


  Public Sub main()   

        Dim Result as VTLGeneral.callingResultsEnum
      Dim Select_ as Boolean
      Dim TicketNum1 as Integer
      Dim lots1 as Double
      Dim TicketNum2 as Integer
      Dim lots2 as Double

      Select_ = ClientCode.PositionSelectByIndex (1)

      TicketNum1 = Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_INTEGER.POSITION_IDENTIFIER)
      lots1 =Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_DOUBLE.POSITION_VOLUME )                                                                

      Select_ = ClientCode.PositionSelectByIndex (2)

      TicketNum2 = Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_INTEGER.POSITION_IDENTIFIER)
      lots2 =Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_DOUBLE.POSITION_VOLUME )                                                               

   Result = ClientCode.CloseMarketOrder (TicketNum1 & “,” & TicketNum2, lots1 & “,” & lots2)

  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