Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 14 September 2020 11:01 AM


Public Function CloseMarketOrder(ByRef ticket As string, ByRef lots As Double, ByRef TransTag As String) As CallingResultsEnum


This function closes an open position. The account must be selected to be able to close a market order by a selectAccount method. After CloseMarketOrder method executes the CloseOrderResult event fires.


Part Description 
Ticket Ticket number to be closed, value of type String.
lots Amount of lots, value of type Double.
TransTag Optional string value to mark the closing order when the result came from the server.

Return value

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


Private Sub Btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn.Click
       'API is a predefined variable as CVertexFXClientAPI
        Dim result As VertexFXClientAPI.CallingResultsEnum
        Dim Pos As VertexFXClientAPI10.COOpenPosition
        Pos = API.OpenPositionByIndex(1)
             result = API.CloseMarketOrder(pos.Ticket,pos.lots,"Close Ticket number" & pos.Ticket)

End Sub

See Also

VertexFX Client API 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