Releases: nautechsystems/nautilus_trader
Releases · nautechsystems/nautilus_trader
NautilusTrader 1.190.0 Beta
NautilusTrader 1.190.0 Beta
Released on 22nd March 2024 (UTC).
Enhancements
- Added Databento adapter
continuous
,parent
andinstrument_id
symbology support (will infer from symbols) - Added
DatabaseConfig.timeout
config option for timeout seconds to wait for a new connection - Added CSV tick and bar data loader params, thanks @rterbush
- Implemented
LogGuard
to ensure global logger is flushed on termination, thanks @ayush-sb and @twitu - Improved Interactive Brokers client connectivity resilience and component lifecycle, thanks @benjaminsingleton
- Improved Binance execution client ping listen key error handling and logging
- Improved Redis cache adapter and message bus error handling and logging
- Improved Redis port parsing (
DatabaseConfig.port
can now be either a string or integer) - Refactored
InteractiveBrokersEWrapper
, thanks @rsmb7z - Redact Redis passwords in strings and logs
- Upgraded
redis
crate to v0.25.2 which bumps up TLS dependencies, and turned ontls-rustls-webpki-roots
feature flag
Breaking Changes
None
Fixes
- Fixed JSON format for log file output (was missing
timestamp
andtrader_id
) - Fixed
DatabaseConfig
port JSON parsing for Redis (was always defaulting to 6379) - Fixed
ChandeMomentumOscillator
indicator divide by zero error (both Rust and Cython versions)
NautilusTrader 1.189.0 Beta
NautilusTrader 1.189.0 Beta
Released on 15th March 2024 (UTC).
Enhancements
- Implemented Binance order book snapshot rebuilds on websocket reconnect (see integration guide)
- Added additional validations for
OrderMatchingEngine
(will now raise aRuntimeError
when a price or size precision forOrderFilled
does not match the instruments precisions) - Added
LoggingConfig.use_pyo3
option for pyo3 based logging initialization (worse performance but allows visibility into logs originating from Rust) - Added
exchange
field toFuturesContract
,FuturesSpread
,OptionsContract
andOptionsSpread
(optional)
Breaking Changes
- Changed Arrow schema adding
exchange
field forFuturesContract
,FuturesSpread
,OptionsContract
andOptionsSpread
Fixes
- Fixed
MessageBus
handling of subscriptions after a topic has been published on (was previously dropping messages for these late subscribers) - Fixed
MessageBus
handling of subscriptions under certain edge cases (subscriptions list could be resized on iteration causing aRuntimeError
) - Fixed
Throttler
handling of sending messages after messages have been dropped, thanks @davidsblom - Fixed
OrderBookDelta.to_pyo3_list
using zero precision from clear delta - Fixed
DataTransformer.pyo3_order_book_deltas_to_record_batch_bytes
using zero precision from clear delta - Fixed
OrderBookMbo
andOrderBookMbp
integrity check when crossed book - Fixed
OrderBookMbp
error when attempting to add to a L1_MBP book type (now raisesRuntimeError
rather than panicking) - Fixed Interactive Brokers connection error logging (#1524), thanks @benjaminsingleton
- Fixed
SimulationModuleConfig
location and missing re-export fromconfig
subpackage - Fixed logging
StdoutWriter
from also writing error logs (writers were duplicating error logs) - Fixed
BinanceWebSocketClient
to new specification which requires responding to pings with a pong containing the pings payload - Fixed Binance Futures
AccountBalance
calculations based on wallet and available balance - Fixed
ExecAlgorithm
circular import issue for installed wheels (importing fromexecution.algorithm
was a circular import)
NautilusTrader 1.188.0 Beta
NautilusTrader 1.188.0 Beta
Released on 25th February 2024 (UTC).
Enhancements
- Added
FuturesSpread
instrument type - Added
OptionsSpread
instrument type - Added
InstrumentClass.FUTURE_SPREAD
- Added
InstrumentClass.OPTION_SPREAD
- Added
managed
parameter tosubscribe_order_book_deltas
, default true to retain current behavior (if false then the data engine will not automatically manage a book) - Added
managed
parameter tosubscribe_order_book_snapshots
, default true to retain current behavior (if false then the data engine will not automatically manage a book) - Added additional validations for
OrderMatchingEngine
(will now reject orders with incorrect price or quantity precisions) - Removed
interval_ms
20 millisecond limitation forsubscribe_order_book_snapshots
(i.e. just needs to be positive), although we recommend you consider subscribing to deltas below 100 milliseconds - Ported
LiveClock
andLiveTimer
implementations to Rust - Implemented
OrderBookDeltas
pickling - Implemented
AverageTrueRange
in Rust, thanks @rsmb7z
Breaking Changes
- Changed
TradeId
value maximum length to 36 characters (will raise aValueError
if value exceeds the maximum)
Fixes
- Fixed
TradeId
memory leak due assigning unique values to theUstr
global string cache (which are never freed for the lifetime of the program) - Fixed
TradeTick
size precision for pyo3 conversion (size precision was incorrectly price precision) - Fixed
RiskEngine
cash value check when selling (would previously divide quantity by price which is too much), thanks for reporting@AnthonyVince - Fixed FOK time in force behavior (allows fills beyond the top level, will cancel if cannot fill full size)
- Fixed IOC time in force behavior (allows fills beyond the top level, will cancel any remaining after all fills are applied)
- Fixed
LiveClock
timer behavior for small intervals causing next time to be less than now (timer then would not run) - Fixed log level filtering for
log_level_file
(bug introduced in v1.187.0), thanks @twitu - Fixed logging
print_config
config option (was not being passed through to the logging system) - Fixed logging timestamps for backtesting (static clock was not being incrementally set to individual
TimeEvent
timestamps) - Fixed account balance updates (fills from zero quantity
NETTING
positions will generate account balance updates) - Fixed
MessageBus
publishable types collection type (needed to betuple
notset
) - Fixed
Controller
registration of components to ensure all active clocks are iterated correctly during backtests - Fixed
Equity
short selling forCASH
accounts (will now reject) - Fixed
ActorFactory.create
JSON encoding (was missing the encoding hook) - Fixed
ImportableConfig.create
JSON encoding (was missing the encoding hook) - Fixed
ImportableStrategyConfig.create
JSON encoding (was missing the encoding hook) - Fixed
ExecAlgorithmFactory.create
JSON encoding (was missing the encoding hook) - Fixed
ControllerConfig
base class and docstring - Fixed Interactive Brokers historical bar data bug, thanks @benjaminsingleton
- Fixed persistence
freeze_dict
function to handlefs_storage_options
, thanks @dimitar-petrov
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.186.0 Beta
NautilusTrader 1.186.0 Beta
Released on 2nd February 2024 (UTC).
Enhancements
None
Breaking Changes
None
Fixes
- Fixed Interactive Brokers get account positions bug (#1475), thanks @benjaminsingleton
- Fixed
TimeBarAggregator
handling of interval types on build - Fixed
BinanceSpotExecutionClient
non-existent method name, thanks @sunlei - Fixed unused
psutil
import, thanks @sunlei
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
(#1470), thanks @rsmb7z
NautilusTrader 1.184.0 Beta
NautilusTrader 1.184.0 Beta
Released on 22nd January 2024 (UTC).
Enhancements
- Added
LogLevel.OFF
(matches the Rusttracing
log levels) - Added
init_logging
function with sensible defaults to initialize the Rust implemented logging system - Updated Binance Futures enum members for
BinanceFuturesContractType
andBinanceFuturesPositionUpdateReason
- Improved log header using the
sysinfo
crate (adds swap space metrics and a PID identifier) - Removed Python dependency on
psutil
Breaking Changes
- Removed
clock
parameter fromLogger
(no dependency onClock
anymore) - Renamed
LoggerAdapter
toLogger
(and removed oldLogger
class) - Renamed
Logger
component_name
parameter toname
(matches Python built-inlogging
API) - Renamed
OptionKind
kind
parameter and property tooption_kind
(better clarity) - Renamed
OptionsContract
Arrow schema fieldkind
tooption_kind
- Changed
level_file
log level toOFF
(file logging is off by default)
Fixes
- Fixed memory leak for catalog queries (#1430), thanks @twitu
- Fixed
DataEngine
order book snapshot timer names (could not parse instrument IDs with hyphens), thanks for reporting @x-zho14 and @dimitar-petrov - Fixed
LoggingConfig
parsing ofWARNING
log level (was not being recognized), thanks for reporting @davidsblom - Fixed Binance Futures
QuoteTick
parsing to capture event time forts_event
, thanks for reporting @x-zho14
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
crate, 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