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 acceptingthe order, you have to callOnOrderTradeevent.
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