Click here to Skip to main content
15,895,746 members

Comments by John Robert Connolly (Top 7 by date)

John Robert Connolly 24-Jul-23 6:34am View    
awesome
John Robert Connolly 24-Jul-23 6:33am View    
YOUR AWESOMW MAN!!
John Robert Connolly 23-Jul-23 13:38pm View    
This is my classes
Public Class Instrument
Public Property symbol As String
Public Property assetType As String
End Class

Public Class OrderLegCollection
Public Property instruction As String
Public Property quantity As Integer
Public Property instrument As Instrument
End Class

Public Class PlaceOrderHope
Public Property orderType As String
Public Property session As String
Public Property duration As String
Public Property orderStrategyType As String
Public Property orderLegCollection As List(Of OrderLegCollection)
End Class
John Robert Connolly 23-Jul-23 13:29pm View    
This iswhat i have so far:
Dim donutObject As New PlaceOrderHope With {
.orderType = "SEAMLESS",
.session = "AM",
.duration = "DAY",
.orderStrategyType = "Single",
.orderLegCollection = New List(Of OrderLegCollection) From {
New OrderLegCollection With {.instruction = "BUY"},
New OrderLegCollection With {.quantity = 1},
.Instrument = New List(Of Instrument) From {
New Instrument With {.symbol = "MSFT"},
New Instrument With {.assetType} = "EQUITY"}
}
}}
John Robert Connolly 23-Jul-23 13:20pm View    
Thanks for the help!!!
I am having issues creating the json string...the string form I need is:

{
"orderType": "MARKET",
"session": "NORMAL",
"duration": "DAY",
"orderStrategyType": "SINGLE",
"orderLegCollection": [
{
"instruction": "Buy",
"quantity": 15,
"instrument": {
"symbol": "XYZ",
"assetType": "EQUITY"
}
}
]
}
I have converted it to a class but I am stuck putting it together into the correct json string
Thisi what I am getting:

"{" & vbCrLf & " ""orderType"": ""SEAMLESS""," & vbCrLf & " ""session"": ""AM""," & vbCrLf & " ""duration"": ""DAY""," & vbCrLf & " ""orderStrategyType"": ""Single""," & vbCrLf & " ""orderLegCollection"": [" & vbCrLf & " {" & vbCrLf & " ""instruction"": ""BUY""," & vbCrLf & " ""quantity"": 0," & vbCrLf & " ""instrument"": null" & vbCrLf & " }," & vbCrLf & " {" & vbCrLf & " ""instruction"": null," & vbCrLf & " ""quantity"": 1," & vbCrLf & " ""instrument"": null" & vbCrLf & " }" & vbCrLf & " ]" & vbCrLf & "}"