Releases: syther-labs/nautilus_trader
NautilusTrader 1.187.0 Beta
NautilusTrader 1.187.0 Beta
Released on 9th February 2024 (UTC).
Enhancements
- Refined logging system module and writers in Rust, thanks @ayush-sb and @twitu
- Improved Interactive Brokers adapter symbology and parsing with a
strict_symbology
option, thanks @rsmb7z and @fhill2
Breaking Changes
- Reorganized configuration objects (separated into a
config
module per subpackage, with re-exports fromnautilus_trader.config
)
Fixes
- Fixed
BacktestEngine
andTrader
disposal (now properly releasing resources), thanks for reporting @davidsblom - Fixed circular import issues from configuration objects, thanks for reporting @cuberone
- Fixed unnecessary creation of log files when file logging off
NautilusTrader 1.185.0 Beta
NautilusTrader 1.185.0 Beta
Released on 26th January 2024 (UTC).
Enhancements
- Add warning log when
bypass_logging
is set true for aLIVE
context - Improved
register_serializable object
to also add type to internal_EXTERNAL_PUBLIHSABLE_TYPES
- Improved Interactive Brokers expiration contract parsing, thanks @fhill2
Breaking Changes
- Changed
StreamingConfig.include_types
type fromtuple[str]
tolist[type]
(better alignment with other type filters) - Consolidated
clock
module intocomponent
module (reduce binary wheel size) - Consolidated
logging
module intocomponent
module (reduce binary wheel size)
Fixes
- Fixed Arrow serialization of
OrderUpdated
(trigger_price
type was incorrect), thanks @benjaminsingleton - Fixed
StreamingConfig.include_types
behavior (was not being honored for instrument writers), thanks for reporting @doublier1 - Fixed
ImportableStrategyConfig
type assignment inStrategyFactory
(nautechsystems#1470), thanks @rsmb7z
NautilusTrader 1.183.0 Beta
NautilusTrader 1.183.0 Beta
Released on 12th January 2024 (UTC).
Enhancements
- Added
NautilusConfig.json_primitives
to convert object to Python dictionary with JSON primitive values - Added
InstrumentClass.BOND
- Added
MessageBusConfig
use_trader_prefix
anduse_trader_id
options (provides more control over stream names) - Added
CacheConfig.drop_instruments_on_reset
(default true to retain current behavior) - Implemented core logging interface via the
log
library, thanks @twitu - Implemented global atomic clock in Rust (improves performance and ensures properly monotonic timestamps in real-time), thanks @twitu
- Improved Interactive Brokers adapter raising docker
RuntimeError
only when needed (not when using TWS), thanks @rsmb7z - Upgraded core HTTP client to latest
hyper
andreqwest
, thanks @ayush-sb - Optimized Arrow encoding (resulting in ~100x faster writes for the Parquet data catalog)
Breaking Changes
- Changed
ParquetDataCatalog
custom data prefix fromgeneticdata_
tocustom_
(you will need to rename any catalog subdirs) - Changed
ComponentStateChanged
Arrow schema forconfig
fromstring
tobinary
- Changed
OrderInitialized
Arrow schema foroptions
fromstring
tobinary
- Changed
OrderBookDeltas
dictionary representation ofdeltas
field from JSONbytes
to a list ofdict
(standardize with all other data types) - Changed external message publishing stream name keys to be
trader-{trader_id}-{instance_id}-streams
(with options allows many traders to publish to the same streams) - Renamed all version 2 data wrangler classes with a
V2
suffix for clarity - Renamed
GenericData
toCustomData
(more accurately reflects the nature of the type) - Renamed
DataClient.subscribed_generic_data
to.subscribed_custom_data
- Renamed
MessageBusConfig.stream
to.streams_prefix
(more accurate) - Renamed
ParquetDataCatalog.generic_data
to.custom_data
- Renamed
TradeReport
toFillReport
(more conventional terminology, and more clearly separates market data from user execution reports) - Renamed
asset_type
toinstrument_class
across the codebase (more conventional terminology) - Renamed
AssetType
enum toInstrumentClass
(more conventional terminology) - Renamed
AssetClass.BOND
toAssetClass.DEBT
(more conventional terminology) - Removed
AssetClass.METAL
(not strictly an asset class, more a futures category) - Removed
AssetClass.ENERGY
(not strictly an asset class, more a futures category) - Removed
multiplier
param fromEquity
constructor (not applicable) - Removed
size_precision
,size_increment
, andmultiplier
fields fromEquity
dictionary representation (not applicable) - Removed
TracingConfig
(now redundant with new logging implementation) - Removed
Ticker
data type and associated methods (not a type which can be practically normalized and so becomes adapter specific generic data) - Moved
AssetClass.SPORTS_BETTING
toInstrumentClass.SPORTS_BETTING
Fixes
- Fixed logger thread leak, thanks @twitu
- Fixed handling of configuration objects to work with
StreamingFeatherWriter
- Fixed
BinanceSpotInstrumentProvider
fee loading key error for partial instruments load, thanks for reporting @doublier1 - Fixed Binance API key configuration parsing for testnet (was falling through to non-testnet env vars)
- Fixed TWAP execution algorithm scheduled size handling when first order should be for the entire size, thanks for reporting @pcgm-team
- Added
BinanceErrorCode.SERVER_BUSY
(-1008). Also added to the retry error codes. - Added
BinanceOrderStatus.EXPIRED_IN_MATCH
which is when an order was canceled by the exchange due self-trade prevention (STP), thanks for reporting @doublier1
NautilusTrader 1.182.0 Beta
NautilusTrader 1.182.0 Beta
Released on 23rd December 2023 (UTC).
Enhancements
- Added
CacheDatabaseFacade
andCacheDatabaseAdapter
to abstract backing technology from Python codebase - Added
RedisCacheDatabase
implemented in Rust with separate MPSC channel thread for insert, update and delete operations - Added TA-Lib integration, thanks @rsmb7z
- Added
OrderBookDelta
andOrderBookDeltas
to serializable and publishable types - Moved
PortfolioFacade
toActor
- Improved
Actor
andStrategy
usability to be more lenient to mistaken calls toclock
andlogger
from the constructor (warnings also added to docs) - Removed
redis
andhiredis
dependencies from Python codebase
Breaking Changes
- Changed configuration objects to take stronger types as these are now serializable when registered (rather than primitives)
- Changed
NautilusKernelConfig.trader_id
to typeTraderId
- Changed
BacktestDataConfig.instrument_id
to typeInstrumentId
- Changed
ActorConfig.component_id
to typeComponentId | None
- Changed
StrategyConfig.strategy_id
to typeStrategyId | None
- Changed
Instrument
,OrderFilled
andAccountState
info
field serialization due below fix (you'll need to flush your cache) - Changed
CacheConfig
to take aDatabaseConfig
(better symmetry withMessageBusConfig
) - Changed
RedisCacheDatabase
data structure for currencies from hashset to simpler key-value (you'll need to clear cache or delete all curreny keys) - Changed
Actor
state loading to now use the standardSerializer
- Renamed
register_json_encoding
toregister_config_encoding
- Renamed
register_json_decoding
toregister_config_decoding
- Removed
CacheDatabaseConfig
(due above config change) - Removed
infrastructure
subpackage (now redundant with new Rust implementation)
Fixes
- Fixed
json
encoding forCacheDatabaseAdapter
frominfo
field serialization fix below - Fixed
Instrument
,OrderFilled
andAccountState
info
field serialization to retain JSON serializable dicts (rather than double encoding and losing information) - Fixed Binance Futures
good_till_date
value whentime_in_force
not GTD, such as when strategy is managing the GTD (was incorrectly passing through UNIX milliseconds) - Fixed
Executor
handling of queued task IDs (was not discarding from queued tasks on completion) - Fixed
DataEngine
handling of order book snapshots with very small intervals (now handles as short as 20 milliseconds) - Fixed
BacktestEngine.clear_actors()
,BacktestEngine.clear_strategies()
andBacktestEngine.clear_exec_algorithms()
, thanks for reporting @davidsblom - Fixed
BacktestEngine
OrderEmulator reset, thanks @davidsblom - Fixed
Throttler.reset
and reset ofRiskEngine
throttlers, thanks @davidsblom
NautilusTrader 1.181.0 Beta
NautilusTrader 1.181.0 Beta
Released on 2nd December (UTC).
This release adds support for Python 3.12.
Enhancements
- Rewrote Interactive Brokers integration documentation, many thanks @benjaminsingleton
- Added Interactive Brokers adapter support for crypto instruments with cash quantity, thanks @benjaminsingleton
- Added
HistoricInteractiveBrokerClient
, thanks @benjaminsingleton and @limx0 - Added
DataEngineConfig.time_bars_interval_type
(determines the type of interval used for time aggregationleft-open
orright-open
) - Added
LoggingConfig.log_colors
to optionally use ANSI codes to produce colored logs (default true to retain current behavior) - Added
QuoteTickDataWrangler.process_bar_data
options foroffset_interval_ms
andtimestamp_is_close
- Added identifier generators in Rust, thanks @filipmacek
- Added
OrderFactory
in Rust, thanks @filipmacek - Added
WilderMovingAverage
in Rust, thanks @ayush-sb - Added
HullMovingAverage
in Rust, thanks @ayush-sb - Added all common identifier generators in Rust, thanks @filipmacek
- Added generic SQL database support with
sqlx
in Rust, thanks @filipmacek
Breaking Changes
- Consolidated all
data
submodules into onedata
module (reduce binary wheel size) - Moved
OrderBook
frommodel.orderbook.book
tomodel.book
(subpackage only had this single module) - Moved
Currency
frommodel.currency
tomodel.objects
(consolidating modules to reduce binary wheel size) - Moved
MessageBus
fromcommon.msgbus
tocommon.component
(consolidating modules to reduce binary wheel size) - Moved
MsgSpecSerializer
fromserialization.msgpack.serializer
toserialization.serializer
- Moved
CacheConfig
snapshot_orders
,snapshot_positions
,snapshot_positions_interval
toNautilusKernelConfig
(logical applicability) - Renamed
MsgPackSerializer
toMsgSpecSeralizer
(now handles both JSON and MsgPack formats)
Fixes
- Fixed missing
trader_id
inPosition
dictionary representation, thanks @filipmacek - Fixed conversion of fixed precision integers to floats (should be dividing to avoid rounding errors), thanks for reporting @filipmacek
- Fixed daily timestamp parsing for Interactive Brokers, thanks @benjaminsingleton
- Fixed live reconciliation trade processing for partially filled then canceled orders
- Fixed
RiskEngine
cumulative notional risk check forCurrencyPair
SELL orders on multi-currency cash accounts
NautilusTrader 1.180.0 Beta
NautilusTrader 1.180.0 Beta
Released on 3rd November 2023 (UTC).
Enhancements
- Improved internal latency for live engines by using
loop.call_soon_threadsafe(...)
- Improved
RedisCacheDatabase
client connection error handling with retries - Added
WebSocketClient
connection headers, thanks @ruthvik125 and @twitu - Added
support_contingent_orders
option for venues (to simulate venues which do not support contingent orders) - Added
StrategyConfig.manage_contingent_orders
option (to automatically manage open contingenct orders) - Added
FuturesContract.activation_utc
property which returns apd.Timestamp
tz-aware (UTC) - Added
OptionsContract.activation_utc
property which returns apd.Timestamp
tz-aware (UTC) - Added
CryptoFuture.activation_utc
property which returns apd.Timestamp
tz-aware (UTC) - Added
FuturesContract.expiration_utc
property which returns apd.Timestamp
tz-aware (UTC) - Added
OptionsContract.expiration_utc
property which returns apd.Timestamp
tz-aware (UTC) - Added
CryptoFuture.expiration_utc
property which returns apd.Timestamp
tz-aware (UTC)
Breaking Changes
- Renamed
FuturesContract.expiry_date
toexpiration_ns
(and associated params) asuint64_t
UNIX nanoseconds - Renamed
OptionsContract.expiry_date
toexpiration_ns
(and associated params) asuint64_t
UNIX nanoseconds - Renamed
CryptoFuture.expiry_date
toexpiration_ns
(and associated params) asuint64_t
UNIX nanoseconds - Changed
FuturesContract
arrow schema - Changed
OptionsContract
arrow schema - Changed
CryptoFuture
arrow schema - Transformed orders will now retain the original
ts_init
timestamp - Removed unimplemented
batch_more
option forStrategy.modify_order
- Removed
InstrumentProvider.venue
property (redundant as a provider may have many venues) - Dropped support for Python 3.9
Fixes
- Fixed
ParquetDataCatalog
file writing template, thanks @limx0 - Fixed
Binance
all orders requests which would omit order reports when using astart
param - Fixed managed GTD orders past expiry cancellation on restart (orders were not being canceled)
- Fixed managed GTD orders cancel timer on order cancel (timers were not being canceled)
- Fixed
BacktestEngine
logging error with immediate stop (caused by certain timestamps beingNone
) - Fixed
BacktestNode
exceptions during backtest runs preventing next sequential run, thanks for reporting @cavan-black - Fixed
BinanceSpotPersmission
value error by relaxing typing forBinanceSpotSymbolInfo.permissions
- Interactive Brokers adapter various fixes, thanks @rsmb7z
NautilusTrader 1.179.0 Beta
NautilusTrader 1.179.0 Beta
Released on 22nd October 2023 (UTC).
A major feature of this release is the ParquetDataCatalog
version 2, which represents months of
collective effort thanks to contributions from Brad @limx0, @twitu, @ghill2 and @davidsblom.
This will be the final release with support for Python 3.9.
Enhancements
- Added
ParquetDataCatalog
v2 supporting built-in data typesOrderBookDelta
,QuoteTick
,TradeTick
andBar
- Added
Strategy
specific order and position event handlers - Added
ExecAlgorithm
specific order and position event handlers - Added
Cache.is_order_pending_cancel_local(...)
(tracks local orders in cancel transition) - Added
BinanceTimeInForce.GTD
enum member (futures only) - Added Binance Futures support for GTD orders
- Added Binance internal bar aggregation inference from aggregated trade ticks or 1-MINUTE bars (depending on lookback window)
- Added
BinanceExecClientConfig.use_gtd
option (to remap to GTC and locally manage GTD orders) - Added package version check for
nautilus_ibapi
, thanks @rsmb7z - Added
RiskEngine
min/max instrument notional limit checks - Added
Controller
for dynamically controlling actor and strategy instances for aTrader
- Added
ReportProvider.generate_fills_report(...)
which provides a row per individual fill event, thanks @r3k4mn14r - Moved indicator registration and data handling down to
Actor
(now available forActor
) - Implemented Binance
WebSocketClient
live subscribe and unsubscribe - Implemented
BinanceCommonDataClient
retries forupdate_instruments
- Decythonized
Trader
Breaking Changes
- Renamed
BookType.L1_TBBO
toBookType.L1_MBP
(more accurate definition, as L1 is the top-level price either side) - Renamed
VenueStatusUpdate
->VenueStatus
- Renamed
InstrumentStatusUpdate
->InstrumentStatus
- Renamed
Actor.subscribe_venue_status_updates(...)
toActor.subscribe_venue_status(...)
- Renamed
Actor.subscribe_instrument_status_updates(...)
toActor.subscribe_instrument_status(...)
- Renamed
Actor.unsubscribe_venue_status_updates(...)
toActor.unsubscribe_venue_status(...)
- Renamed
Actor.unsubscribe_instrument_status_updates(...)
toActor.unsubscribe_instrument_status(...)
- Renamed
Actor.on_venue_status_update(...)
toActor.on_venue_status(...)
- Renamed
Actor.on_instrument_status_update(...)
toActor.on_instrument_status(...)
- Changed
InstrumentStatus
fields/schema and constructor - Moved
manage_gtd_expiry
fromStrategy.submit_order(...)
andStrategy.submit_order_list(...)
toStrategyConfig
(simpler and allows re-activiting any GTD timers on start)
Fixes
- Fixed
LimitIfTouchedOrder.create
(exec_algorithm_params were not being passed in) - Fixed
OrderEmulator
start-up processing of OTO contingent orders (when position from parent is open) - Fixed
SandboxExecutionClientConfig
kw_only=True
to allow importing without initializing - Fixed
OrderBook
pickling (did not include all attributes), thanks @limx0 - Fixed open position snapshots race condition (added
open_only
flag) - Fixed
Strategy.cancel_order
for orders inINITIALIZED
state and with anemulation_trigger
(was not sending command toOrderEmulator
) - Fixed
BinanceWebSocketClient
reconnect behavior (reconnect handler was not being called due event loop issue from Rust) - Fixed Binance instruments missing max notional values, thanks for reporting @AnthonyVince and thanks for fixing @filipmacek
- Fixed Binance Futures fee rates for backtesting
- Fixed
Timer
missing condition check for non-positive intervals - Fixed
Condition
checks involving integers, was previously defaulting to 32-bit and overflowing - Fixed
ReportProvider.generate_order_fills_report(...)
which was missing partial fills for orders not in a finalFILLED
status, thanks @r3k4mn14r
NautilusTrader 1.178.0 Beta
NautilusTrader 1.178.0 Beta
Released on 2nd September 2023 (UTC).
Enhancements
None
Breaking Changes
None
Fixes
- Fixed
OrderBookDelta.clear
method (where thesequence
field was swapped withflags
causing an overflow) - Fixed
OrderManager
OTO contingency handling on fills - Fixed
OrderManager
duplicate order canceled events (race condition when processing contingencies) - Fixed
Cache
loading of initialized emulated orders (were not being correctly indexed as emulated) - Fixed Binance order book subscriptions for deltas at full depth (was not requesting initial snapshot), thanks for reporting @doublier1
NautilusTrader 1.177.0 Beta
NautilusTrader 1.177.0 Beta
Released on 26th August 2023 (UTC).
This release includes a large breaking change to quote tick bid and ask price property and
parameter naming. This was done in the interest of maintaining our generally explicit naming
standards, and has caused confusion for some users in the past. Data using 'bid' and 'ask' columns should
still work with the legacy data wranglers, as columns are renamed under the hood to accommodate
this change.
Enhancements
- Added
ActorExecutor
withActor
API for creating and running threaded tasks in live environments - Added
OrderEmulated
event and associatedOrderStatus.EMULATED
enum variant - Added
OrderReleased
event and associatedOrderStatus.RELEASED
enum variant - Added
BacktestVenueConfig.use_position_ids
option (default true to retain current behavior) - Added
Cache.exec_spawn_total_quantity(...)
convenience method - Added
Cache.exec_spawn_total_filled_qty(...)
convenience method - Added
Cache.exec_spawn_total_leaves_qty(...)
convenience method - Added
WebSocketClient.send_text
, thanks @twitu - Implemented string interning for
TimeEvent
Breaking Changes
- Renamed
QuoteTick.bid
tobid_price
including all associated parameters (for explicit naming standards) - Renamed
QuoteTick.ask
toask_price
including all associated parameters (for explicit naming standards)
Fixes
- Fixed execution algorithm
position_id
assignment inHEDGING
mode - Fixed
OrderMatchingEngine
processing of emulated orders - Fixed
OrderEmulator
processing of exec algorithm orders - Fixed
ExecutionEngine
processing of exec algorithm orders (exec spawn IDs) - Fixed
Cache
emulated order indexing (were not being properly discarded from the set when closed) - Fixed
RedisCacheDatabase
loading of transformedLIMIT
orders - Fixed a connection issue with the IB client, thanks @dkharrat and @rsmb7z
NautilusTrader 1.176.0 Beta
NautilusTrader 1.176.0 Beta
Released on 31st July 2023 (UTC).
Enhancements
- Implemented string interning with the ustr library, thanks @twitu
- Added
SyntheticInstrument
capability, including dynamic derivation formulas - Added
Order.commissions()
convenience method (also added to state snapshot dictionaries) - Added
Cache
position and order state snapshots (configure viaCacheConfig
) - Added
CacheDatabaseConfig.timestamps_as_iso8601
to persist timestamps as ISO 8601 strings - Added
LiveExecEngineConfig.filter_position_reports
to filter position reports from reconciliation - Added
Strategy.cancel_gtd_expiry
to cancel managed GTD order expiration - Added Binance Futures support for modifying
LIMIT
orders - Added
BinanceExecClientConfig.max_retries
option (for retrying order submit and cancel requests) - Added
BinanceExecClientConfig.retry_delay
option (the delay between retry attempts) - Added
BinanceExecClientConfig.use_reduce_only
option (default true to retain current behavior) - Added
BinanceExecClientConfig.use_position_ids
option (default true to retain current behavior) - Added
BinanceExecClientConfig.treat_expired_as_canceled
option (default false to retain current behavior) - Added
BacktestVenueConfig.use_reduct_only
option (default true to retain current behaviour) - Added
MessageBus.is_pending_request(...)
method - Added
Level
API for coreOrderBook
(exposes the bid and ask levels for the order book) - Added
Actor.is_pending_request(...)
convenience method - Added
Actor.has_pending_requests()
convenience method - Added
Actor.pending_requests()
convenience method - Added
USDP
(Pax Dollar) andTUSD
(TrueUSD) stablecoins - Improved
OrderMatchingEngine
handling when no fills (an error is now logged) - Improved
Binance
live clients logging - Upgraded Cython to 3.0.0 stable
Breaking Changes
- Moved
filter_unclaimed_external_orders
fromExecEngineConfig
toLiveExecEngineConfig
- All
Actor.request_*
methods no longer take arequest_id
, but now return aUUID4
request ID - Removed
BinanceExecClientConfig.warn_gtd_to_gtd
(now always anINFO
level log) - Renamed
Instrument.native_symbol
toraw_symbol
(you must manually migrate or flush your cached instruments) - Renamed
Position.cost_currency
tosettlement_currency
(standardize terminology) - Renamed
CacheDatabaseConfig.flush
toflush_on_start
(for clarity) - Changed
Order.ts_last
to represent the UNIX nanoseconds timestamp of the last event (rather than fill)
Fixes
- Fixed
Portfolio.net_position
calculation to useDecimal
rather thanfloat
to avoid rounding errors - Fixed race condition on
OrderFactory
order identifiers generation - Fixed dictionary representation of orders for
venue_order_id
(for three order types) - Fixed
Currency
registration with core global map on creation - Fixed serialization of
OrderInitialized.exec_algorithm_params
to spec (bytes rather than string) - Fixed assignment of position IDs for contingency orders (when parent filled)
- Fixed
PENDING_CANCEL
->EXPIRED
as valid state transition (real world possibility) - Fixed fill handling of
reduce_only
orders when partially filled - Fixed Binance reconciliation which was requesting reports for the same symbol multiple times
- Fixed Binance Futures native symbol parsing (was actually Nautilus symbol values)
- Fixed Binance Futures
PositionStatusReport
parsing of position side - Fixed Binance Futures
TradeReport
assignment of position ID (was hardcoded to hedging mode) - Fixed Binance execution submitting of order lists
- Fixed Binance commission rates requests for
InstrumentProvider
- Fixed Binance
TriggerType
parsing nautechsystems#1154, thanks for reporting @davidblom603 - Fixed Binance order parsing of invalid orders in execution reports nautechsystems#1157, thanks for reporting @graceyangfan
- Fixed
BinanceOrderType
members to include undocumentedINSURANCE_FUND
, thanks for reporting @Tzumx - Extended
BinanceSpotPermissions
enum members nautechsystems#1161, thanks for reporting @davidblom603