Syntax
Public Function CloseMarketOrder(ByVal Ticket As Integer, ByVal Lots As Double) As CallingResultsEnum
Description
This function used to close an open position by given the ticket number, After CloseMarkerOrder method executes with acceptance the CloseOrderResult.
Parameters
Parameter | Description |
Ticket | Open position number to be closed, value of type Integer. |
Lots | Amount of lots to be closed, value of type Double. |
Return value
Returns value of typeCallingResultsEnum. If the request sent to server successfully it will return SuccessResult
Sample
Public Sub Main () Dim Result as VTLGeneral.callingResultsEnum Dim Select_ as Boolean Dim TicketNum as Integer Dim lots as Double Select_ = ClientCode.PositionSelectByIndex (1) TicketNum = Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_INTEGER.POSITION_IDENTIFIER) lots =Clientcode.PositionGetInteger (VTLGeneral.ENUM_POSITION_PROPERTY_DOUBLE.POSITION_VOLUME) Result = ClientCode.CloseMarketOrder (TicketNum, lots) GUI.msgDialog (Result) End Sub
See Also
Back to VTL Server Script Index
Returns value of typeCallingResultsEnum. If the request sent to server successfully it will return SuccessResult.