Syntax
Public Function UpdateSLTPOrder(OrderID As Long, Lots As Double, Optional SL As Object = "", Optional TP As Object = "", Optional TransTag As String = "") As CallingResultsEnum
Description
This function is used to update SL/TP order. A user account must be selected before using this method. After UpdateSLTPOrder method executes the UpdateSLTPOrderResult event fire
Parameters
Part |
Description |
OrderID |
Associated order number to update,value of type Integer |
Lots |
Amount of lots,value of type |
SL |
Stop loss amount ,optional object |
TP |
Take profit amount,optional object |
TransTag |
String value is used to mark the update SLTP order operation 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.
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 CallingResultsEnum
Dim vOrder As COOrder = m_oBOAPI.OrderByIndex(1)
result= m_oBOAPI.UpdateSLTPOrder(vOrder.OrderID, vOrder.Lots, vOrder.SL, vOrder.TP)
End Sub
Private Sub m_oBOAPI_UpdateSLTPOrderResult(ByRef Result As VertexFXBOAPI10.NewOrderResultEnum, ByRef OrderID As Integer, ByRef ServerTime As String) Handles m_oBOAPI.UpdateSLTPOrderResult
MsgBox(Result.ToString)
End Sub
See Also
VertexFX Backoffice API Index
|