PDA

View Full Version : How to query the comment of a position (CPosition) in server side script ?



adheer
12-13-2015, 06:23 AM
I open a new market order using NewMarketOrder() function. I use the comment "MyRobot123" to identify orders and positions generated by my robot.

e.g.
ClientCode.NewMarketOrder(1, _symbolInfo.ID, 0.1, "MyRobot123")


How do I query the comment of each open position in the example code below ?
I noticed that the CPosition does not allow the user to query the Comment. There is no property CPosition.Comment


Dim i As Integer
Dim buyCount As Integer = 0
Dim sellCount As Integer = 0
Dim cPos As VTLGeneral.CPosition


For i = 1 to ClientCode.PositionsTotal()
cPos = ClientCode.OpenPositionByIndex(i)
' I want to query the Comment in addition to checking the SymbolName
If cPos.SymbolName = Symbol Then
If cPos.BuySell > 0 Then
buyCount = buyCount + 1
Else If cPos.BuySell < 0 Then
sellCount = sellCount + 1
End If
End If
Next

Rawan-HS
12-14-2015, 08:47 AM
Dear adheer

you can't query the comment of position by vtl server side , so we have opened ticket # 132912 to add it to our development cycle