CloseMulitPositions
Posted by Angham Al-Banawien, Last modified by Mohammad Alawneh on 08 July 2019 12:13 PM

Syntax

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


Parameters

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 
tickets

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

lots

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.


Sample

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)
   GUI.MsgDialog(Result) 

  End Sub

 


See Also


Back to VTL Server Script Index

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
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