Public Function ManualCloseByHedge(AccountID As Integer, Ticket1 As Integer, Ticket2 As Integer, Amount As Double, RefAskPrice As Double, RefBidPrice As Double) As CallingResultsEnum
This function is used to close specific amount of two tickets by hedge without a need to select an account. After ManualCloseByHedge method executes the CloseByHedgeResultReceived event fires.
||Account number to close positions by the hedge for, a value of type is Integer.
||The first ticket number to be closed by the hedge, value of type is Integer.
||The second ticket number to be closed by the hedge, value of type is Integer
||A lot of amounts that will be closed, the value of type is Double.
||The Closed ask price for reference symbol, the value of type double.
||The Closed bid price for reference symbol, the value of type double.
Returns value of type CallingResultsEnum, if the request sent to the server successfully it will return SuccessResult.
Public WithEvents m_oBOAPI As CVertexFXBOAPI
PrivateSub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim result asCallingResultsEnum
Dim Pos as COOpenPosition
Dim Pos2 as COOpenPostion
Dim vAccount as COAccount
Dim vClient as COClient
vClient = m_oBOAPI.ClientByIndex(1)
vAccount = m_oBOAPI.AccountByIndex(vClient.ClientID,1)
Pos = m_oBOAPI.OpenPositionByIndex(1)
pos2 = m_oBOAPI.OpenPositionByIndex(2)
Result = m_oBOAPI.ManualCloseByHedge(vAccount.AccountID, Pos.Ticket,Pos2.Ticket,pos.Lots, pos.RefAskPrice, pos.RefBidPrice)
VertexFX Backoffice API Index
Last Modified: 07 July 2017 04:55 PM