Knowledgebase:
OrderGetInteger
Posted by Mohammad Rahhal, Last modified by Angham Al-Banawien on 03 July 2018 03:11 PM

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 according to property ID  value and set the result on an integerVar variable.

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 OrderDescription

Public 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   ...\VTL10\Log

        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   ...\VTL10\Log

        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


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