Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 14 September 2020 12:51 PM


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


This function is used to update a given limit order, To get a result from the server, you have to consume OnOrderTrade event.


Key Description 
OrderID Order number to be updated, a value of type Long.
NewLots Amount of lots to be updated, a value of type Double.
NewPrice Updated requested price , a value of type Double.
NewSL Updated amount of Stop Loss, an optional value of type Variant.
NewTP Updated amount of Take Profit , an optional value of type Variant.
Comment Optional value of type String used to mark the updated orders at the comment field on trade list.

Return value

Return true if successful, otherwise it returns false. In order to get an error , call GetLastError() function.


 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

Back to VTL Client Script Index

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions