Syntax
Public Function OrderGetInteger(PropertyID As Integer, ByRef integerVar As Variant) As Boolean
Description
This function is used to get the property information for Selected Order according to property ID value and set the result on an integerVarvariable.
Parameters
Key | Description |
PropertyID | The property to get it value, can be one of the ENUM_ORDER_PROPERTY_INTEGER |
integerVar | Received result, a value of type Integer. |
Return value
Returns true if successful. Otherwise, returns false. In order to get an error, call GetLastError() function.
Sample
Dim TradeDescription Dim OrderDescriptionPublic Sub main() Dim barNumber Dim result Dim orderId For i= 1 to OrdersTotal result=OrderSelectByIndex(Clng(i)) If Cbool(result)= TRUE Then orderId = OrderGetID(cint(i)) GetOrderType result OrderGetInteger OPERATION_TYPE_ENUM,result GetTradeAction result ' The data will be Logged in this path ...VTL10Log PrintData "Order Id is : " & CSTR(orderId) & " , Operation Type is : " & CSTR(TradeDescription) OrderGetInteger ORDER_TYPE_ENUM,result GetOrderType result ' The data will be Logged in this path ...VTL10Log PrintData "Order Id is : " & CSTR(orderId) & " , Order Type is : " & CSTR(OrderDescription) End If next End Sub Public sub GetOrderType( orderValue ) If orderValue=1 then OrderDescription="Market Order" elseif orderValue=2 then OrderDescription="Limit Order" elseif actionValue=3 then OrderDescription="SL/TP Order" else OrderDescription="Nothing" End If End Sub Public sub GetTradeAction( actionValue ) If actionValue= -2 then TradeDescription="Sell stop" elseif actionValue=2 then TradeDescription="Buy stop" elseif actionValue=-1 then TradeDescription="Sell Limit" elseif actionValue=1 then TradeDescription="Buy Limit" else OrderDescription="Nothing" End If End Sub
See Also