Syntax
Public Function ManualCloseByHedge(AccountID As Integer, Ticket1 As Integer, Ticket2 As Integer, Amount As Double, RefAskPrice As Double, RefBidPrice As Double) As CallingResultsEnum
Description
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.
Parameters
Parameter |
Description |
AccountID |
Account number to close positions by the hedge for, a value of type is Integer. |
Ticket1 |
The first ticket number to be closed by the hedge, value of type is Integer. |
Ticket2 |
The second ticket number to be closed by the hedge, value of type is Integer |
Amount |
A lot of amounts that will be closed, the value of type is Double. |
RefAskPrice |
The Closed ask price for reference symbol, the value of type double. |
RefBidPrice |
The Closed bid price for reference symbol, the value of type double. |
Return value
Returns value of type CallingResultsEnum, if the request sent to the server successfully it will return SuccessResult.
Sample
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)
End Sub
See Also
VertexFX Backoffice API Index
Last Modified: 07 July 2017 04:55 PM
|