Comments (5)
Well, it is different for futures. There is timestamp for futures api.
https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-book-ticker-streams
{ "e":"bookTicker", // event type "u":400900217, // order book updateId "E": 1568014460893, // event time "T": 1568014460891, // transaction time "s":"BNBUSDT", // symbol "b":"25.35190000", // best bid price "B":"31.21000000", // best bid qty "a":"25.36520000", // best ask price "A":"40.66000000" // best ask qty }
from nautilus_trader.
Hi @x-zho14
Good catch, looks like this is a bug in the parsing:
def parse_to_quote_tick(
self,
instrument_id: InstrumentId,
ts_init: int,
) -> QuoteTick:
return QuoteTick(
instrument_id=instrument_id,
bid_price=Price.from_str(self.b),
ask_price=Price.from_str(self.a),
bid_size=Quantity.from_str(self.B),
ask_size=Quantity.from_str(self.A),
ts_event=ts_init, # <---
ts_init=ts_init,
)
from nautilus_trader.
I think I can see why it was done this way though, looks like for this websocket message there isn't a timestamp for the individual events - so we'll have to parse something else.
{
"u":400900217, // order book updateId
"s":"BNBUSDT", // symbol
"b":"25.35190000", // best bid price
"B":"31.21000000", // best bid qty
"a":"25.36520000", // best ask price
"A":"40.66000000" // best ask qty
}
https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
from nautilus_trader.
The code I run is on binance-futures. Thanks a lot for your reply!
from nautilus_trader.
Now fixed on develop
branch from 2f08599.
We're capturing that T
event time now (scaled up from milliseconds to nanoseconds), just for Binance Futures.
I don't have a great solution for Spot right now, so that will continue use the ts_init
.
from nautilus_trader.
Related Issues (20)
- Addition of Sequence Number in QuoteTick HOT 2
- Polygon.io integration HOT 1
- Sandbox: Error on applying OrderFilled due to incorrect venu_order_id HOT 5
- Sandbox: fills are applied multiple times to the same limit order HOT 10
- Timer is panicking when calling `set_time_alert_ns` HOT 9
- Sandbox: fills are generated by internally aggregated bars instead of quote/ticks HOT 4
- Get radis error in trimming stream HOT 8
- Incorrect import for OrderBookImbalance example strategy HOT 1
- Low level backtest in documentation needs some adjustments so it works straight away HOT 2
- Cannot pull out account information in SANDBOX mode HOT 4
- Improve error message when no tick scheme for instrument HOT 3
- Multi-currency support for SANDBOX mode HOT 1
- Orders accepted and not filled in SANDBOX HOT 10
- Latency modeling for sandbox/real-time HOT 1
- Highlevel api tutorial document bugs HOT 1
- Invalid size precision for fill 5 when instrument size precision is 6, on 1.194.0 HOT 4
- Documentation - clang is a "From Source" installation dependency HOT 2
- Backtest in streaming mode doesn't work HOT 6
- How to handle orderbook snapshots HOT 10
- Binance missing candles HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nautilus_trader.