Syntax
Public Function UpdateLimitOrder(OrderID As Long, NewLots As Double, NewPrice As Double, Optional NewSL As variant = "", Optional NewTP As Variant= "",Optional Comment As String ="") As Boolean
Description
This function is used to update a given limit order, To get a result from the server, you have to consumeOnOrderTradeevent.
Parameters
Key | Description |
OrderID | Order number to be updated, a value of type Long. |
Amount of lots to be updated, a value of type Double. | |
NewPrice | Updated requested |
NewSL | Updated amount of Stop Loss, an optional value of type Variant. |
Updated amount of |
|
Comment | Optional value of type String used to mark the updated orders at the comment field on |
Return value
Return true if successful,
Sample
Public Sub main () If AccountInfoInteger (ACCOUNT_LOGIN) Then Dim OrderID Dim NewLot NewLot = 2 Dim Bid OrderID = OrderGetID (1) Symbol = ChartSymbol (0) SymbolInfoDouble cstr (Symbol), SYMBOL_BID, Bid If UpdateLimitOrder (Cstr (OrderID), NewLot, Bid, "", "",Update Limit by VTL) = false then AlertMessage ErrorDescription (GetLastError ()) End IF End IF End sub
See Also