Syntax
Public Function NewLimitOrder(ByVal OrderType As OperationTypeEnum, ByVal SymbolId As Integer, ByVal Lots As Double, ByVal AtPrice As Double, Optional ByVal SL As Object = "", Optional ByVal TP As Object = "",Optional ByVal Note As String = "") As CallingResultsEnum
Description
This function used to make new pending order at specific given price, After NewLimitOrder method executes the NewLimitOrderResult event fires. To get result from the server after accepted the order you have to consume OnOrderTrade event.
Parameters
Parameter |
Description |
OrderType |
Open operation type, value of type OperationTypeEnum
|
Lots |
Amount of lots , value of type Double. |
AtPrice |
Requested limit price, value of type double. |
SymbolID |
Requested limit price, value of type double. |
SL |
Stop Loss, optional value of type Double. |
TP |
Take Profit, optional value of type Double. |
Note |
To add note to comments field on trade tap at the client terminal. |
Return value
Returns value of type CallingResultsEnum. If the request sent to server successfully it will return SuccessResult.
Sample
Public Sub Main ()
Dim Result As VTLGeneral.callingResultsEnum
Dim Sym As VTLGeneral.CSymbol
Dim Price as Double = 20
Dim point1 as double= 0
Dim piploc as Integer
Sym = ClientCode.GetSymbolByID (6)
piploc=Clientcode.symbolInfoInteger(Sym.name,VTLGeneral.ENUM_SYMBOL_INFO_INTEGER.SYMBOL_PIP_LOCATION)
point1 = 10^ piploc
Result = ClientCode.NewlimitOrder (1, sym.ID, 1, Sym.Ask+price * point1, , ,"")
GUI.msgDialog (Result)
End Sub
See Also
Back to VTL Server Script Index
|