Skip to content

NDAX: added Trade stream (websocket) #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2019
Merged

Conversation

vslee
Copy link
Collaborator

@vslee vslee commented Oct 23, 2019

  • could not figure out how to use the JSON deserialization as the trades are returned as arrays (@Kukks if you know how...?)
  • created custom NDAXTrade subclass w/ additional properties
  • fixed BaseUrlWebSocket
  • account for null or missing marketSymbols param
  • store instrumentId in MarketSymbol.AltMarketSymbol
  • log errors in Trade and Ticker streams
  • [affects all exchanges] fixed bug in ExchangeAPIExtensions.ParseTradeComponents() where IsBuy flag was not being set

- could not figure out how to use the JSON deserialization as the trades are returned as arrays (@Kukks if you know how...?)
- created custom NDAXTrade subclass w/ additional properties
- fixed BaseUrlWebSocket
- account for null or missing marketSymbols param
- store instrumentId in MarketSymbol.AltMarketSymbol
- [affects all exchanges] fixed bug in ExchangeAPIExtensions.ParseTradeComponents<T>() where IsBuy flag was not being set
@Kukks
Copy link
Contributor

Kukks commented Oct 24, 2019

According to their docs, the trades response should be a typed json object while yours seems more of a ticker response:
[[1510719222970.21,6943.51,6890.27,6898.41,6891.16,0,6890.98,6891.98,1, 1510718681956.34]]

“EndDateTime” // POSIX format
“HighPX”
“LowPX”
“OpenPX”
“ClosePX”
“Volume”
“Bid”
“Ask”
“InstrumentId”
“BeginDateTime” // POSIX format

@Kukks
Copy link
Contributor

Kukks commented Oct 24, 2019

Trades response:

[
{
{
“OMSId”: 0,
“TradeID”: 0,
“ProductPairCode”: 0,
“Quantity”: 0,
“Price”: 0,
“Order1”: 0,
“Order2”: 0,
“TradeTime”: “0001-01-01T05:00:00Z”,
“Direction”: {
“Options”: [
“NoChange”,
“UpTick”,
“DownTick”
]
},
“TakerSide”: 0,
“Side1AccountId”: 0,
“Side2AccountId”: 0,
“Order1Side”: {
“Options”: [
“Buy”,
“Sell”,
“Short”,
“Unknown”
]
},

“Order2Side”: {
“Options”: [
Buy”,
“Sell”,
“Short”,
“Unknown”

]
},

“BlockTrade”: false, “Order1ClientId”: 0,
“Order2ClientId”: 0,
},
}
]

@vslee
Copy link
Collaborator Author

vslee commented Oct 24, 2019

Yes, I originally created the JSON deserialization object ExchangeNDAXAPI.TradeData according to their docs. However, when I looked at the actual JSON being returned, it was [[1510719222970.21,6943.51,6890.27,6898.41,6891.16,0,6890.98,6891.98,1, 1510718681956.34]]. Thus, I reverted to using the parsing in ExchangeAPIExtensions. This works, but I figured you might know how to use the JSON deserialization, which would likely be shorter (code wise).

@jjxtra
Copy link
Collaborator

jjxtra commented Oct 29, 2019

Is this ready to merge?

@vslee
Copy link
Collaborator Author

vslee commented Oct 29, 2019

Yep

@vslee vslee merged commit f761f27 into DigitalRuby:master Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants