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 OnOrderTrade event.
Parameters
Key |
Description |
vOrdId |
Manage order number to be updated value of type Long.
|
vLots |
Updated amount of lots of type Double. |
vSL |
Updated amount of Stop Loss, an optional value of type Double. |
vTP |
Updated amount of Taking Profit, an optional value of type Double. |
Return value
Return true if successful, otherwise it returns false. In order to get an error , call GetLastError() function.
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
Back to VTL Client Script Index
|