Knowledgebase:
ClosePosResult
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 04 July 2018 11:51 AM

Syntax

Event ClosePosResult(ByRef Result As NewOrderResultEnum, ByRef OpenTicket As Integer, TransTag as String)

This event fires after calling the ClosePosition method, with server response result.

Parameters

Part Description 
Result Server response result for the closing position of type NewOrderResultEnum
OpenTicket Associated position number that had been closed, a value of type integer.

 

Sample

 
 Public WithEvents m_oBOAPI As CVertexFXBOAPI 

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

   

        Dim result As VertexFXBOAPI11.CallingResultsEnum
     Dim vAccount As COAccount
     Dim vClient As COClient
     Dim vSym As COSymbol
     Dim Pos As COOpenPosition
     Dim AccountID As Integer
     vSym = m_oBOAPI.SymbolByIndex(1,True)
     vClient = m_oBOAPI.ClientByIndex(1)
     vAccount = m_oBOAPI.AccountByIndex(vClient.ClientID,1)
     AccountID = vAccount.AccountID 
     Pos = m_oBOAPI.OpenPositionByIndex(1)

 

     result = m_oBOAPI.ClosePosition(AccountID, Pos.Ticket, Pos.Lots, Pos.Price, Pos.RefAskPrice, 0, Pos.RefBidPrice,"TransTag","")

 

     MsgBox(result.ToString)

 

 End Sub

 Private Sub m_oBOAPI_ClosePosResult(ByRef Result As VertexFXBOAPI11.NewOrderResultEnum, ByRef OpenTicket As Integer, TransTag as String) Handles m_oBOAPI.ClosePosResult

        MsgBox(Result.ToString)

 End Sub
 


See Also


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