Released on 19th May 2023 (UTC).
- Parquet schemas are now shifting towards catalog v2 (we recommend you don't upgrade if using legacy catalog)
- Moved order book data from
model.orderbook.data
into themodel.data.book
namespace
- Improved handling for backtest account blow-up scenarios (balance negative or margin exceeded)
- Added
AccountMarginExceeded
exception and refinedAccountBalanceNegative
- Various improvements to
Binance
clients error handling and logging - Improve Binance HTTP error messages
- Fixed handling of emulated order contingencies (not based on status of spawned algorithm orders)
- Fixed sending execution algorithm commands from strategy
- Fixed
OrderEmulator
releasing of already closed orders - Fixed
MatchingEngine
processing of reduce only for child contingency orders - Fixed
MatchingEngine
position ID assignment for child contingency orders - Fixed
Actor
handling of historical data from requests (will now callon_historical_data
regardless of state), thanks for reporting @miller-moore - Fixed pyarrow schema dictionary index keys being too narrow (int8 -> int16), thanks for reporting @rterbush
Released on 5th May 2023 (UTC).
None
None
- Fixed
BacktestEngine
processing of venue(s) message queue based off time eventts_init
- Fixed
Position.signed_decimal_qty
(incorrect format precision in f-string), thanks for reporting @rsmb7z - Fixed trailing stop type order updates for
reduce_only
instruction, thanks for reporting @Otlk - Fixed updating of active execution algorithm orders (events weren't being cached)
- Fixed condition check for applying pending events (do not apply to orders at
INITIALIZED
status)
Released on 30th April 2023 (UTC).
- Removed legacy Rust parquet data catalog backend (based on arrow2)
- Removed Binance config for
clock_sync_interval_secs
(redundant/unused and should be handled at system level) - Removed redundant rate limiting from Rust logger (and associated
rate_limit
config params) - Renamed
Future
instrument toFuturesContract
(avoids ambiguity) - Renamed
Option
instrument toOptionsContract
(avoids ambiguity and naming conflicts in Rust) - Reinstate hours and minutes time component for default order and position identifiers (easier debugging, less collisions)
- Setting time alerts for in the past or current time will generate an immediate
TimeEvent
(rather than being invalid)
- Added new DataFusion Rust parquet data catalog backend (yet to be integrated into Python)
- Added
external_order_claims
config option forStrategyConfig
(for claiming external orders per instrument) - Added
Order.signed_decimal_qty()
- Added
Cache.orders_for_exec_algorithm(...)
- Added
Cache.orders_for_exec_spawn(...)
- Added
TWAPExecAlgorithm
andTWAPExecAlgorithmConfig
to examples - Build out
ExecAlgorithm
base class for implementing 'first class' executon algorithms - Rewired execution for improved flow flexibility between emulated orders, execution algorithms and the
RiskEngine
- Improved handling for
OrderEmulator
updating of contingency orders from execution algorithms - Define public API for instruments, can now import directly from
nautilus_trader.model.instruments
(denest namespace) - Define public API for orders, can now import directly from
nautilus_trader.model.orders
(denest namespace) - Define public API for order book, can now import directly from
nautilus_trader.model.orderbook
(denest namespace) - Now stripping debug symbols after build (reduced binary sizes)
- Refined build and added additional
debug
Makefile convenience targets
- Fixed processing of contingency orders when in a pending update state
- Fixed calculation of PnL for flipped positions (only book realized PnL against open position)
- Fixed
WebSocketClient
session disconnect, thanks for reporting @miller-moore - Added missing
BinanceSymbolFilterType.NOTIONAL
- Fixed incorrect
Mul
trait forPrice
andQuantity
(not being used in Cython/Python layer)
Released on 30th March 2023 (UTC).
- Renamed all position
net_qty
fields and parameters tosigned_qty
(more accurate naming) NautilusKernelConfig
removed alllog_*
config options (replaced bylogging
withLoggingConfig
)- Trading
CurrencyPair
instruments with a single-currencyCASH
account type no longer permitted (unrealistic) - Changed
PositionEvent
parquet schemas (renamednet_qty
field tosigned_qty
)
- Added
LoggingConfig
to consolidate logging configs, offering various file options and per component level filters - Added
BacktestVenueConfig.bar_execution
to control whether bar data moves the matching engine markets (reinstated) - Added optional
request_id
for actor data requests (aids processing responses), thanks @rsmb7z - Added
Position.signed_decimal_qty()
- Now using above signed quantity for
Portfolio
net position calculation, andLiveExecutionEngine
reconciliation comparisons
- Fixed
BacktestEngine
clock and logger handling (had a redundant extra logger and not swapping live clock in post run) - Fixed
close_position
order event publishing and cache persistence forMarketOrder
andSubmitOrder
, thanks for reporting @rsmb7z
Released on 11th March 2023 (UTC).
- Moved
backtest.data.providers
totest_kit.providers
- Moved
backtest.data.wranglers
topersistence.wranglers
(to be consolidated) - Moved
backtest.data.loaders
topersistence.loaders
(to be consolidated) - Renamed
from_datetime
tostart
across data request methods and properties - Renamed
to_datetime
toend
across data request methods and properties - Removed
RiskEngineConfig.deny_modify_pending_update
(as now redundant with new pending event sequencing) - Removed redundant log sink machinery
- Changed parquet catalog schema dictionary integer key widths/types
- Invalidated all pickled data due to Cython 3.0.0b1 upgrade
- Added logging to file at core Rust level
- Added
DataCatalogConfig
for more cohesive data catalog configuration - Added
DataEngine.register_catalog
to support historical data requests - Added
catalog_config
field to baseNautilusKernelConfig
- Changed to immediately caching orders and order lists in
Strategy
- Changed to checking duplicate
client_order_id
andorder_list_id
inStrategy
- Changed generating and applying
OrderPendingUpdate
andOrderPendingCancel
inStrategy
PortfolioAnalyzer
PnL statistics now take optionalunrealized_pnl
- Backtest performance statistics now include unrealized PnL in total PnL
- Fixed Binance Futures trigger type parsing
- Fixed
DataEngine
bar subscribe and unsubscribe logic, thanks for reporting @rsmb7z - Fixed
Actor
handling of bars, thanks @limx0 - Fixed
CancelAllOrders
command handling for contingent orders not yet in matching core - Fixed
TrailingStopMarketOrder
slippage calculation when notrigger_price
, thanks for reporting @rsmb7z - Fixed
BinanceSpotInstrumentProvider
parsing of quote asset (was using base), thanks for reporting @logogin - Fixed undocumented Binance time in force 'GTE_GTC', thanks for reporting @graceyangfan
- Fixed
Position
calculation oflast_qty
when commission currency was equal to base currency, thanks for reporting @rsmb7z - Fixed
BacktestEngine
post backtest run PnL performance statistics for currencies traded per venue, thanks for reporting @rsmb7z
Released on 18th February 2023 (UTC).
NautilusConfig
objects now pseudo-immutable from new msgspec 0.13.0- Renamed
OrderFactory.bracket
parampost_only_entry
->entry_post_only
(consistency with other params) - Renamed
OrderFactory.bracket
parampost_only_tp
->tp_post_only
(consistency with other params) - Renamed
build_time_bars_with_no_updates
->time_bars_build_with_no_updates
(consistency with new param) - Renamed
OrderFactory.set_order_count()
->set_client_order_id_count()
(clarity) - Renamed
TradingNode.start()
toTradingNode.run()
- Complete overhaul and improvements to Binance adapter(s), thanks @poshcoe
- Added Binance aggregated trades functionality with
use_agg_trade_ticks
, thanks @poshcoe - Added
time_bars_timestamp_on_close
option for configurable bar timestamping (True by default) - Added
OrderFactory.generate_client_order_id()
(calls internal generator) - Added
OrderFactory.generate_order_list_id()
(calls internal generator) - Added
OrderFactory.create_list(...)
as easier method for creating order lists - Added
__len__
implementation forOrderList
(returns length of orders) - Implemented optimized logger using Rust MPSC channel and separate thread
- Expose and improve
MatchingEngine
public API for custom functionality - Exposed
TradingNode.run_async()
for easier running from async context - Exposed
TradingNode.stop_async()
for easier stopping from async context
- Fixed registration of
SimulationModule
(and refineActor
base registration) - Fixed loading of previously emulated and transformed orders (handles transforming
OrderInitialized
event) - Fixed handling of
MARKET_TO_LIMIT
orders in matching and risk engines, thanks for reporting @martinsaip
Released on 29th January 2023 (UTC).
- Removed
Cache.clear_cache()
(redundant with the.reset()
method)
- Added
Cache
.add(...)
and.get(...)
for general 'user/custom' objects (as bytes) - Added
CacheDatabase
.add(...)
and.load()
for general cache objects (as bytes) - Added
RedisCacheDatabase
.add(...)
and.load()
for general Redis persisted bytes objects (as bytes) - Added
Cache.actor_ids()
- Added
Actor
cached state saving and loading functionality - Improved logging for called action handlers when not overridden
- Fixed configuration of loading and saving actor and strategy state
Released on 28th January 2023 (UTC).
- Renamed
OrderBookData.update_id
tosequence
- Renamed
BookOrder.id
toorder_id
- Introduced Rust pyo3 based
ParquetReader
andParquetWriter
, thanks @twitu - Added
msgbus.is_subscribed
(to check if topic and handler already subscribed) - Simplified message type model and introduce CQRS-ish live messaging architecture
- Fixed Binance data clients order book startup buffer handling
- Fixed
NautilusKernel
redundant initialization of event loop for backtesting, thanks @limx0 - Fixed
BacktestNode
disposal sequence - Fixed quick start docs and notebook
Released on 17th January 2023 (UTC).
Position.unrealized_pnl
nowNone
until any realized PnL is generated (to reduce ambiguity)
- Added instrument status update subscription handlers, thanks @limx0
- Improvements to InteractiveBrokers
DataClient
, thanks @rsmb7z - Improvements to async task handling for live clients
- Various improvements to Betfair adapter, thanks @limx0
- Fixed netted
Position
realized_pnl
andrealized_return
fields, which were incorrectly cumulative - Fixed netted
Position
flip logic (now correctly 'resets' position) - Various fixes for Betfair adapter, thanks @limx0
- InteractiveBrokers integration docs fixes
Released on 14th January 2023 (UTC).
A number of enum variant names have been changed in favour of explicitness, and also to avoid C naming collisions.
- Renamed
AggressorSide.NONE
toNO_AGGRESSOR
- Renamed
AggressorSide.BUY
toBUYER
- Renamed
AggressorSide.SELL
toSELLER
- Renamed
AssetClass.CRYPTO
toCRYPTOCURRENCY
- Renamed
LiquiditySide.NONE
toNO_LIQUIDITY_SIDE
- Renamed
OMSType
toOmsType
- Renamed
OmsType.NONE
toUNSPECIFIED
- Renamed
OrderSide.NONE
toNO_ORDER_SIDE
- Renamed
PositionSide.NONE
toNO_POSITION_SIDE
- Renamed
TrailingOffsetType.NONE
toNO_TRAILING_OFFSET
- Removed
TrailingOffsetType.DEFAULT
- Renamed
TriggerType.NONE
toNO_TRIGGER
- Renamed
TriggerType.LAST
toLAST_TRADE
- Renamed
TriggerType.MARK
toMARK_PRICE
- Renamed
TriggerType.INDEX
toINDEX_PRICE
- Renamed
ComponentState.INITIALIZED
toREADY
- Renamed
OrderFactory.bracket(post_only)
topost_only_entry
- Moved
manage_gtd_expiry
toStrategy.submit_order(...)
andStrategy.submit_order_list(...)
- Added
BarSpecification.timedelta
property, thanks @rsmb7z - Added
DataEngineConfig.build_time_bars_with_no_updates
option - Added
OrderFactory.bracket(post_only_tp)
param - Added
OrderListIdGenerator
and integrate withOrderFactory
- Added
Cache.add_order_list(...)
- Added
Cache.order_list(...)
- Added
Cache.order_lists(...)
- Added
Cache.order_list_exists(...)
- Added
Cache.order_list_ids(...)
- Improved generation of
OrderListId
from factory to ensure uniqueness - Added auction matches for backtests, thanks @limx0
- Added
.timedelta
property toBarSpecification
, thanks @rsmb7z - Numerous improvements to the Betfair adapter, thanks @limx0
- Improvements to Interactive Brokers data subscriptions, thanks @rsmb7z
- Added
DataEngineConfig.validate_data_sequence
(False by default and currently only forBar
data), thanks @rsmb7z
- Added
TRD_GRP_*
enum variants for Binance spot permissions - Fixed
PARTIALLY_FILLED
->EXPIRED
order state transition, thanks @bb01100100
Released on 23rd December 2022 (UTC).
None
- Added managed GTD order expiry (experimental feature, config may change)
- Added Rust
ParquetReader
andParquetWriter
(forQuoteTick
andTradeTick
only)
- Fixed
MARKET_IF_TOUCHED
orders forOrderFactory.bracket(..)
- Fixed
OrderEmulator
trigger event handling for live trading - Fixed
OrderEmulator
transformation to market orders which had a GTD time in force - Fixed serialization of
OrderUpdated
events - Fixed typing and edge cases for new
msgspec
, thanks @limx0 - Fixed data wrangler processing with missing data, thanks @rsmb7z
Released on 17th December 2022 (UTC).
None
None
- Fixed
MARKET_IF_TOUCHED
andLIMIT_IF_TOUCHED
trigger and modify behavior - Fixed
MatchingEngine
updates of stop order types - Fixed combinations of passive or immediate trigger vs passive or immediate fill behavior
- Fixed memory leaks from passing string pointers from Rust, thanks @twitu
Released on 12th December 2022 (UTC).
OrderFactory
bracket order methods consolidated to.bracket(...)
- Extended
OrderFactory
to provide more bracket order types - Simplified GitHub CI and removed
nox
dependency
- Fixed
OrderBook
sorting for bid side, thanks @gaugau3000 - Fixed
MARKET_TO_LIMIT
order initial fill behaviour - Fixed
BollingerBands
indicator mid-band calculations, thanks zhp (Discord)
Released on 10th December 2022 (UTC).
- Renamed
OrderFactory.bracket_market
toOrderFactory.bracket_market_entry
- Renamed
OrderFactory.bracket_limit
toOrderFactory.bracket_limit_entry
- Renamed
OrderFactory
bracket orderprice
andtrigger_price
parameters
- Added support for Python 3.11
- Consolidated config objects to
msgspec
providing better performance and correctness - Added
OrderFactory.bracket_stop_limit_entry_stop_limit_tp(...)
- Numerous improvements to the Interactive Brokers adapter, thanks @limx0 and @rsmb7z
- Removed dependency on
pydantic
- Fixed
STOP_MARKET
order behavior to fill at market on immediate trigger - Fixed
STOP_LIMIT
order behavior to fill at market on immediate trigger and marketable - Fixed
STOP_LIMIT
order behavior to fill at market on processed trigger and marketable - Fixed
LIMIT_IF_TOUCHED
order behavior to fill at market on immediate trigger and marketable - Fixed Binance start and stop time units for bar (kline) requests, thanks @Tzumx
RiskEngineConfig.bypass
set toTrue
will now correctly bypass throttlers, thanks @DownBadCapital- Fixed updating of emulated orders
- Numerous fixes to the Interactive Brokers adapter, thanks @limx0 and @rsmb7z
Released on 28th November 2022 (UTC).
- Removed time portion from generated IDs (affects
ClientOrderId
andPositionOrderId
) - Renamed
orderbook.data.Order
toorderbook.data.BookOrder
(reduce conflicts/confusion) - Renamed
Instrument.get_cost_currency(...)
toInstrument.get_settlement_currency(...)
(more accurate terminology)
- Added emulated contingency orders capability to
OrderEmulator
- Moved
test_kit
module to main package to support downstream project/package testing
- Fixed position event sequencing: now generates
PositionOpened
when reopening a closed position - Fixed
LIMIT
order fill characteristics when immediately marketable as a taker - Fixed
LIMIT
order fill characteristics when passively filled as a maker as quotes move through - Fixed canceling OTO contingent orders when still in-flight
- Fixed
RiskEngine
notional check when selling cash assets (spot currency pairs) - Fixed flush on closed file bug for persistence stream writers
Released on 18th November 2022 (UTC).
- Removed FTX integration
- Renamed
SubmitOrderList.list
toSubmitOrderList.order_list
- Slight adjustment to bar aggregation (will not use the last close as the open)
- Implemented
TRAILING_STOP_MARKET
orders for Binance Futures (beta) - Added
OUO
One-Updates-OtherContingencyType
with matching engine implementation - Added bar price fallback for exchange rate calculations, thanks @ghill2
- Fixed dealloc of Rust backing struct on Python exceptions causing segfaults
- Fixed bar aggregation start times for bar specs outside typical intervals (60-SECOND rather than 1-MINUTE etc)
- Fixed backtest engine main loop ordering of time events with identically timestamped data
- Fixed
ModifyOrder
messagestr
andrepr
when no quantity - Fixed OCO contingency orders which were actually implemented as OUO for backtests
- Fixed various bugs for Interactive Brokers integration, thanks @limx0 and @rsmb7z
- Fixed pyarrow version parsing, thanks @ghill2
- Fixed returning venue from InstrumentId, thanks @rsmb7z
Released on 3rd November 2022 (UTC).
- Added
LiveExecEngineConfig.reconcilation
boolean flag to control if reconciliation is active - Removed
LiveExecEngineConfig.reconciliation_auto
(unclear naming and concept) - All Redis keys have changed to a lowercase convention (either migrate or flush your Redis)
- Removed
BidAskMinMax
indicator (to reduce total package size) - Removed
HilbertPeriod
indicator (to reduce total package size) - Removed
HilbertSignalNoiseRatio
indicator (to reduce total package size) - Removed
HilbertTransform
indicator (to reduce total package size)
- Improved accuracy of clocks for backtests (all clocks will now match generated
TimeEvent
s) - Improved risk engine checks for
reduce_only
orders - Added
Actor.request_instruments(...)
method - Added
Order.would_reduce_only(...)
method - Extended instrument(s) Req/Res handling for
DataClient
and `Actor
- Fixed memory management for Rust backing structs (now being properly freed)
Released on 24th October 2022 (UTC).
- None
- Added experimental local order emulation for all order types (except
MARKET
andMARKET_TO_LIMIT
) see docs - Added
min_latency
,max_latency
andavg_latency
toHttpClient
base class
- Fixed Binance Spot
display_qty
for iceberg orders, thanks @JackMa - Fixed Binance HTTP client error logging
Released on 19th October 2022 (UTC).
This will be the final release with support for Python 3.8.
- Added
OrderSide.NONE
enum variant - Added
PositionSide.NO_POSITION_SIDE
enum variant - Changed order of
TriggerType
enum variants - Renamed
AggressorSide.UNKNOWN
toAggressorSide.NONE
(for consistency with other enums) - Renamed
Order.type
toOrder.order_type
(reduces ambiguity and aligns with Rust struct field) - Renamed
OrderInitialized.type
toOrderInitialized.order_type
reduces ambiguity) - Renamed
Bar.type
toBar.bar_type
(reduces ambiguity and aligns with Rust struct field) - Removed redundant
check_position_exists
flag - Removed
hyperopt
as considered unmaintained and there are better options - Existing pickled data for
QuoteTick
is now invalid (change to schema for correctness) - Existing catalog data for
OrderInitialized
is now invalid (change to schema for emulation)
- Added configurable automated in-flight order status checks
- Added order
side
filter to numerous cache order methods - Added position
side
filter to numerous cache position methods - Added optional
order_side
tocancel_all_orders
strategy method - Added optional
position_side
toclose_all_positions
strategy method - Added support for Binance Spot second bars
- Added
RelativeVolatilityIndex
indicator, thanks @graceyangfan - Extracted
OrderMatchingEngine
fromSimulatedExchange
with refinements - Extracted
MatchingCore
fromOrderMatchingEngine
- Improved HTTP error handling and client logging (messages now contain reason)
- Fixed price and size precision validation for
QuoteTick
from raw values - Fixed IB adapter data parsing for decimal precision
- Fixed HTTP error handling and releasing of response coroutines, thanks @JackMa
- Fixed
Position
calculations and account for when any base currency == commission currency, thanks @JackMa
Released on September 15th 2022 (UTC).
This is an early release to address some parsing bugs in the FTX adapter.
None
None
- Fixed parsing bug for FTX futures
- Fixed parsing bug for FTX
Bar
Released on September 14th 2022 (UTC).
- Changed
ExecEngineConfig
allow_cash_positions
default toTrue
(more typical use case) - Removed
check
param fromBar
(always checked for simplicity)
- Added
MARKET_TO_LIMIT
order implementation forSimulatedExchange
- Make strategy
order_id_tag
truly optional and auto incrementing - Added PsychologicalLine indicator, thanks @graceyangfan
- Added initial Rust parquet integration, thanks @twitu and @ghill2
- Added validation for setting leverages on
CASH
accounts - De-cythonized live data and execution client base classes for usability
- Fixed limit order
IOC
andFOK
behaviour, thanks @limx0 for identifying - Fixed FTX
CryptoFuture
instrument parsing, thanks @limx0 - Fixed missing imports in data catalog example notebook, thanks @gaugau3000
- Fixed order update behaviour, affected orders:
LIMIT_IF_TOUCHED
MARKET_IF_TOUCHED
MARKET_TO_LIMIT
STOP_LIMIT
Released on September 6th 2022 (UTC).
None
- Added trigger orders for FTX adapter
- Improved
BinanceBar
to handle enormous quote volumes - Improved robustness of instrument parsing for Binance and FTX adapters
- Improved robustness of WebSocket message handling for Binance and FTX adapters
- Added
override_usd
option for FTX adapter - Added
log_warnings
config option for Binance and FTX instrument providers - Added
TRD_GRP_005
enum variant for Binance spot permissions
- Fixed bar aggregator partial bar handling
- Fixed
CurrencyType
variants in Rust - Fixed missing
encoding
in Catalog parsing method, thanks @limx0 and @aviatorBeijing
Released on September 1st 2022 (UTC).
- Renamed
offset_type
totrailing_offset_type
- Renamed
is_frozen_account
tofrozen_account
- Removed
bar_execution
from config API (implicitly turned on with bars currently)
- Added
TRAILING_STOP_MARKET
order implementation forSimulatedExchange
- Added
TRAILING_STOP_LIMIT
order implementation forSimulatedExchange
- Added all simulated exchange options to
BacktestVenueConfig
- Fixed creation and caching of order book on subscribing to deltas, thanks @limx0
- Fixed use of
LoopTimer
in live clock for trading node, thanks @sidnvy - Fixed order cancels for IB adapter, thanks @limx0
Released on August 22nd 2022 (UTC).
None
- Added
on_historical_data
method with wiring for functionality - Added 'unthrottled' 0ms order book updates for Binance Futures
- Improved robustness of
WebSocketClient
base during reconnects
- Fixed sdist includes for Rust Cargo files
- Fixed
LatencyModel
integer overflows, thanks @limx0 - Fixed parsing of Binance Futures
FUNDING_FEE
updates - Fixed
asyncio.tasks.gather
for Python 3.10+
Released on August 15th 2022 (UTC).
BacktestEngine
now required venues to be added prior to instrumentsBacktestEngine
now requires instruments to be added prior to data- Renamed
Ladder.reverse
toLadder.is_reversed
- Portfolio performance now displays commissions as a negative
- Added initial backtest config validation for instrument vs venue
- Added initial sandbox execution client
- Added leverage options for
BacktestVenueConfig
, thanks @miller-moore - Allow
Trader
to run without strategies loaded - Integrated core Rust clock and timer
- De-cythonize
InstrumentProvider
base class
- Fixed double counting of commissions for single-currency and multi-currency accounts #657
Released on 27th June 2022 (UTC).
- Schema change for
Instrument.info
forParquetDataCatalog
- Added
DirectionalMovementIndicator
indicator, thanks @graceyangfan - Added
KlingerVolumeOscillator
indicator, thanks @graceyangfan - Added
clientId
andstart_gateway
for IB config, thanks @niks199
- Fixed macOS ARM64 build
- Fixed Binance testnet URL
- Fixed IB contract ID dict, thanks @niks199
- Fixed IB
InstrumentProvider
#685, thanks @limx0 - Fixed IB orderbook snapshots L1 value assertion #712 , thanks @limx0
Released on 30th June 2022 (UTC).
None
- Ported core bar objects to Rust thanks @ghill2
- Improved core
unix_nanos_to_iso8601
performance by 30% thanks @ghill2 - Added
DataCatalog
interface forParquetDataCatalog
thanks @jordanparker6 - Added
AroonOscillator
indicator thanks @graceyangfan - Added
ArcherMovingAveragesTrends
indicator thanks @graceyangfan - Added
DoubleExponentialMovingAverage
indicator thanks @graceyangfan - Added
WilderMovingAverage
indicator thanks @graceyangfan - Added
ChandeMomentumOscillator
indicator thanks @graceyangfan - Added
VerticalHorizontalFilter
indicator thanks @graceyangfan - Added
Bias
indicator thanks @graceyangfan
None
Released on 6th June 2022 (UTC).
None
None
- Fixed incorrect backtest log timestamps (was using actual time)
- Fixed formatting of timestamps for nanoseconds zulu as per RFC3339
Released on 4th June 2022 (UTC).
None
- Improved error handling for invalid state triggers
- Improved component state transition behaviour and logging
- Improved
TradingNode
disposal flow - Implemented core monotonic clock
- Implemented logging in Rust
- Added
CommodityChannelIndex
indicator thanks @graceyangfan
None
Released on 22nd May 2022 (UTC).
AccountId
constructor now takes single value string- Removed redundant
UUIDFactory
and all associated backing fields and calls - Removed
ClientOrderLinkId
(not in use)
- Refinements and improvements to Rust core
- Fixed pre-trade notional risk checks incorrectly applied to
MARGIN
accounts - Fixed
net_qty
inPositionStatusReport
thanks to @sidnvy - Fixed
LinearRegression
indicator thanks to @graceyangfan
Released on 15th May 2022 (UTC).
This is an early release due to the build error in the sdist for 1.144.0
.
The error is due to the nautilus_core
Rust source not being included in the sdist package.
- All raw order constructors now take
expire_time_ns
int64 rather than a datetime - All order serializations due to
expire_time_ns
option handling PortfolioAnalyzer
moved fromTrader
toPortfolio
PortfolioAnalyzer
now available to strategies viaself.portfolio.analyzer
None
Released on 10th May 2022 (UTC).
- Removed
BacktestEngine.add_ticks()
as redundant with.add_data()
- Removed
BacktestEngine.add_bars()
as redundant with.add_data()
- Removed
BacktestEngine.add_generic_data()
as redundant with.add_data()
- Removed
BacktestEngine.add_order_book_data()
as redundant with.add_data()
- Renamed
Position.from_order
toPosition.opening_order_id
- Renamed
StreamingPersistence
toStreamingFeatherWriter
- Renamed
PersistenceConfig
toStreamingConfig
- Renamed
PersistenceConfig.flush_interval
toflush_interval_ms
- Added
Actor.publish_signal
for generic dynamic signal data - Added
WEEK
andMONTH
bar aggregation options - Added
Position.closing_order_id
property - Added
tags
param toStrategy.submit_order
- Added optional
check_positon_exists
flag toStrategy.submit_order
- Eliminated all use of
unsafe
Rust and C null-terminated byte strings - The
bypass_logging
config option will also now bypass theBacktestEngine
logger
- Fixed behaviour of
IOC
andFOK
time in force instructions - Fixed Binance bar resolution parsing
Released on 21st April 2022 (UTC).
None
None
- Fixed segfault for
CashAccount.calculate_balance_locked
with no base currency - Various FeatherWriter fixes
Released on 17th April 2022 (UTC).
BacktestNode
now requires configs at initialization- Removed
run_configs
param fromBacktestNode.run()
method - Removed
return_engine
flag - Renamed
TradingStrategy
toStrategy
- Renamed
TradingStrategyConfig
toStrategyConfig
- Changes to configuration object import paths
- Removed redundant
realized_points
concept fromPosition
- Added
BacktestNode.get_engines()
method - Added
BacktestNode.get_engine(run_config_id)
method - Added
Actor.request_instrument()
method (also applies toStrategy
) - Added
Cache.snapshot_position()
method - All configuration objects can now be imported directly from
nautilus_trader.config
- Execution engine now takes snapshots of closed netted positions
- Performance statistics now based on total positions and snapshots
- Added Binance Spot/Margin external order handling
- Added support for millisecond bar aggregation
- Added configurable
debug
mode for engines (with extra debug logging) - Improved annualized portfolio statistics with configurable period
None
Released on 4th April 2022 (UTC).
- Renamed
BacktestNode.run_sync()
toBacktestNode.run()
- Renamed
flatten_position()
toclose_position()
- Renamed
flatten_all_positions()
toclose_all_positions()
- Renamed
Order.flatten_side()
toOrder.closing_side()
- Renamed
TradingNodeConfig
check_residuals_delay
totimeout_post_stop
- The
SimulatedExchange
will now 'receive' market data prior to theDataEngine
(note that this did not affect any test) - Tightened requirement for
DataType
types to be subclasses ofData
CacheDatabaseConfig.type
now defaults toin-memory
NAUTILUS_CATALOG
env var changed toNAUTILUS_PATH
DataCatalog
root path now located under$OLD_PATH/catalog/
from the Nautilus pathhiredis
andredis
are now optional extras as 'redis'hyperopt
is now an optional extra as 'hyperopt'
- Unify
NautilusKernel
across backtest and live systems - Improved configuration by grouping into
config
subpackage - Improved configuration objects and flows
- Numerous improvements to the Binance Spot/Margin and Futures integration
- Added Docker image builds and GH packages
- Added
BinanceFuturesMarkPriceUpdate
type and data stream - Added generic
subscribe
andunsubscribe
to template - Added Binance Futures COIN_M testnet
- The clarity of various error messages was improved
- Fixed multiple instruments in
DataCatalog
(#554), (#560) by @limx0 - Fixed timestamp ordering streaming from
DataCatalog
(#561) by @limx0 - Fixed
CSVReader
(#563) by @limx0 - Fixed slow subscribers to the Binance WebSocket streams
- Fixed configuration of
base_currency
for backtests - Fixed importable strategy configs (previously not returning correct class)
- Fixed
fully_qualified_name()
format
Released on 13th March 2022 (UTC).
This is a patch release which fixes a moderate severity security vulnerability in pillow < 9.0.1:
If the path to the temporary directory on Linux or macOS contained a space,
this would break removal of the temporary image file after im.show() (and related actions),
and potentially remove an unrelated file. This been present since PIL.
This release upgrades to pillow 9.0.1.
Note the minor version was incremented in error.
Released on 11th March 2022 (UTC).
- Renamed
CurrencySpot
toCurrencyPair
- Renamed
PerformanceAnalyzer
toPortfolioAnalyzer
- Renamed
BacktestDataConfig.data_cls_path
todata_cls
- Renamed
BinanceTicker
toBinanceSpotTicker
- Renamed
BinanceSpotExecutionClient
toBinanceExecutionClient
- Added initial (beta) Binance Futures adapter implementation
- Added initial (beta) Interactive Brokers adapter implementation
- Added custom portfolio statistics
- Added
CryptoFuture
instrument - Added
OrderType.MARKET_TO_LIMIT
- Added
OrderType.MARKET_IF_TOUCHED
- Added
OrderType.LIMIT_IF_TOUCHED
- Added
MarketToLimitOrder
order type - Added
MarketIfTouchedOrder
order type - Added
LimitIfTouchedOrder
order type - Added
Order.has_price
property (convenience) - Added
Order.has_trigger_price
property (convenience) - Added
msg
param toLoggerAdapter.exception()
- Added WebSocket
log_send
andlog_recv
config options - Added WebSocket
auto_ping_interval
(seconds) config option - Replaced
msgpack
withmsgspec
(faster drop in replacement https://github.com/jcrist/msgspec) - Improved exception messages by providing helpful context
- Improved
BacktestDataConfig
API: now takes either a type ofData
or a fully qualified path string
- Fixed FTX execution WebSocket 'ping strategy'
- Fixed non-deterministic config dask tokenization
Released on 15th February 2022 (UTC).
This release contains numerous method, parameter and property name changes
For consistency and standardization with other protocols, the ExecutionId
type
has been renamed to TradeId
as they express the same concept with a more
standardized terminology. In the interests of enforcing correctness and
safety this type is now utilized for the TradeTick.trade_id
.
- Renamed
working
orders toopen
orders including all associated methods and params - Renamed
completed
orders toclosed
orders including all associated methods and params - Removed
active
order concept (often confused withopen
) - Renamed
trigger
totrigger_price
- Renamed
StopMarketOrder.price
toStopMarketOrder.trigger_price
- Renamed all params related to a
StopMarketOrders
price
totrigger_price
- Renamed
ExecutionId
toTradeId
- Renamed
execution_id
totrade_id
- Renamed
Order.trade_id
toOrder.last_trade_id
(for clarity) - Renamed other variations and references of 'execution ID' to 'trade ID'
- Renamed
contingency
tocontingency_type
- Introduced the
TradeId
type to enforcetrade_id
typing - Improve handling of unleveraged cash asset positions including Crypto and Fiat spot currency instruments
- Added
ExecEngineConfig
optionallow_cash_positions
(False
by default) - Added
TrailingOffsetType
enum - Added
TrailingStopMarketOrder
- Added
TrailingStopLimitOrder
- Added trailing order factory methods
- Added
trigger_type
param to stop orders - Added
TriggerType
enum - Large refactoring of order base and impl classes
- Overhaul of execution reports
- Overhaul of execution state reconciliation
- Fixed WebSocket base reconnect handling
Released on 15th January 2022 (UTC).
This is a patch release which fixes moderate to high severity security vulnerabilities in
pillow < 9.0.0
:
- PIL.ImageMath.eval allows evaluation of arbitrary expressions, such as ones that use the Python exec method
- path_getbbox in path.c has a buffer over-read during initialization of ImagePath.Path
- path_getbbox in path.c improperly initializes ImagePath.Path
This release upgrades to pillow 9.0.0
.
Released on 12th January 2022 (UTC).
- Removed redundant
currency
param fromAccountBalance
- Renamed
local_symbol
tonative_symbol
- Removed the
VenueType
enum andvenue_type
param in favour of arouting
bool flag - Removed
account_id
param from execution client factories and constructors - Changed venue generated IDs (order, execution, position) which now begin with the venue ID
- Added FTX integration for testing
- Added FTX US configuration option
- Added Binance US configuration option
- Added
MarginBalance
object to assist with margin account functionality
- Fixed parsing of
BarType
with symbols including hyphens-
- Fixed
BinanceSpotTicker
__repr__
(was missing whitespace after a comma) - Fixed
DataEngine
requests for historicalTradeTick
- Fixed
DataEngine
_handle_data_response
typing ofdata
toobject
Released on 29th December 2021.
- Changed
subscribe_data(...)
method (client_id
now optional) - Changed
unsubscribe_data(...)
method (client_id
now optional) - Changed
publish_data(...)
method (addeddata_type
) - Renamed
MessageBus.subscriptions
method param topattern
- Renamed
MessageBus.has_subscribers
method param topattern
- Removed
subscribe_strategy_data(...)
method - Removed
unsubscribe_strategy_data(...)
method - Removed
publish_strategy_data(...)
method - Renamed
CryptoSwap
toCryptoPerpetual
- Can now modify or cancel in-flight orders live and backtest
- Updated
CancelOrder
to allow Nonevenue_order_id
- Updated
ModifyOrder
to allow Nonevenue_order_id
- Updated
OrderPendingUpdate
to allow Nonevenue_order_id
- Updated
OrderPendingCancel
to allow Nonevenue_order_id
- Updated
OrderCancelRejected
to allow Nonevenue_order_id
- Updated
OrderModifyRejected
to allow Nonevenue_order_id
- Added
DataType.topic
string for improved message bus handling
- Implemented comparisons for
DataType
,BarSpecification
andBarType
- Fixed
QuoteTickDataWrangler.process_bar_data
withrandom_seed
Released on 13th December 2021.
- Renamed
match_id
totrade_id
- Added bars method to
DataCatalog
- Improved parsing of Binance historical bars data
- Added
CancelAllOrders
command - Added bulk cancel capability to Binance integration
- Added bulk cancel capability to Betfair integration
- Fixed handling of
cpu_freq
call in logging for ARM architecture - Fixed market order fill edge case for bar data
- Fixed handling of
GenericData
in backtests
Released on 22nd November 2021.
- Changed
hidden
order option todisplay_qty
to support iceberg orders - Renamed
Trader.component_ids()
toTrader.actor_ids()
- Renamed
Trader.component_states()
toTrader.actor_states()
- Renamed
Trader.add_component()
toTrader.add_actor()
- Renamed
Trader.add_components()
toTrader.add_actors()
- Renamed
Trader.clear_components()
toTrader.clear_actors()
- Added initial implementation of Binance SPOT integration (beta stage testing)
- Added support for display quantity/iceberg orders
- Fixed
Actor
clock time advancement in backtest engine
Released on 8th November 2021.
None
- Added
LatencyModel
for simulated exchange - Added
last_update_id
to order books - Added
update_id
to order book data - Added
depth
param when subscribing to order book deltas - Added
Clock.timestamp_ms()
- Added
TestDataProvider
and consolidate test data - Added orjson default serializer for arrow
- Reorganized example strategies and launch scripts
- Fixed logic for partial fills in backtests
- Various Betfair integration fixes
- Various
BacktestNode
fixes
Released on 24th October 2021.
Actor
constructor now takesActorConfig
- Added
ActorConfig
- Added
ImportableActorConfig
- Added
ActorFactory
- Added
actors
toBacktestRunConfig
- Improved network base classes
- Refine
InstrumentProvider
- Fixed persistence config for
BacktestNode
- Various Betfair integration fixes
Released on 10th October 2021.
- Renamed
nanos_to_unix_dt
tounix_nanos_to_dt
(more accurate name) - Changed
Clock.set_time_alert(...)
method signature - Changed
Clock.set_timer(...)
method signature - Removed
pd.Timestamp
fromTimeEvent
OrderList
submission and OTO, OCO contingencies now operational- Added
Cache.orders_for_position(...)
method - Added
Cache.position_for_order(...)
method - Added
SimulatedExchange.get_working_bid_orders(...)
method - Added
SimulatedExchange.get_working_ask_orders(...)
method - Added optional
run_config_id
for backtest runs - Added
BacktestResult
object - Added
Clock.set_time_alert_ns(...)
method - Added
Clock.set_timer_ns(...)
method - Added
fill_limit_at_price
simulated exchange option - Added
fill_stop_at_price
simulated exchange option - Improve timer and time event efficiency
- Fixed
OrderUpdated
leaves quantity calculation - Fixed contingency order logic at the exchange
- Fixed indexing of orders for a position in the cache
- Fixed flip logic for zero sized positions (not a flip)
Released on 26th September 2021.
BacktestEngine.run
method signature change- Renamed
BookLevel
toBookType
- Renamed
FillModel
params
- Added streaming backtest machinery.
- Added
quantstats
(removedempyrical
) - Added
BacktestEngine.run_streaming()
- Added
BacktestEngine.end_streaming()
- Added
Portfolio.balances_locked(venue)
- Improved
DataCatalog
functionality - Improved logging for
BacktestEngine
- Improved parquet serialization and machinery
- Fixed
SimulatedExchange
message processing - Fixed
BacktestEngine
event ordering in main loop - Fixed locked balance calculation for
CASH
accounts - Fixed fill dynamics for
reduce-only
orders - Fixed
PositionId
handling forHEDGING
OMS exchanges - Fixed parquet
Instrument
serialization - Fixed
CASH
account PnL calculations with base currency
Released on 12th September 2021.
- Removed CCXT adapter (#428)
- Backtest configuration changes
- Renamed
UpdateOrder
toModifyOrder
(terminology standardization) - Renamed
DeltaType
toBookAction
(terminology standardization)
- Added
BacktestNode
- Added
BookIntegrityError
with improved integrity checks for order books - Added order custom user tags
- Added
Actor.register_warning_event
(also applicable toTradingStrategy
) - Added
Actor.deregister_warning_event
(also applicable toTradingStrategy
) - Added
ContingencyType
enum (for contingency orders in anOrderList
) - All order types can now be
reduce_only
(#437) - Refined backtest configuration options
- Improved efficiency of
UUID4
using the Rustfastuuid
Python bindings
- Fixed Redis loss of precision for
int64_t
nanosecond timestamps (#363) - Fixed behavior of
reduce_only
orders for both submission and filling (#437) - Fixed PnL calculation for
CASH
accounts when commission negative (#436)
Released on 30th August 2021.
This release continues the focus on the core system, with upgrades and cleanups
to the component base class. The concept of an active
order has been introduced,
which is an order whose state can change (is not a completed
order).
- All configuration due
pydantic
upgrade - Throttling config now takes string e.g. "100/00:00:01" which is 100 / second
- Renamed
DataProducerFacade
toDataProducer
- Renamed
fill.side
tofill.order_side
(clarity and standardization) - Renamed
fill.type
tofill.order_type
(clarity and standardization)
- Added serializable configuration classes leveraging
pydantic
- Improved adding bar data to
BacktestEngine
- Added
BacktestEngine.add_bar_objects()
- Added
BacktestEngine.add_bars_as_ticks()
- Added order
active
concept, withorder.is_active
and cache methods - Added
ComponentStateChanged
event - Added
Component.degrade()
andComponent.fault()
command methods - Added
Component.on_degrade()
andComponent.on_fault()
handler methods - Added
ComponentState.PRE_INITIALIZED
- Added
ComponentState.DEGRADING
- Added
ComponentState.DEGRADED
- Added
ComponentState.FAULTING
- Added
ComponentState.FAULTED
- Added
ComponentTrigger.INITIALIZE
- Added
ComponentTrigger.DEGRADE
- Added
ComponentTrigger.DEGRADED
- Added
ComponentTrigger.FAULT
- Added
ComponentTrigger.FAULTED
- Wired up
Ticker
data type
DataEngine.subscribed_bars()
now reports internally aggregated bars also.
Released on 17th August 2021.
This release has again focused on core areas of the platform, including a
significant overhaul of accounting and portfolio components. The wiring between
the DataEngine
and DataClient
(s) has also received attention, and should now
exhibit correct subscription mechanics.
The Betfair adapter has been completely re-written, providing various fixes and enhancements, increased performance, and full async support.
There has also been some further renaming to continue to align the platform as closely as possible with established terminology in the domain.
- Moved margin calculation methods from
Instrument
toAccount
- Removed redundant
Portfolio.register_account
- Renamed
OrderState
toOrderStatus
- Renamed
Order.state
toOrder.status
- Renamed
msgbus.message_bus
tomsgbus.bus
- Betfair adapter re-write
- Extracted
accounting
subpackage - Extracted
portfolio
subpackage - Subclassed
Account
withCashAccount
andMarginAccount
- Added
AccountsManager
- Added
AccountFactory
- Moved registration of custom account classes to
AccountFactory
- Moved registration of calculated account to
AccountFactory
- Added registration of OMS type per trading strategy
- Added
ExecutionClient.create_account
for custom account classes - Separate
PortfolioFacade
fromPortfolio
- Data subscription handling in
DataEngine
Cash
accounts no longer generate spurious margins- Fix
TimeBarAggregator._stored_close_ns
property name
Released on 3rd August 2021.
This is a patch release which fixes a bug involving NotImplementedError
exception handling when subscribing to order book deltas when not supported by
a client. This bug affected CCXT order book subscriptions.
None
None
- Fix
DataEngine
order book subscription handling
Released on 2nd August 2021.
This release sees the completion of the initial implementation of the
MessageBus
, with data now being handled by Pub/Sub patterns, along with the
additions of point-to-point and Req/Rep messaging functionality.
An Actor
base class has been abstracted from TradingStrategy
which allows
custom components to be added to a Trader
which aren't necessarily trading
strategies, opening up further possibilities for extending NautilusTrader with
custom functionality.
For the sake of simplicity and to favour more idiomatic Python, the null object pattern is no longer utilized for handling identifiers. This has removed a layer of 'logical indirection' in certain parts of the codebase, and allows for simpler code.
An order is now considered 'in-flight' if it is actively pending a state
transition i.e. in the SUBMITTED
,PENDING_UPDATE
or PENDING_CANCEL
states.
It is now a well established convention that all integer based timestamps are
expressed in UNIX nanoseconds, therefore the _ns
postfix has now been dropped.
For clarity - time periods/intervals/objects where the units may not be obvious
have retained the _ns
postfix.
The opportunity was identified to unify the parameter naming for the concept
of object instantiation by renaming timestamp_ns
and ts_recv_ns
to ts_init
.
Along the same lines, the timestamps for both event and data occurrence have
been standardized to ts_event
.
It is acknowledged that the frequent name changes and modifications to core concepts may be frustrating, however whilst still in a beta phase - we're taking the opportunity to lay a solid foundation for this project to continue to growth in the years ahead.
- Renamed
timestamp_ns
tots_init
- Renamed
ts_recv_ns
tots_event
- Renamed various event timestamp parameters to
ts_event
- Removed null object methods on identifiers
- Added
Actor
component base class - Added
MessageBus.register()
- Added
MessageBus.send()
- Added
MessageBus.request()
- Added
MessageBus.response()
- Added
Trader.add_component()
- Added
Trader.add_components()
- Added
Trader.add_log_sink()
- Various Betfair adapter patches and fixes
ExecutionEngine
position flip logic in certain edge cases
Released on 18th July 2021.
This release introduces a major re-architecture of the internal messaging system. A common message bus has been implemented which now handles all events via a Pub/Sub messaging pattern. The next release will see all data being handled by the message bus, see the related issue for further details on this enhancement.
Another notable feature is the introduction of the order 'in-flight' concept,
which is a submitted order which has not yet been acknowledged by the
trading venue. Several properties on Order
, and methods on Cache
, now exist
to support this.
The Throttler
has been refactored and optimized further. There has also been
extensive reorganization of the model sub-package, standardization of identifiers
on events, along with numerous 'under the hood' cleanups and two bug fixes.
- Renamed
MessageType
enum toMessageCategory
- Renamed
fill.order_side
tofill.side
- Renamed
fill.order_type
tofill.type
- All
Event
serialization due to domain refactorings
- Added
MessageBus
class - Added
TraderId
toOrder
andPosition
- Added
OrderType
to OrderFilled - Added unrealized PnL to position events
- Added order in-flight concept to
Order
andCache
- Improved efficiency of
Throttler
- Standardized events
str
andrepr
- Standardized commands
str
andrepr
- Standardized identifiers on events and objects
- Improved
Account
str
andrepr
- Using
orjson
overjson
for efficiency - Removed redundant
BypassCacheDatabase
- Introduced
mypy
to the codebase
- Fixed backtest log timestamping
- Fixed backtest duplicate initial account event
Released on 6th July 2021.
This release sees the expansion of pre-trade risk check options (see
RiskEngine
class documentation). There has also been extensive 'under the
hood' code cleanup and consolidation.
- Renamed
Position.opened_timestamp_ns
tots_opened_ns
- Renamed
Position.closed_timestamp_ns
tots_closed_ns
- Renamed
Position.open_duration_ns
toduration_ns
- Renamed Loggers
bypass_logging
tobypass
- Refactored
PositionEvent
types
- Add pre-trade risk checks to
RiskEngine
iteration 2 - Improve
Throttler
functionality and performance - Removed redundant
OrderInvalid
state and associated code - Improve analysis reports
- PnL calculations for
CASH
account types - Various event serializations
Released on 20th June 2021.
A major feature of this release is a complete re-design of serialization for the platform, along with initial support for the Parquet format. The MessagePack serialization functionality has been refined and retained.
In the interests of explicitness there is now a convention that timestamps are
named either timestamp_ns
, or prepended with ts
. Timestamps which are
represented with an int64
are always in nanosecond resolution, and appended
with _ns
accordingly.
Initial scaffolding for new backtest data tooling has been added.
- Renamed
OrderState.PENDING_REPLACE
toOrderState.PENDING_UPDATE
- Renamed
timestamp_origin_ns
tots_event_ns
- Renamed
timestamp_ns
for data tots_recv_ns
- Renamed
updated_ns
tots_updated_ns
- Renamed
submitted_ns
tots_submitted_ns
- Renamed
rejected_ns
tots_rejected_ns
- Renamed
accepted_ns
tots_accepted_ns
- Renamed
pending_ns
tots_pending_ns
- Renamed
canceled_ns
tots_canceled_ns
- Renamed
triggered_ns
tots_triggered_ns
- Renamed
expired_ns
tots_expired_ns
- Renamed
execution_ns
tots_filled_ns
- Renamed
OrderBookLevel
toBookLevel
- Renamed
Order.volume
toOrder.size
- Adapter dependencies are now optional extras at installation
- Added arrow/parquet serialization
- Added object
to_dict()
andfrom_dict()
methods - Added
Order.is_pending_update
- Added
Order.is_pending_cancel
- Added
run_analysis
config option forBacktestEngine
- Removed
TradeMatchId
in favour of bare string - Removed redundant conversion to
pd.Timestamp
when checking timestamps - Removed redundant data
to_serializable_str
methods - Removed redundant data
from_serializable_str
methods - Removed redundant
__ne__
implementations - Removed redundant
MsgPackSerializer
cruft - Removed redundant
ObjectCache
andIdentifierCache
- Removed redundant string constants
- Fixed millis to nanos in
CCXTExecutionClient
- Added missing trigger to
UpdateOrder
handling - Removed all
import *
Released on 6th June 2021.
This release includes numerous breaking changes with a view to enhancing the core functionality and API of the platform. The data and execution caches have been unified for simplicity. There have also been large changes to the accounting functionality, with 'hooks' added in preparation for accurate calculation and handling of margins.
- Renamed
Account.balance()
toAccount.balance_total()
- Consolidated
TradingStrategy.data
intoTradingStrategy.cache
- Consolidated
TradingStrategy.execution
intoTradingStrategy.cache
- Moved
redis
subpackage intoinfrastructure
- Moved some accounting methods back to
Instrument
- Removed
Instrument.market_value()
- Renamed
Portfolio.market_values()
toPortfolio.net_exposures()
- Renamed
Portfolio.market_value()
toPortfolio.net_exposure()
- Renamed
InMemoryExecutionDatabase
toBypassCacheDatabase
- Renamed
Position.relative_qty
toPosition.net_qty
- Renamed
default_currency
tobase_currency
- Removed
cost_currency
property fromInstrument
ExecutionClient
now has the option of calculating account state- Unified data and execution caches into single
Cache
- Improved configuration options and naming
- Simplified
Portfolio
component registration - Simplified wiring of
Cache
into components - Added
repr
to execution messages - Added
AccountType
enum - Added
cost_currency
toPosition
- Added
get_cost_currency()
toInstrument
- Added
get_base_currency()
toInstrument
- Fixed
Order.is_working
forPENDING_CANCEL
andPENDING_REPLACE
states - Fixed loss of precision for nanosecond timestamps in Redis
- Fixed state reconciliation when uninstantiated client
Released on 30th May 2021.
In this release there has been a major change to the use of inlines for method signatures. From the Cython docs: "Note that class-level cdef functions are handled via a virtual function table so the compiler won’t be able to inline them in almost all cases.". https://cython.readthedocs.io/en/latest/src/userguide/pyrex_differences.html?highlight=inline.
It has been found that adding inline
to method signatures makes no difference
to the performance of the system - and so they have been removed to reduce
'noise' and simplify the codebase. Note that the use of inline
for
module level functions will be passed to the C compiler with the expected
result of inlining the function.
BacktestEngine.add_venue
addedvenue_type
to method paramsExecutionClient
addedvenue_type
to constructor paramsTraderId
instantiationStrategyId
instantiationInstrument
serialization
Portfolio
pending calculations if data not immediately available- Added
instruments
subpackage with expanded class definitions - Added
timestamp_origin_ns
timestamp when originally occurred - Added
AccountState.is_reported
flagging if reported by exchange or calculated - Simplified
TraderId
andStrategyId
identifiers - Improved
ExecutionEngine
order routing - Improved
ExecutionEngine
client registration - Added order routing configuration
- Added
VenueType
enum and parser - Improved param typing for identifier generators
- Improved log formatting of
Money
andQuantity
thousands commas
- CCXT
TICK_SIZE
precision mode - size precisions (BitMEX, FTX) - State reconciliation (various bugs)
This release focuses on simplifications and enhancements of existing machinery
Position
now requires anInstrument
paramis_inverse
removed fromOrderFilled
ClientId
removed fromTradingCommand
and subclassesAccountId
removed fromTradingCommand
and subclassesTradingCommand
serialization
- Added
Instrument
methods toExecutionCache
- Added
Venue
filter to cache queries - Moved order validations into
RiskEngine
- Refactored
RiskEngine
- Removed routing type information from identifiers
None
This release applies another major refactoring to the value object API for
BaseDecimal
and its subclasses Price
and Quantity
. Previously a precision
was not explicitly required when passing in a decimal.Decimal
type which
sometimes resulted in unexpected behavior when a user passed in a decimal with
a very large precision (when wrapping a float with decimal.Decimal
).
Convenience methods have been added to Price
and Quantity
where precision
is implicitly zero for ints, or implied in the number of digits after the '.'
point for strings. Convenience methods have also been added to Instrument
to
assist the UX.
The serialization of Money
has been improved with the inclusion of the
currency code in the string delimited by whitespace. This avoids an additional
field for the currency code.
RiskEngine
has been rewired ahead of ExecutionEngine
which clarifies areas
of responsibility and cleans up the registration sequence and allows a more
natural flow of command and event messages.
- Serializations involving
Money
- Changed usage of
Price
andQuantity
- Renamed
BypassExecutionDatabase
toBypassCacheDatabase
- Rewired
RiskEngine
andExecutionEngine
sequence - Added
Instrument
database operations - Added
MsgPackInstrumentSerializer
- Added
Price.from_str()
- Added
Price.from_int()
- Added
Quantity.zero()
- Added
Quantity.from_str()
- Added
Quantity.from_int()
- Added
Instrument.make_price()
- Added
Instrument.make_qty()
- Improved serialization of
Money
- Handling of precision for
decimal.Decimal
values passed to value objects
This release simplifies the backtesting workflow by removing the need for the
intermediate BacktestDataContainer
. There has also been some simplifications
for OrderFill
events, as well as additional order states and events.
- Standardized all 'cancelled' references to 'canceled'.
SimulatedExchange
no longer generatesOrderAccepted
forMarketOrder
- Removed redundant
BacktestDataContainer
- Removed redundant
OrderFilled.cum_qty
- Removed redundant
OrderFilled.leaves_qty
BacktestEngine
constructor simplifiedBacktestMarketDataClient
no longer needs instruments- Rename
PortfolioAnalyzer.get_realized_pnls
to.realized_pnls
- Re-engineered
BacktestEngine
to take data directly - Added
OrderState.PENDING_CANCEL
- Added
OrderState.PENDING_REPLACE
- Added
OrderPendingUpdate
event - Added
OrderPendingCancel
event - Added
OrderFilled.is_buy
property (with correspondingis_buy_c()
fast method) - Added
OrderFilled.is_sell
property (with correspondingis_sell_c()
fast method) - Added
Position.is_opposite_side(OrderSide side)
convenience method - Modified the
Order
FSM and event handling for the above - Consolidated event generation into
ExecutionClient
base class - Refactored
SimulatedExchange
for greater clarity
ExecutionCache
positions open queries- Exchange accounting for exchange
OmsType.NETTING
- Position flipping logic for exchange
OmsType.NETTING
- Multi-currency account terminology
- Windows wheel packaging
- Windows path errors
The major thrust of this release is added support for order book data in
backtests. The SimulatedExchange
now maintains order books of each instrument
and will accurately simulate market impact with L2/L3 data. For quote and trade
tick data a L1 order book is used as a proxy. A future release will include
improved fill modelling assumptions and customizations.
OrderBook.create
now takesInstrument
andBookLevel
SimulatedExchange
now maintains order books internallyLiveLogger
now exhibits better blocking behavior and logging
- Various patches to the
Betfair
adapter - Documentation builds
Announcing official Windows 64-bit support.
Several bugs have been identified and fixed.
None
- Performance test refactoring
- Remove redundant performance harness
- Add
Queue.peek()
to high-performance queue - GitHub action refactoring, CI for Windows
- Builds for 32-bit platforms
OrderBook.create
forBookLevel.L3
now returns correct book- Betfair handling of trade IDs
This release includes substantial breaking changes.
Further fundamental changes to the core API have been made.
- Introduce
ClientId
for data and execution client identification - Standardize client IDs to upper case
- Rename
OrderBookOperation
toOrderBookDelta
- Rename
OrderBookOperations
toOrderBookDeltas
- Rename
OrderBookOperationType
toOrderBookDeltaType
None
None
This release includes substantial breaking changes.
Due to recent feedback and much further thought - a major renaming has been carried
out involving order identifiers. The Order
is the only domain object in the
model which is identified with more than one ID. Due to this, more explicitness
helps to ensure correct logic. Previously the OrderId
was
implicitly assumed to be the one assigned by the trading venue. This has been
clarified by renaming the identifier to VenueOrderId
. Following this, it no
longer made sense to refer to it through Order.id
, and so this was changed to
its full name Order.venue_order_id
. This naturally resulted in ClientOrderId
(s)
being renamed in properties and variables from cl_ord_id
to client_order_id
.
- Rename
OrderId
toVenueOrderId
- Rename
Order.id
toOrder.venue_order_id
- Rename
Order.cl_ord_id
toOrder.client_order_id
- Rename
AssetClass.STOCK
toAssetClass.EQUITY
- Remove redundant flag
generate_position_ids
(handled byOmsType
)
- Introduce integration for Betfair.
- Add
AssetClass.METAL
andAssetClass.ENERGY
- Add
VenueStatusEvent
,InstrumentStatusEvent
andInstrumentClosePrice
- Usage of
np.ndarray
to improve function and indicator performance
- LiveLogger log message when blocking.
This release includes substantial breaking changes.
Further standardization of naming conventions along with internal refinements and fixes.
- Rename
AmendOrder
toUpdateOrder
- Rename
OrderAmended
toOrderUpdated
- Rename
amend
andamended
related methods toupdate
andupdated
- Rename
OrderCancelReject
toOrderCancelRejected
(standardize tense)
- Improve efficiency of data wrangling
- Simplify
Logger
and general system logging - Add
stdout
andstderr
log streams with configuration - Add
OrderBookData
base class
- Backtest handling of
GenericData
andOrderBook
related data - Backtest
DataClient
creation logic prevented client registering
This release includes substantial breaking changes.
Further standardization of naming conventions along with internal refinements and fixes.
- Rename
AmendOrder
toUpdateOrder
- Rename
OrderAmended
toOrderUpdated
- Rename
amend
andamended
related methods toupdate
andupdated
- Rename
OrderCancelReject
toOrderCancelRejected
(standardize tense)
- Introduce
OrderUpdateRejected
, event separated for clarity - Refined LiveLogger: Now runs on event loop with high-performance
Queue
- Improved flexibility of when strategies are added to a
BacktestEngine
- Improved checks for
VenueOrderId
equality when applying order events
- Removed
UNDEFINED
enum values. Do not allow invalid values to be represented in the system (prefer throwing exceptions)
This release includes substantial breaking changes.
The platforms internal timestamping has been standardized to nanoseconds. This
decision was made to increase the accuracy of backtests to nanosecond precision,
improve data handling including order book and custom data for backtesting, and
to future-proof the platform to a more professional standard. The top-level user
API still takes datetime
and timedelta
objects for usability.
There has also been some standardization of naming conventions to align more closely with established financial market terminology with reference to the FIX5.0 SP2 specification, and CME MDP 3.0.
- Move
BarType
intoBar
as a property - Change signature of
Bar
handling methods due to above - Remove
Instrument.leverage
(incorrect place for concept) - Change
ExecutionClient.venue
as aVenue
toExecutionClient.name
as astr
- Change serialization of timestamp datatype to
int64
- Extensive changes to serialization constant names
- Rename
OrderFilled.filled_qty
toOrderFilled.last_qty
- Rename
OrderFilled.filled_price
toOrderFilled.last_px
- Rename
avg_price
toavg_px
in methods and properties - Rename
avg_open
toavg_px_open
in methods and properties - Rename
avg_close
toavg_px_close
in methods and properties - Rename
Position.relative_quantity
toPosition.relative_qty
- Rename
Position.peak_quantity
toPosition.peak_qty
- Standardize nanosecond timestamps
- Add time unit conversion functions as found in
nautilus_trader.core.datetime
- Add optional
broker
property toVenue
to assist with routing - Enhance state reconciliation from both
LiveExecutionEngine
andLiveExecutionClient
- Add internal messages to aid state reconciliation
DataCache
incorrectly caching bars
This release adds further enhancements to the platform.
None
RiskEngine
built out including configuration options hook andLiveRiskEngine
implementation- Add generic
Throttler
- Add details
dict
toinstrument_id
related requests to cover IB futures contracts - Add missing Fiat currencies
- Add additional Crypto currencies
- Add ISO 4217 codes
- Add currency names
- Queue
put
coroutines in live engines when blocking atmaxlen
was not creating a task on the event loop.
This release applies one more major change to the identifier API. Security
has
been renamed to InstrumentId
for greater clarity that the object is an identifier,
and to group the concept of an instrument with its identifier.
Data objects in the framework have been further abstracted to prepare for the handling of custom data in backtests.
A RiskEngine
base class has also been scaffolded.
Security
renamed toInstrumentId
Instrument.security
renamed toInstrument.id
Data
becomes an abstract base class withtimestamp
andunix_timestamp
propertiesData
andDataType
moved tomodel.data
on_data
methods now takeGenericData
- Add
GenericData
- Add
Future
instrument
None
The main thrust of this release is to refine and further bed down the changes
to the identifier model via InstrumentId
, and fix some bugs.
Errors in the CCXT clients caused by the last release have been addressed.
InstrumentId
now takes first class value objectSymbol
InstrumentId
asset_class
andasset_type
no longer optionalSimulatedExchange.venue
changed toSimulatedExchange.id
- Ensure
TestTimer
advances monotonically increase - Add
AssetClass.BETTING
- CCXT data and execution clients regarding
instrument_id
vssymbol
naming InstrumentId
equality and hashing- Various docstrings
This release executes a major refactoring of Symbol
and how securities are
generally identified within the platform. This will allow a smoother integration
with Interactive Brokers and other exchanges, brokerages and trading
counterparties.
Previously the Symbol
identifier also included a venue which confused the concept.
The replacement Security
identifier more clearly expresses the domain with a
symbol string, a primary Venue
, AssetClass
and AssetType
properties.
- All previous serializations
Security
replacesSymbol
with expanded propertiesAssetClass.EQUITY
changed toAssetClass.STOCK
from_serializable_string
changed tofrom_serializable_str
to_serializable_string
changed toto_serializable_str
- Reports now include full instrument_id name
- Add
AssetType.WARRANT
StopLimitOrder
serialization
This is a patch release which applies various fixes and refactorings.
The behaviour of the StopLimitOrder
continued to be fixed and refined.
SimulatedExchange
was refactored further to reduce complexity.
None
None
TRIGGERED
states in order FSMStopLimitOrder
triggering behaviourOrderFactory.stop_limit
missingpost_only
andhidden
Order
andStopLimitOrder
__repr__
string (duplicate id)
The main thrust of this release is to refine some subtleties relating to order
matching and amendment behaviour for improved realism. This involved a fairly substantial refactoring
of SimulatedExchange
to manage its complexity, and support extending the order types.
The post_only
flag for LIMIT orders now results in the expected behaviour regarding
when a marketable limit order will become a liquidity TAKER
during order placement
and amendment.
Test coverage was moderately increased.
None
- Refactored
SimulatedExchange
order matching and amendment logic - Add
risk
subpackage to group risk components
StopLimitOrder
triggering behaviour- All flake8 warnings
The main thrust of this release is to introduce the Interactive Brokers integration, and begin adding platform capabilities to support this effort.
from_serializable_string
methods changed tofrom_serializable_str
- Scaffold Interactive Brokers integration in
adapters/ib
- Add the
Future
instrument type - Add the
StopLimitOrder
order type - Add the
Data
andDataType
types to support custom data handling - Add the
InstrumentId
identifier types initial implementation to support extending the platforms capabilities
BracketOrder
correctness- CCXT precision parsing bug
- Some log formatting