Knowledgebase : Technical Support > API > Client API's/VTL > VTL Client Scripts > Trade Functions
SYNTAX Public Function selectedOrder() As Long This  function is used to return the selected order number. PARAMETERS No parameter RETURN VALUE Returns order  number as value of type long, if returns zero then no selected order. Sample Pub...
SYNTAX Public Function selectedPosition() As Long This function is used to get the selected position ticket number. PARAMETERS No parameter RETURN VALUE Returns ticket  number as value of type long, if returns zero then no selected position. ...
SYNTAX Public Function CloseByHedge(Ticket1 As Long,Ticket2 As Long, Amount As Double) As Boolean   This function closes specific amount of two tickets by hedge. PARAMETERS Key Description  Ticket1 The ID of the first Ticket Ticke...
ENUM_ORDER_TYPE Value Identifer Description 1 ORDER_MARKET_DATA For market order type. 2 ORDER_LIMIT_ORDER For limit order type. 3 ORDER_SLTP_ORDER For SLTP order type. ------------------------- SEE ALSO ...
SYNTAX Public Function OrderGetInteger(PropertyID As Integer, ByRef integerVar As Variant) As Boolean This function is used to get the property information for Selected Order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/Vi...
SYNTAX Public Function CloseMultiPositions(PositionIDs As string, Lots As String) As Boolean This function is used to close multiple market orders at once.To get a result from the server, you have to consume OnOrderTrade [http://www.hybrid-solutions.c...
SYNTAX Public Function RequestManageOrders(ticket As Long) As Boolean This function is used to request all managed orders that related to specific position from the server. To get result from the server, you have to consume OnManageOrdersReceived [htt...
SYNTAX Public Function DeleteSlTpOrder(OrderID As String) As Boolean This function is used to delete a given manage order number.To get a result from the server, you have to consume OnOrderTrade [http://www.hybrid-solutions.com/support/index.php?/Know...
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 se...
SYNTAX Public Function NewSLTPOrder(Ticket As Long, Lots As Double, Optional SL As Double =0 , Optional TP As Double =0) As Boolean This function is used to create a manage order at specific ticket number.To get result from the server, you have to con...
SYNTAX Public Function CloseMarketOrder(ticketID As Long, vLots As Double) As Boolean This function is used to close the market order by given ticket number.To get a result from the server, you have to consume OnOrderTrade [http://www.hybrid-solutions...
SYNTAX Public Function OrderSelectByIndex(Index As Long) As Boolean This function is used to choose an order by the taking its index in orders list. PARAMETERS Key Description  Index Order index in the orders list, value of type Long ...
Syntax Public Function OrderLots(orderID As Long) As Double This function is used to return the order lots for a given order ID as a value of double. PARAMETERS Key Description  orderID Order number to get its amount, A value of type ...
Syntax Public Function PositionGetTicket(Index As Integer) As String This function is used to return the ticket number for a given open position index on the trade list. PARAMETERS Key Description  Index Open position index at the tra...
SYNTAX Public Function OrderType() As Integer This function is used to return the order type for selected order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1748] as ENUM_ORDER_TYPE [http://www.hybrid-solutions.com/s...
SYNTAX Public Function OrderTime() As String This function is used to return the order time for selected order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1748] as a string value. PARAMETER No Parameters. RETU...
SYNTAX Public Function OrderSymbol() As String This function is used to return symbol name for selected order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1748] as a String value. PARAMETER No parameters. RETUR...
SYNTAX Public Function OrderPrice() As Double This function is used to return the open price for selected order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1748] as a value of double. PARAMETER No parameters. ...
SYNTAX Public Function OrderGetString(propertyID As Integer, ByRef stringVar As Variant) As Boolean This function is used to get the string information for Selected Order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/...
SYNTAX Public Function OrderGetDouble(propertyID As Integer, ByRef doubleVar As Variant) As Boolean This function is used to get the property inforamtion for Selected Order [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/Vie...
SYNTAX Public Function OrderSelect(OrderID As Long) As Boolean This function is used to choose an pending order at the orders list  by taking its ID. PARAMETERS Key Description  OrderID Pinding order number to be seleced,value of typ...
SYNTAX Public Function OrdersTotal() As Integer This function is used to return the total number of pending orders on trade list. PARAMETER No parameters. RETURN VALUE Returns the total number of pending orders as a value of type Integer. S...
SYNTAX Public Function GetPositionSymbol() As String This function is used to return the position symbol name for the Selected Position [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1742]. PARAMETER No parameters....
SYNTAX Public Function GetPositionTime() As String This function is used to get open Date and Time for Selected Position [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1742]. PARAMETER No parameters. RETURN VALUE...
SYNTAX Public Function GetPositionType() As ENUM_TRADE_ACTION [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2596] This function is used to return the position operation type for Selected Position [http://www.hybrid-sol...
SYNTAX Public Function PositionGetDouble(propertyID ENUM_POSITION_PROPERTY_DOUBLE [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2595], ByRef doubleVar As Variant) As Boolean This function is used to get the position pr...
SYNTAX Public Function PositionSelect(ticketNumber As Long) As Boolean This function is used to choose an open position for a given ticket number on a trade list. PARAMETERS Key Description  ticketNumber Position number to be selected...
SYNTAX Public Function PositionGetSymbol(Index As Integer) As String This function is used to get the position symbol name for a given index to an open position on the trade list. PARAMETERS Key Description  Index The index of the ope...
SYNTAX Public Function PositionTotal() As Integer This function is used to return the number of open positions on a trade list. PARAMETERS No Parameters. RETURN VALUE Returns open positions total as a value of type Integer. SAMPLE Public ...
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 This function is used to update a given limit orde...
SYNTAX Public Function DeleteLimitOrder(OrderID As String) As Boolean This function is used to cancel the limit order by a given the order ID.To get a result from the server, you have to consume OnOrderTrade [http://www.hybrid-solutions.com/support/in...
SYNTAX Public Function NewLimitOrder(vSellBuy As ENUM_TRADE_ACTION [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2596], SymbolName As String, vLots As Double, vPrice As Double, Optional vSL As Object="", Optional vTP As ...
SYNTAX Public Function NewMarketOrder(vSellBuy As ENUM_TRADE_ACTION [http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2596], SymbolName As String, vLots As Double,Optional Comment As String = "") As Boolean This function i...
Help Desk Software by Hybrid Solutions