Syntax
Public Function UpdateSLTPOrder(vOrdId As Long, vLots As Double, Optional vSL As Object = "", Optional vTP As Object = "") As Boolean
Description
This function is used to update the manage order (SL/TP order) for a given order ID,To get result from the server, you have to consume
OnOrderTradeevent.
Parameters
Key | Description |
Manage order number to be updated value of type Long. |
|
vLots | Updated amount of lots of type Double. |
Updated amount of Stop Loss, an optional value of type Double. | |
Updated amount of Taking Profit, an optional value of type Double. |
Return value
Return true if successful,
Sample
Public Sub main () If AccountInfoInteger (ACCOUNT_LOGIN) Then Dim OrderID Dim NewLot NewLot = 2 Dim Bid Dim price Dim Point Dim piploc Price = 20 OrderID = OrderGetID (1) Symbol = ChartSymbol (0) SymbolInfoDouble cstr (Symbol), SYMBOL_BID, Bid SymbolInfoInteger cstr (Symbol),SYMBOL_PIP_LOCATION, piploc Point = 10^piploc If UpdateSLTPOrder (clng(OrderID), Cdbl(NewLot), Bid * price * Point ,"") = false then AlertMessage ErrorDescription (GetLastError ()) End IF End IF End sub
See Also