Syntax
Public Function UpdateOpenPosition (TicketID As Integer, NewLots As Double, NewPrice As Double, NewType As OperationTypeEnum, NewInterest As Double, NewComment As String) As CallingResultsEnum
Description
This function is used to update the existing position. After UpdateOpenPosition method is executed the UpdateOpenPositionResult event will fire.
Parameters
Parameter |
Description |
TicketID |
Ticket order which is required to be updated, value of type is Integer |
NewLots |
Updated amount of lots, value of type is Double |
NewPrice |
Updated price value, value of type is Double |
NewType |
Updated operation type, value of type is OperationTypeEnum |
NewInterest |
Updated interest value, value of type is Double |
NewComment |
The new comment value of type is String |
Return value
Returns value of type CallingResultsEnum. If the request was sent to the server successfully, it will return SuccessResult.
Sample
Private Sub UpdatePos_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdatePos.Click
‘BOAPI is predefined variable as CVertexBOAPI
Dim Result as CallingResultsEnum
Dim vpos as COOpenposition
vpos= BOAPI.OpenPositionByIndex (1)
vSymbol = BOAPI.symbolByIndex (1)
Result = BOAPI.UpdateOpenPosition(vpos.Ticket, 1, vpos.Price, 1 , vpos.Interest, "Update open position BOAPI")
Msgbox (Result.ToString)
End sub
See Also
VertexFX Backoffice API Index
|