Knowledgebase:
UpdateSLTPOrder
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 21 October 2018 08:33 AM

Syntax

Public Function UpdateSLTPOrder(vOrdId As Long, vLots As Double, Optional vSL As Object = "", Optional vTP As Object = "") As Boolean

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

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
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