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

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 type CallingResultsEnum. 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 type CallingResultsEnum. If the request sent to server successfully it will return SuccessResult.

(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