Released on 9th February 2024 (UTC).
- Refined logging system module and writers in Rust, thanks @ayush-sb and @twitu
- Improved Interactive Brokers adapter symbology and parsing with a
strict_symbologyoption, thanks @rsmb7z and @fhill2
- Reorganized configuration objects (separated into a
configmodule per subpackage, with re-exports fromnautilus_trader.config)
- Fixed
BacktestEngineandTraderdisposal (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
Released on 2nd February 2024 (UTC).
None
None
- Fixed Interactive Brokers get account positions bug (#1475), thanks @benjaminsingleton
- Fixed
TimeBarAggregatorhandling of interval types on build - Fixed
BinanceSpotExecutionClientnon-existent method name, thanks @sunlei - Fixed unused
psutilimport, thanks @sunlei
Released on 26th January 2024 (UTC).
- Add warning log when
bypass_loggingis set true for aLIVEcontext - Improved
register_serializable objectto also add type to internal_EXTERNAL_PUBLIHSABLE_TYPES - Improved Interactive Brokers expiration contract parsing, thanks @fhill2
- Changed
StreamingConfig.include_typestype fromtuple[str]tolist[type](better alignment with other type filters) - Consolidated
clockmodule intocomponentmodule (reduce binary wheel size) - Consolidated
loggingmodule intocomponentmodule (reduce binary wheel size)
- Fixed Arrow serialization of
OrderUpdated(trigger_pricetype was incorrect), thanks @benjaminsingleton - Fixed
StreamingConfig.include_typesbehavior (was not being honored for instrument writers), thanks for reporting @doublier1 - Fixed
ImportableStrategyConfigtype assignment inStrategyFactory(#1470), thanks @rsmb7z
Released on 22nd January 2024 (UTC).
- Added
LogLevel.OFF(matches the Rusttracinglog levels) - Added
init_loggingfunction with sensible defaults to initialize the Rust implemented logging system - Updated Binance Futures enum members for
BinanceFuturesContractTypeandBinanceFuturesPositionUpdateReason - Improved log header using the
sysinfocrate (adds swap space metrics and a PID identifier) - Removed Python dependency on
psutil
- Removed
clockparameter fromLogger(no dependency onClockanymore) - Renamed
LoggerAdaptertoLogger(and removed oldLoggerclass) - Renamed
Loggercomponent_nameparameter toname(matches Python built-inloggingAPI) - Renamed
OptionKindkindparameter and property tooption_kind(better clarity) - Renamed
OptionsContractArrow schema fieldkindtooption_kind - Changed
level_filelog level toOFF(file logging is off by default)
- Fixed memory leak for catalog queries (#1430), thanks @twitu
- Fixed
DataEngineorder book snapshot timer names (could not parse instrument IDs with hyphens), thanks for reporting @x-zho14 and @dimitar-petrov - Fixed
LoggingConfigparsing ofWARNINGlog level (was not being recognized), thanks for reporting @davidsblom - Fixed Binance Futures
QuoteTickparsing to capture event time forts_event, thanks for reporting @x-zho14
Released on 12th January 2024 (UTC).
- Added
NautilusConfig.json_primitivesto convert object to Python dictionary with JSON primitive values - Added
InstrumentClass.BOND - Added
MessageBusConfiguse_trader_prefixanduse_trader_idoptions (provides more control over stream names) - Added
CacheConfig.drop_instruments_on_reset(default true to retain current behavior) - Implemented core logging interface via the
logcrate, 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
RuntimeErroronly when needed (not when using TWS), thanks @rsmb7z - Upgraded core HTTP client to latest
hyperandreqwest, thanks @ayush-sb - Optimized Arrow encoding (resulting in ~100x faster writes for the Parquet data catalog)
- Changed
ParquetDataCatalogcustom data prefix fromgeneticdata_tocustom_(you will need to rename any catalog subdirs) - Changed
ComponentStateChangedArrow schema forconfigfromstringtobinary - Changed
OrderInitializedArrow schema foroptionsfromstringtobinary - Changed
OrderBookDeltasdictionary representation ofdeltasfield from JSONbytesto 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
V2suffix for clarity - Renamed
GenericDatatoCustomData(more accurately reflects the nature of the type) - Renamed
DataClient.subscribed_generic_datato.subscribed_custom_data - Renamed
MessageBusConfig.streamto.streams_prefix(more accurate) - Renamed
ParquetDataCatalog.generic_datato.custom_data - Renamed
TradeReporttoFillReport(more conventional terminology, and more clearly separates market data from user execution reports) - Renamed
asset_typetoinstrument_classacross the codebase (more conventional terminology) - Renamed
AssetTypeenum toInstrumentClass(more conventional terminology) - Renamed
AssetClass.BONDtoAssetClass.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
multiplierparam fromEquityconstructor (not applicable) - Removed
size_precision,size_increment, andmultiplierfields fromEquitydictionary representation (not applicable) - Removed
TracingConfig(now redundant with new logging implementation) - Removed
Tickerdata type and associated methods (not a type which can be practically normalized and so becomes adapter specific generic data) - Moved
AssetClass.SPORTS_BETTINGtoInstrumentClass.SPORTS_BETTING
- Fixed logger thread leak, thanks @twitu
- Fixed handling of configuration objects to work with
StreamingFeatherWriter - Fixed
BinanceSpotInstrumentProviderfee 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_MATCHwhich is when an order was canceled by the exchange due self-trade prevention (STP), thanks for reporting @doublier1
Released on 23rd December 2023 (UTC).
- Added
CacheDatabaseFacadeandCacheDatabaseAdapterto abstract backing technology from Python codebase - Added
RedisCacheDatabaseimplemented in Rust with separate MPSC channel thread for insert, update and delete operations - Added TA-Lib integration, thanks @rsmb7z
- Added
OrderBookDeltaandOrderBookDeltasto serializable and publishable types - Moved
PortfolioFacadetoActor - Improved
ActorandStrategyusability to be more lenient to mistaken calls toclockandloggerfrom the constructor (warnings also added to docs) - Removed
redisandhiredisdependencies from Python codebase
- Changed configuration objects to take stronger types as these are now serializable when registered (rather than primitives)
- Changed
NautilusKernelConfig.trader_idto typeTraderId - Changed
BacktestDataConfig.instrument_idto typeInstrumentId - Changed
ActorConfig.component_idto typeComponentId | None - Changed
StrategyConfig.strategy_idto typeStrategyId | None - Changed
Instrument,OrderFilledandAccountStateinfofield serialization due below fix (you'll need to flush your cache) - Changed
CacheConfigto take aDatabaseConfig(better symmetry withMessageBusConfig) - Changed
RedisCacheDatabasedata structure for currencies from hashset to simpler key-value (you'll need to clear cache or delete all curreny keys) - Changed
Actorstate loading to now use the standardSerializer - Renamed
register_json_encodingtoregister_config_encoding - Renamed
register_json_decodingtoregister_config_decoding - Removed
CacheDatabaseConfig(due above config change) - Removed
infrastructuresubpackage (now redundant with new Rust implementation)
- Fixed
jsonencoding forCacheDatabaseAdapterfrominfofield serialization fix below - Fixed
Instrument,OrderFilledandAccountStateinfofield serialization to retain JSON serializable dicts (rather than double encoding and losing information) - Fixed Binance Futures
good_till_datevalue whentime_in_forcenot GTD, such as when strategy is managing the GTD (was incorrectly passing through UNIX milliseconds) - Fixed
Executorhandling of queued task IDs (was not discarding from queued tasks on completion) - Fixed
DataEnginehandling 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
BacktestEngineOrderEmulator reset, thanks @davidsblom - Fixed
Throttler.resetand reset ofRiskEnginethrottlers, thanks @davidsblom
Released on 2nd December (UTC).
This release adds support for Python 3.12.
- 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-openorright-open) - Added
LoggingConfig.log_colorsto optionally use ANSI codes to produce colored logs (default true to retain current behavior) - Added
QuoteTickDataWrangler.process_bar_dataoptions foroffset_interval_msandtimestamp_is_close - Added identifier generators in Rust, thanks @filipmacek
- Added
OrderFactoryin Rust, thanks @filipmacek - Added
WilderMovingAveragein Rust, thanks @ayush-sb - Added
HullMovingAveragein Rust, thanks @ayush-sb - Added all common identifier generators in Rust, thanks @filipmacek
- Added generic SQL database support with
sqlxin Rust, thanks @filipmacek
- Consolidated all
datasubmodules into onedatamodule (reduce binary wheel size) - Moved
OrderBookfrommodel.orderbook.booktomodel.book(subpackage only had this single module) - Moved
Currencyfrommodel.currencytomodel.objects(consolidating modules to reduce binary wheel size) - Moved
MessageBusfromcommon.msgbustocommon.component(consolidating modules to reduce binary wheel size) - Moved
MsgSpecSerializerfromserialization.msgpack.serializertoserialization.serializer - Moved
CacheConfigsnapshot_orders,snapshot_positions,snapshot_positions_intervaltoNautilusKernelConfig(logical applicability) - Renamed
MsgPackSerializertoMsgSpecSeralizer(now handles both JSON and MsgPack formats)
- Fixed missing
trader_idinPositiondictionary 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
RiskEnginecumulative notional risk check forCurrencyPairSELL orders on multi-currency cash accounts
Released on 3rd November 2023 (UTC).
- Improved internal latency for live engines by using
loop.call_soon_threadsafe(...) - Improved
RedisCacheDatabaseclient connection error handling with retries - Added
WebSocketClientconnection headers, thanks @ruthvik125 and @twitu - Added
support_contingent_ordersoption for venues (to simulate venues which do not support contingent orders) - Added
StrategyConfig.manage_contingent_ordersoption (to automatically manage open contingent orders) - Added
FuturesContract.activation_utcproperty which returns apd.Timestamptz-aware (UTC) - Added
OptionsContract.activation_utcproperty which returns apd.Timestamptz-aware (UTC) - Added
CryptoFuture.activation_utcproperty which returns apd.Timestamptz-aware (UTC) - Added
FuturesContract.expiration_utcproperty which returns apd.Timestamptz-aware (UTC) - Added
OptionsContract.expiration_utcproperty which returns apd.Timestamptz-aware (UTC) - Added
CryptoFuture.expiration_utcproperty which returns apd.Timestamptz-aware (UTC)
- Renamed
FuturesContract.expiry_datetoexpiration_ns(and associated params) asuint64_tUNIX nanoseconds - Renamed
OptionsContract.expiry_datetoexpiration_ns(and associated params) asuint64_tUNIX nanoseconds - Renamed
CryptoFuture.expiry_datetoexpiration_ns(and associated params) asuint64_tUNIX nanoseconds - Changed
FuturesContractArrow schema - Changed
OptionsContractArrow schema - Changed
CryptoFutureArrow schema - Transformed orders will now retain the original
ts_inittimestamp - Removed unimplemented
batch_moreoption forStrategy.modify_order - Removed
InstrumentProvider.venueproperty (redundant as a provider may have many venues) - Dropped support for Python 3.9
- Fixed
ParquetDataCatalogfile writing template, thanks @limx0 - Fixed
Binanceall orders requests which would omit order reports when using astartparam - 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
BacktestEnginelogging error with immediate stop (caused by certain timestamps beingNone) - Fixed
BacktestNodeexceptions during backtest runs preventing next sequential run, thanks for reporting @cavan-black - Fixed
BinanceSpotPersmissionvalue error by relaxing typing forBinanceSpotSymbolInfo.permissions - Interactive Brokers adapter various fixes, thanks @rsmb7z
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.
- Added
ParquetDataCatalogv2 supporting built-in data typesOrderBookDelta,QuoteTick,TradeTickandBar - Added
Strategyspecific order and position event handlers - Added
ExecAlgorithmspecific order and position event handlers - Added
Cache.is_order_pending_cancel_local(...)(tracks local orders in cancel transition) - Added
BinanceTimeInForce.GTDenum 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_gtdoption (to remap to GTC and locally manage GTD orders) - Added package version check for
nautilus_ibapi, thanks @rsmb7z - Added
RiskEnginemin/max instrument notional limit checks - Added
Controllerfor 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
WebSocketClientlive subscribe and unsubscribe - Implemented
BinanceCommonDataClientretries forupdate_instruments - Decythonized
Trader
- Renamed
BookType.L1_TBBOtoBookType.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
InstrumentStatusfields/schema and constructor - Moved
manage_gtd_expiryfromStrategy.submit_order(...)andStrategy.submit_order_list(...)toStrategyConfig(simpler and allows re-activiting any GTD timers on start)
- Fixed
LimitIfTouchedOrder.create(exec_algorithm_paramswere not being passed in) - Fixed
OrderEmulatorstart-up processing of OTO contingent orders (when position from parent is open) - Fixed
SandboxExecutionClientConfigkw_only=Trueto allow importing without initializing - Fixed
OrderBookpickling (did not include all attributes), thanks @limx0 - Fixed open position snapshots race condition (added
open_onlyflag) - Fixed
Strategy.cancel_orderfor orders inINITIALIZEDstate and with anemulation_trigger(was not sending command toOrderEmulator) - Fixed
BinanceWebSocketClientreconnect 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
Timermissing condition check for non-positive intervals - Fixed
Conditionchecks 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 finalFILLEDstatus, thanks @r3k4mn14r
Released on 2nd September 2023 (UTC).
None
None
- Fixed
OrderBookDelta.clearmethod (where thesequencefield was swapped withflagscausing an overflow) - Fixed
OrderManagerOTO contingency handling on fills - Fixed
OrderManagerduplicate order canceled events (race condition when processing contingencies) - Fixed
Cacheloading 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
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.
- Added
ActorExecutorwithActorAPI for creating and running threaded tasks in live environments - Added
OrderEmulatedevent and associatedOrderStatus.EMULATEDenum variant - Added
OrderReleasedevent and associatedOrderStatus.RELEASEDenum variant - Added
BacktestVenueConfig.use_position_idsoption (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
- Renamed
QuoteTick.bidtobid_priceincluding all associated parameters (for explicit naming standards) - Renamed
QuoteTick.asktoask_priceincluding all associated parameters (for explicit naming standards)
- Fixed execution algorithm
position_idassignment inHEDGINGmode - Fixed
OrderMatchingEngineprocessing of emulated orders - Fixed
OrderEmulatorprocessing of exec algorithm orders - Fixed
ExecutionEngineprocessing of exec algorithm orders (exec spawn IDs) - Fixed
Cacheemulated order indexing (were not being properly discarded from the set when closed) - Fixed
RedisCacheDatabaseloading of transformedLIMITorders - Fixed a connection issue with the IB client, thanks @dkharrat and @rsmb7z
Released on 31st July 2023 (UTC).
- Implemented string interning with the ustr crate, thanks @twitu
- Added
SyntheticInstrumentcapability, including dynamic derivation formulas - Added
Order.commissions()convenience method (also added to state snapshot dictionaries) - Added
Cacheposition and order state snapshots (configure viaCacheConfig) - Added
CacheDatabaseConfig.timestamps_as_iso8601to persist timestamps as ISO 8601 strings - Added
LiveExecEngineConfig.filter_position_reportsto filter position reports from reconciliation - Added
Strategy.cancel_gtd_expiryto cancel managed GTD order expiration - Added Binance Futures support for modifying
LIMITorders - Added
BinanceExecClientConfig.max_retriesoption (for retrying order submit and cancel requests) - Added
BinanceExecClientConfig.retry_delayoption (the delay between retry attempts) - Added
BinanceExecClientConfig.use_reduce_onlyoption (default true to retain current behavior) - Added
BinanceExecClientConfig.use_position_idsoption (default true to retain current behavior) - Added
BinanceExecClientConfig.treat_expired_as_canceledoption (default false to retain current behavior) - Added
BacktestVenueConfig.use_reduce_onlyoption (default true to retain current behavior) - Added
MessageBus.is_pending_request(...)method - Added
LevelAPI 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
OrderMatchingEnginehandling when no fills (an error is now logged) - Improved
Binancelive clients logging - Upgraded Cython to 3.0.0 stable
- Moved
filter_unclaimed_external_ordersfromExecEngineConfigtoLiveExecEngineConfig - All
Actor.request_*methods no longer take arequest_id, but now return aUUID4request ID - Removed
BinanceExecClientConfig.warn_gtd_to_gtd(now always anINFOlevel log) - Renamed
Instrument.native_symboltoraw_symbol(you must manually migrate or flush your cached instruments) - Renamed
Position.cost_currencytosettlement_currency(standardize terminology) - Renamed
CacheDatabaseConfig.flushtoflush_on_start(for clarity) - Changed
Order.ts_lastto represent the UNIX nanoseconds timestamp of the last event (rather than fill)
- Fixed
Portfolio.net_positioncalculation to useDecimalrather thanfloatto avoid rounding errors - Fixed race condition on
OrderFactoryorder identifiers generation - Fixed dictionary representation of orders for
venue_order_id(for three order types) - Fixed
Currencyregistration with core global map on creation - Fixed serialization of
OrderInitialized.exec_algorithm_paramsto spec (bytes rather than string) - Fixed assignment of position IDs for contingent orders (when parent filled)
- Fixed
PENDING_CANCEL->EXPIREDas valid state transition (real world possibility) - Fixed fill handling of
reduce_onlyorders 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
PositionStatusReportparsing of position side - Fixed Binance Futures
TradeReportassignment of position ID (was hardcoded to hedging mode) - Fixed Binance execution submitting of order lists
- Fixed Binance commission rates requests for
InstrumentProvider - Fixed Binance
TriggerTypeparsing #1154, thanks for reporting @davidblom603 - Fixed Binance order parsing of invalid orders in execution reports #1157, thanks for reporting @graceyangfan
- Extended
BinanceOrderTypeenum members to include undocumentedINSURANCE_FUND, thanks for reporting @Tzumx - Extended
BinanceSpotPermissionsenum members #1161, thanks for reporting @davidblom603
Released on 16th June 2023 (UTC).
The Betfair adapter is broken for this release pending integration with the new Rust order book. We recommend you do not upgrade to this version if you're using the Betfair adapter.
- Integrated Interactive Brokers adapter v2 into platform, thanks @rsmb7z
- Integrated core Rust
OrderBookinto platform - Integrated core Rust
OrderBookDeltadata type - Added core Rust
HttpClientbased onhyper, thanks @twitu - Added core Rust
WebSocketClientbased ontokio-tungstenite, thanks @twitu - Added core Rust
SocketClientbased ontokioTcpStream, thanks @twitu - Added
quote_quantityparameter to determine if order quantity is denominated in quote currency - Added
trigger_instrument_idparameter to trigger emulated orders from alternative instrument prices - Added
use_random_idstoadd_venue(...)method, controls whether venue order, position and trade IDs will be random UUID4s (no change to current behavior) - Added
ExecEngineConfig.filter_unclaimed_external_ordersoptions, if unclaimed order events with anEXTERNALstrategy ID should be filtered/dropped - Changed
BinanceHttpClientto use new core HTTP client - Defined public API for data, can now import directly from
nautilus_trader.model.data(denest namespace) - Defined public API for events, can now import directly from
nautilus_trader.model.events(denest namespace)
- Upgraded
pandasto v2 - Removed
OrderBookSnapshot(redundant as can be represented as an initial CLEAR followed by deltas) - Removed
OrderBookData(redundant) - Renamed
Actor.handle_order_book_deltatohandle_order_book_deltas(to more clearly reflect theOrderBookDeltasdata type) - Renamed
Actor.on_order_book_deltatoon_order_book_deltas(to more clearly reflect theOrderBookDeltasdata type) - Renamed
inverse_as_quotetouse_quote_for_inverse(ambiguous name, only applicable for notional calcs on inverse instruments) - Changed
Datacontract (custom data), see docs - Renamed core
LogMessagetoLogEventto more clearly distinguish between themessagefield and the event struct itself (aligns with vector language) - Renamed core
LogEvent.timestamp_nstoLogEvent.timestamp(affects field name for JSON format) - Renamed core
LogEvent.msgtoLogEvent.message(affects field name for JSON format)
- Updated
BinanceAccountTypeenum members and associated docs - Fixed
BinanceCommonExecutionClientiteration ofOrderListorders - Fixed heartbeats for
BinanceWebSocketClient(new Rust client now responds withpongframes) - Fixed Binance adapter typing for
orderId,fromId,startTimeandendTime(all are ints), thanks for reporting @davidsblom - Fixed
Currencyequality to be based on thecodefield (avoiding equality issues over FFI), thanks for reporting @Otlk - Fixed
BinanceInstrumentProviderparsing of initial and maintenance margin values
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.datainto themodel.data.booknamespace
- Improved handling for backtest account blow-up scenarios (balance negative or margin exceeded)
- Added
AccountMarginExceededexception and refinedAccountBalanceNegative - Various improvements to
Binanceclients 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
OrderEmulatorreleasing of already closed orders - Fixed
MatchingEngineprocessing of reduce only for child contingent orders - Fixed
MatchingEngineposition ID assignment for child contingent orders - Fixed
Actorhandling of historical data from requests (will now callon_historical_dataregardless of state), thanks for reporting @miller-moore - Fixed
pyarrowschema dictionary index keys being too narrow (int8 -> int16), thanks for reporting @rterbush
Released on 5th May 2023 (UTC).
None
None
- Fixed
BacktestEngineprocessing 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_onlyinstruction, 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
INITIALIZEDstatus)
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_limitconfig params) - Renamed
Futureinstrument toFuturesContract(avoids ambiguity) - Renamed
Optioninstrument 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_claimsconfig 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
TWAPExecAlgorithmandTWAPExecAlgorithmConfigto examples - Build out
ExecAlgorithmbase class for implementing 'first class' execution algorithms - Rewired execution for improved flow flexibility between emulated orders, execution algorithms and the
RiskEngine - Improved handling for
OrderEmulatorupdating of contingent orders from execution algorithms - Defined public API for instruments, can now import directly from
nautilus_trader.model.instruments(denest namespace) - Defined public API for orders, can now import directly from
nautilus_trader.model.orders(denest namespace) - Defined public API for order book, can now import directly from
nautilus_trader.model.orderbook(denest namespace) - Now stripping debug symbols after build (reduced binary wheel size)
- Refined build and added additional
debugMakefile convenience targets
- Fixed processing of contingent orders when in a pending update state
- Fixed calculation of PnL for flipped positions (only book realized PnL against open position)
- Fixed
WebSocketClientsession disconnect, thanks for reporting @miller-moore - Added missing
BinanceSymbolFilterType.NOTIONAL - Fixed incorrect
Multrait forPriceandQuantity(not being used in Cython/Python layer)
Released on 30th March 2023 (UTC).
- Renamed all position
net_qtyfields and parameters tosigned_qty(more accurate naming) NautilusKernelConfigremoved alllog_*config options (replaced byloggingwithLoggingConfig)- Trading
CurrencyPairinstruments with a single-currencyCASHaccount type no longer permitted (unrealistic) - Changed
PositionEventparquet schemas (renamednet_qtyfield tosigned_qty)
- Added
LoggingConfigto consolidate logging configs, offering various file options and per component level filters - Added
BacktestVenueConfig.bar_executionto control whether bar data moves the matching engine markets (reinstated) - Added optional
request_idfor actor data requests (aids processing responses), thanks @rsmb7z - Added
Position.signed_decimal_qty() - Now using above signed quantity for
Portfolionet position calculation, andLiveExecutionEnginereconciliation comparisons
- Fixed
BacktestEngineclock and logger handling (had a redundant extra logger and not swapping live clock in post run) - Fixed
close_positionorder event publishing and cache persistence forMarketOrderandSubmitOrder, thanks for reporting @rsmb7z
Released on 11th March 2023 (UTC).
- Moved
backtest.data.providerstotest_kit.providers - Moved
backtest.data.wranglerstopersistence.wranglers(to be consolidated) - Moved
backtest.data.loaderstopersistence.loaders(to be consolidated) - Renamed
from_datetimetostartacross data request methods and properties - Renamed
to_datetimetoendacross 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
DataCatalogConfigfor more cohesive data catalog configuration - Added
DataEngine.register_catalogto support historical data requests - Added
catalog_configfield to baseNautilusKernelConfig - Changed to immediately caching orders and order lists in
Strategy - Changed to checking duplicate
client_order_idandorder_list_idinStrategy - Changed generating and applying
OrderPendingUpdateandOrderPendingCancelinStrategy PortfolioAnalyzerPnL statistics now take optionalunrealized_pnl- Backtest performance statistics now include unrealized PnL in total PnL
- Fixed Binance Futures trigger type parsing
- Fixed
DataEnginebar subscribe and unsubscribe logic, thanks for reporting @rsmb7z - Fixed
Actorhandling of bars, thanks @limx0 - Fixed
CancelAllOrderscommand handling for contingent orders not yet in matching core - Fixed
TrailingStopMarketOrderslippage calculation when notrigger_price, thanks for reporting @rsmb7z - Fixed
BinanceSpotInstrumentProviderparsing of quote asset (was using base), thanks for reporting @logogin - Fixed undocumented Binance time in force 'GTE_GTC', thanks for reporting @graceyangfan
- Fixed
Positioncalculation oflast_qtywhen commission currency was equal to base currency, thanks for reporting @rsmb7z - Fixed
BacktestEnginepost backtest run PnL performance statistics for currencies traded per venue, thanks for reporting @rsmb7z
Released on 18th February 2023 (UTC).
NautilusConfigobjects now pseudo-immutable from new msgspec 0.13.0- Renamed
OrderFactory.bracketparampost_only_entry->entry_post_only(consistency with other params) - Renamed
OrderFactory.bracketparampost_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_closeoption 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
MatchingEnginepublic 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 refineActorbase registration) - Fixed loading of previously emulated and transformed orders (handles transforming
OrderInitializedevent) - Fixed handling of
MARKET_TO_LIMITorders 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
Actorcached 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_idtosequence - Renamed
BookOrder.idtoorder_id
- Introduced Rust pyo3 based
ParquetReaderandParquetWriter, 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
NautilusKernelredundant initialization of event loop for backtesting, thanks @limx0 - Fixed
BacktestNodedisposal sequence - Fixed quick start docs and notebook
Released on 17th January 2023 (UTC).
Position.unrealized_pnlnowNoneuntil 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
Positionrealized_pnlandrealized_returnfields, which were incorrectly cumulative - Fixed netted
Positionflip 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.NONEtoNO_AGGRESSOR - Renamed
AggressorSide.BUYtoBUYER - Renamed
AggressorSide.SELLtoSELLER - Renamed
AssetClass.CRYPTOtoCRYPTOCURRENCY - Renamed
LiquiditySide.NONEtoNO_LIQUIDITY_SIDE - Renamed
OMSTypetoOmsType - Renamed
OmsType.NONEtoUNSPECIFIED - Renamed
OrderSide.NONEtoNO_ORDER_SIDE - Renamed
PositionSide.NONEtoNO_POSITION_SIDE - Renamed
TrailingOffsetType.NONEtoNO_TRAILING_OFFSET - Removed
TrailingOffsetType.DEFAULT - Renamed
TriggerType.NONEtoNO_TRIGGER - Renamed
TriggerType.LASTtoLAST_TRADE - Renamed
TriggerType.MARKtoMARK_PRICE - Renamed
TriggerType.INDEXtoINDEX_PRICE - Renamed
ComponentState.INITIALIZEDtoREADY - Renamed
OrderFactory.bracket(post_only)topost_only_entry - Moved
manage_gtd_expirytoStrategy.submit_order(...)andStrategy.submit_order_list(...)
- Added
BarSpecification.timedeltaproperty, thanks @rsmb7z - Added
DataEngineConfig.build_time_bars_with_no_updatesoption - Added
OrderFactory.bracket(post_only_tp)param - Added
OrderListIdGeneratorand 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
OrderListIdfrom factory to ensure uniqueness - Added auction matches for backtests, thanks @limx0
- Added
.timedeltaproperty 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 forBardata), thanks @rsmb7z
- Added
TRD_GRP_*enum variants for Binance spot permissions - Fixed
PARTIALLY_FILLED->EXPIREDorder state transition, thanks @bb01100100
Released on 23rd December 2022 (UTC).
None
- Added managed GTD order expiry (experimental feature, config may change)
- Added Rust
ParquetReaderandParquetWriter(forQuoteTickandTradeTickonly)
- Fixed
MARKET_IF_TOUCHEDorders forOrderFactory.bracket(..) - Fixed
OrderEmulatortrigger event handling for live trading - Fixed
OrderEmulatortransformation to market orders which had a GTD time in force - Fixed serialization of
OrderUpdatedevents - 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_TOUCHEDandLIMIT_IF_TOUCHEDtrigger and modify behavior - Fixed
MatchingEngineupdates 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).
OrderFactorybracket order methods consolidated to.bracket(...)
- Extended
OrderFactoryto provide more bracket order types - Simplified GitHub CI and removed
noxdependency
- Fixed
OrderBooksorting for bid side, thanks @gaugau3000 - Fixed
MARKET_TO_LIMITorder initial fill behavior - Fixed
BollingerBandsindicator mid-band calculations, thanks zhp (Discord)
Released on 10th December 2022 (UTC).
- Renamed
OrderFactory.bracket_markettoOrderFactory.bracket_market_entry - Renamed
OrderFactory.bracket_limittoOrderFactory.bracket_limit_entry - Renamed
OrderFactorybracket orderpriceandtrigger_priceparameters
- Added support for Python 3.11
- Consolidated config objects to
msgspecproviding 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_MARKETorder behavior to fill at market on immediate trigger - Fixed
STOP_LIMITorder behavior to fill at market on immediate trigger and marketable - Fixed
STOP_LIMITorder behavior to fill at market on processed trigger and marketable - Fixed
LIMIT_IF_TOUCHEDorder behavior to fill at market on immediate trigger and marketable - Fixed Binance start and stop time units for bar (kline) requests, thanks @Tzumx
RiskEngineConfig.bypassset toTruewill 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
ClientOrderIdandPositionOrderId) - Renamed
orderbook.data.Ordertoorderbook.data.BookOrder(reduce conflicts/confusion) - Renamed
Instrument.get_cost_currency(...)toInstrument.get_settlement_currency(...)(more accurate terminology)
- Added emulated contingent orders capability to
OrderEmulator - Moved
test_kitmodule to main package to support downstream project/package testing
- Fixed position event sequencing: now generates
PositionOpenedwhen reopening a closed position - Fixed
LIMITorder fill characteristics when immediately marketable as a taker - Fixed
LIMITorder fill characteristics when passively filled as a maker as quotes move through - Fixed canceling OTO contingent orders when still in-flight
- Fixed
RiskEnginenotional 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.listtoSubmitOrderList.order_list - Slight adjustment to bar aggregation (will not use the last close as the open)
- Implemented
TRAILING_STOP_MARKETorders for Binance Futures (beta) - Added
OUOOne-Updates-OtherContingencyTypewith 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
ModifyOrdermessagestrandreprwhen no quantity - Fixed OCO contingent 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.reconciliationboolean 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
BidAskMinMaxindicator (to reduce total package size) - Removed
HilbertPeriodindicator (to reduce total package size) - Removed
HilbertSignalNoiseRatioindicator (to reduce total package size) - Removed
HilbertTransformindicator (to reduce total package size)
- Improved accuracy of clocks for backtests (all clocks will now match generated
TimeEvents) - Improved risk engine checks for
reduce_onlyorders - Added
Actor.request_instruments(...)method - Added
Order.would_reduce_only(...)method - Extended instrument(s) Req/Res handling for
DataClientand `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
MARKETandMARKET_TO_LIMIT) see docs - Added
min_latency,max_latencyandavg_latencytoHttpClientbase class
- Fixed Binance Spot
display_qtyfor 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.NONEenum variant - Added
PositionSide.NO_POSITION_SIDEenum variant - Changed order of
TriggerTypeenum variants - Renamed
AggressorSide.UNKNOWNtoAggressorSide.NONE(for consistency with other enums) - Renamed
Order.typetoOrder.order_type(reduces ambiguity and aligns with Rust struct field) - Renamed
OrderInitialized.typetoOrderInitialized.order_typereduces ambiguity) - Renamed
Bar.typetoBar.bar_type(reduces ambiguity and aligns with Rust struct field) - Removed redundant
check_position_existsflag - Removed
hyperoptas considered unmaintained and there are better options - Existing pickled data for
QuoteTickis now invalid (change to schema for correctness) - Existing catalog data for
OrderInitializedis now invalid (change to schema for emulation)
- Added configurable automated in-flight order status checks
- Added order
sidefilter to numerous cache order methods - Added position
sidefilter to numerous cache position methods - Added optional
order_sidetocancel_all_ordersstrategy method - Added optional
position_sidetoclose_all_positionsstrategy method - Added support for Binance Spot second bars
- Added
RelativeVolatilityIndexindicator, thanks @graceyangfan - Extracted
OrderMatchingEnginefromSimulatedExchangewith refinements - Extracted
MatchingCorefromOrderMatchingEngine - Improved HTTP error handling and client logging (messages now contain reason)
- Fixed price and size precision validation for
QuoteTickfrom raw values - Fixed IB adapter data parsing for decimal precision
- Fixed HTTP error handling and releasing of response coroutines, thanks @JackMa
- Fixed
Positioncalculations 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
ExecEngineConfigallow_cash_positionsdefault toTrue(more typical use case) - Removed
checkparam fromBar(always checked for simplicity)
- Added
MARKET_TO_LIMITorder implementation forSimulatedExchange - Make strategy
order_id_tagtruly optional and auto incrementing - Added PsychologicalLine indicator, thanks @graceyangfan
- Added initial Rust parquet integration, thanks @twitu and @ghill2
- Added validation for setting leverages on
CASHaccounts - De-cythonized live data and execution client base classes for usability
- Fixed limit order
IOCandFOKbehavior, thanks @limx0 for identifying - Fixed FTX
CryptoFutureinstrument parsing, thanks @limx0 - Fixed missing imports in data catalog example notebook, thanks @gaugau3000
- Fixed order update behavior, affected orders:
LIMIT_IF_TOUCHEDMARKET_IF_TOUCHEDMARKET_TO_LIMITSTOP_LIMIT
Released on September 6th 2022 (UTC).
None
- Added trigger orders for FTX adapter
- Improved
BinanceBarto 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_usdoption for FTX adapter - Added
log_warningsconfig option for Binance and FTX instrument providers - Added
TRD_GRP_005enum variant for Binance spot permissions
- Fixed bar aggregator partial bar handling
- Fixed
CurrencyTypevariants in Rust - Fixed missing
encodingin Catalog parsing method, thanks @limx0 and @aviatorBeijing
Released on September 1st 2022 (UTC).
- Renamed
offset_typetotrailing_offset_type - Renamed
is_frozen_accounttofrozen_account - Removed
bar_executionfrom config API (implicitly turned on with bars currently)
- Added
TRAILING_STOP_MARKETorder implementation forSimulatedExchange - Added
TRAILING_STOP_LIMITorder 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
LoopTimerin 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_datamethod with wiring for functionality - Added 'unthrottled' 0ms order book updates for Binance Futures
- Improved robustness of
WebSocketClientbase during reconnects
- Fixed sdist includes for Rust Cargo files
- Fixed
LatencyModelinteger overflows, thanks @limx0 - Fixed parsing of Binance Futures
FUNDING_FEEupdates - Fixed
asyncio.tasks.gatherfor Python 3.10+
Released on August 15th 2022 (UTC).
BacktestEnginenow required venues to be added prior to instrumentsBacktestEnginenow requires instruments to be added prior to data- Renamed
Ladder.reversetoLadder.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
Traderto run without strategies loaded - Integrated core Rust clock and timer
- De-cythonize
InstrumentProviderbase class
- Fixed double counting of commissions for single-currency and multi-currency accounts #657
Released on 27th June 2022 (UTC).
- Schema change for
Instrument.infoforParquetDataCatalog
- Added
DirectionalMovementIndicatorindicator, thanks @graceyangfan - Added
KlingerVolumeOscillatorindicator, thanks @graceyangfan - Added
clientIdandstart_gatewayfor 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_iso8601performance by 30% thanks @ghill2 - Added
DataCataloginterface forParquetDataCatalogthanks @jordanparker6 - Added
AroonOscillatorindicator thanks @graceyangfan - Added
ArcherMovingAveragesTrendsindicator thanks @graceyangfan - Added
DoubleExponentialMovingAverageindicator thanks @graceyangfan - Added
WilderMovingAverageindicator thanks @graceyangfan - Added
ChandeMomentumOscillatorindicator thanks @graceyangfan - Added
VerticalHorizontalFilterindicator thanks @graceyangfan - Added
Biasindicator 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 behavior and logging
- Improved
TradingNodedisposal flow - Implemented core monotonic clock
- Implemented logging in Rust
- Added
CommodityChannelIndexindicator thanks @graceyangfan
None
Released on 22nd May 2022 (UTC).
AccountIdconstructor now takes single value string- Removed redundant
UUIDFactoryand 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
MARGINaccounts - Fixed
net_qtyinPositionStatusReportthanks to @sidnvy - Fixed
LinearRegressionindicator 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_nsint64 rather than a datetime - All order serializations due to
expire_time_nsoption handling PortfolioAnalyzermoved fromTradertoPortfolio
PortfolioAnalyzernow 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_ordertoPosition.opening_order_id - Renamed
StreamingPersistencetoStreamingFeatherWriter - Renamed
PersistenceConfigtoStreamingConfig - Renamed
PersistenceConfig.flush_intervaltoflush_interval_ms
- Added
Actor.publish_signalfor generic dynamic signal data - Added
WEEKandMONTHbar aggregation options - Added
Position.closing_order_idproperty - Added
tagsparam toStrategy.submit_order - Added optional
check_positon_existsflag toStrategy.submit_order - Eliminated all use of
unsafeRust and C null-terminated byte strings - The
bypass_loggingconfig option will also now bypass theBacktestEnginelogger
- Fixed behavior of
IOCandFOKtime in force instructions - Fixed Binance bar resolution parsing
Released on 21st April 2022 (UTC).
None
None
- Fixed segfault for
CashAccount.calculate_balance_lockedwith no base currency - Various FeatherWriter fixes
Released on 17th April 2022 (UTC).
BacktestNodenow requires configs at initialization- Removed
run_configsparam fromBacktestNode.run()method - Removed
return_engineflag - Renamed
TradingStrategytoStrategy - Renamed
TradingStrategyConfigtoStrategyConfig - Changes to configuration object import paths
- Removed redundant
realized_pointsconcept 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
debugmode 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
TradingNodeConfigcheck_residuals_delaytotimeout_post_stop - The
SimulatedExchangewill now 'receive' market data prior to theDataEngine(note that this did not affect any test) - Tightened requirement for
DataTypetypes to be subclasses ofData CacheDatabaseConfig.typenow defaults toin-memoryNAUTILUS_CATALOGenv var changed toNAUTILUS_PATHDataCatalogroot path now located under$OLD_PATH/catalog/from the Nautilus pathhiredisandredisare now optional extras as 'redis'hyperoptis now an optional extra as 'hyperopt'
- Unify
NautilusKernelacross backtest and live systems - Improved configuration by grouping into
configsubpackage - Improved configuration objects and flows
- Numerous improvements to the Binance Spot/Margin and Futures integration
- Added Docker image builds and GH packages
- Added
BinanceFuturesMarkPriceUpdatetype and data stream - Added generic
subscribeandunsubscribeto 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_currencyfor 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
CurrencySpottoCurrencyPair - Renamed
PerformanceAnalyzertoPortfolioAnalyzer - Renamed
BacktestDataConfig.data_cls_pathtodata_cls - Renamed
BinanceTickertoBinanceSpotTicker - Renamed
BinanceSpotExecutionClienttoBinanceExecutionClient
- Added initial (beta) Binance Futures adapter implementation
- Added initial (beta) Interactive Brokers adapter implementation
- Added custom portfolio statistics
- Added
CryptoFutureinstrument - Added
OrderType.MARKET_TO_LIMIT - Added
OrderType.MARKET_IF_TOUCHED - Added
OrderType.LIMIT_IF_TOUCHED - Added
MarketToLimitOrderorder type - Added
MarketIfTouchedOrderorder type - Added
LimitIfTouchedOrderorder type - Added
Order.has_priceproperty (convenience) - Added
Order.has_trigger_priceproperty (convenience) - Added
msgparam toLoggerAdapter.exception() - Added WebSocket
log_sendandlog_recvconfig options - Added WebSocket
auto_ping_interval(seconds) config option - Replaced
msgpackwithmsgspec(faster drop in replacement https://github.com/jcrist/msgspec) - Improved exception messages by providing helpful context
- Improved
BacktestDataConfigAPI: now takes either a type ofDataor 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
workingorders toopenorders including all associated methods and params - Renamed
completedorders toclosedorders including all associated methods and params - Removed
activeorder concept (often confused withopen) - Renamed
triggertotrigger_price - Renamed
StopMarketOrder.pricetoStopMarketOrder.trigger_price - Renamed all params related to a
StopMarketOrderspricetotrigger_price - Renamed
ExecutionIdtoTradeId - Renamed
execution_idtotrade_id - Renamed
Order.trade_idtoOrder.last_trade_id(for clarity) - Renamed other variations and references of 'execution ID' to 'trade ID'
- Renamed
contingencytocontingency_type
- Introduced the
TradeIdtype to enforcetrade_idtyping - Improve handling of unleveraged cash asset positions including Crypto and Fiat spot currency instruments
- Added
ExecEngineConfigoptionallow_cash_positions(Falseby default) - Added
TrailingOffsetTypeenum - Added
TrailingStopMarketOrder - Added
TrailingStopLimitOrder - Added trailing order factory methods
- Added
trigger_typeparam to stop orders - Added
TriggerTypeenum - 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
currencyparam fromAccountBalance - Renamed
local_symboltonative_symbol - Removed the
VenueTypeenum andvenue_typeparam in favour of aroutingbool flag - Removed
account_idparam 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
MarginBalanceobject to assist with margin account functionality
- Fixed parsing of
BarTypewith symbols including hyphens- - Fixed
BinanceSpotTicker__repr__(was missing whitespace after a comma) - Fixed
DataEnginerequests for historicalTradeTick - Fixed
DataEngine_handle_data_responsetyping ofdatatoobject
Released on 29th December 2021.
- Changed
subscribe_data(...)method (client_idnow optional) - Changed
unsubscribe_data(...)method (client_idnow optional) - Changed
publish_data(...)method (addeddata_type) - Renamed
MessageBus.subscriptionsmethod param topattern - Renamed
MessageBus.has_subscribersmethod param topattern - Removed
subscribe_strategy_data(...)method - Removed
unsubscribe_strategy_data(...)method - Removed
publish_strategy_data(...)method - Renamed
CryptoSwaptoCryptoPerpetual
- Can now modify or cancel in-flight orders live and backtest
- Updated
CancelOrderto allow Nonevenue_order_id - Updated
ModifyOrderto allow Nonevenue_order_id - Updated
OrderPendingUpdateto allow Nonevenue_order_id - Updated
OrderPendingCancelto allow Nonevenue_order_id - Updated
OrderCancelRejectedto allow Nonevenue_order_id - Updated
OrderModifyRejectedto allow Nonevenue_order_id - Added
DataType.topicstring for improved message bus handling
- Implemented comparisons for
DataType,BarSpecificationandBarType - Fixed
QuoteTickDataWrangler.process_bar_datawithrandom_seed
Released on 13th December 2021.
- Renamed
match_idtotrade_id
- Added bars method to
DataCatalog - Improved parsing of Binance historical bars data
- Added
CancelAllOrderscommand - Added bulk cancel capability to Binance integration
- Added bulk cancel capability to Betfair integration
- Fixed handling of
cpu_freqcall in logging for ARM architecture - Fixed market order fill edge case for bar data
- Fixed handling of
GenericDatain backtests
Released on 22nd November 2021.
- Changed
hiddenorder option todisplay_qtyto 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
Actorclock time advancement in backtest engine
Released on 8th November 2021.
None
- Added
LatencyModelfor simulated exchange - Added
last_update_idto order books - Added
update_idto order book data - Added
depthparam when subscribing to order book deltas - Added
Clock.timestamp_ms() - Added
TestDataProviderand 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
BacktestNodefixes
Released on 24th October 2021.
Actorconstructor now takesActorConfig
- Added
ActorConfig - Added
ImportableActorConfig - Added
ActorFactory - Added
actorstoBacktestRunConfig - Improved network base classes
- Refine
InstrumentProvider
- Fixed persistence config for
BacktestNode - Various Betfair integration fixes
Released on 10th October 2021.
- Renamed
nanos_to_unix_dttounix_nanos_to_dt(more accurate name) - Changed
Clock.set_time_alert(...)method signature - Changed
Clock.set_timer(...)method signature - Removed
pd.TimestampfromTimeEvent
OrderListsubmission 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_idfor backtest runs - Added
BacktestResultobject - Added
Clock.set_time_alert_ns(...)method - Added
Clock.set_timer_ns(...)method - Added
fill_limit_at_pricesimulated exchange option - Added
fill_stop_at_pricesimulated exchange option - Improve timer and time event efficiency
- Fixed
OrderUpdatedleaves 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.runmethod signature change- Renamed
BookLeveltoBookType - Renamed
FillModelparams
- Added streaming backtest machinery.
- Added
quantstats(removedempyrical) - Added
BacktestEngine.run_streaming() - Added
BacktestEngine.end_streaming() - Added
Portfolio.balances_locked(venue) - Improved
DataCatalogfunctionality - Improved logging for
BacktestEngine - Improved parquet serialization and machinery
- Fixed
SimulatedExchangemessage processing - Fixed
BacktestEngineevent ordering in main loop - Fixed locked balance calculation for
CASHaccounts - Fixed fill dynamics for
reduce-onlyorders - Fixed
PositionIdhandling forHEDGINGOMS exchanges - Fixed parquet
Instrumentserialization - Fixed
CASHaccount PnL calculations with base currency
Released on 12th September 2021.
- Removed CCXT adapter (#428)
- Backtest configuration changes
- Renamed
UpdateOrdertoModifyOrder(terminology standardization) - Renamed
DeltaTypetoBookAction(terminology standardization)
- Added
BacktestNode - Added
BookIntegrityErrorwith 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
ContingencyTypeenum (for contingent orders in anOrderList) - All order types can now be
reduce_only(#437) - Refined backtest configuration options
- Improved efficiency of
UUID4using the RustfastuuidPython bindings
- Fixed Redis loss of precision for
int64_tnanosecond timestamps (#363) - Fixed behavior of
reduce_onlyorders for both submission and filling (#437) - Fixed PnL calculation for
CASHaccounts 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
pydanticupgrade - Throttling config now takes string e.g. "100/00:00:01" which is 100 / second
- Renamed
DataProducerFacadetoDataProducer - Renamed
fill.sidetofill.order_side(clarity and standardization) - Renamed
fill.typetofill.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
activeconcept, withorder.is_activeand cache methods - Added
ComponentStateChangedevent - 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
Tickerdata 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
InstrumenttoAccount - Removed redundant
Portfolio.register_account - Renamed
OrderStatetoOrderStatus - Renamed
Order.statetoOrder.status - Renamed
msgbus.message_bustomsgbus.bus
- Betfair adapter re-write
- Extracted
accountingsubpackage - Extracted
portfoliosubpackage - Subclassed
AccountwithCashAccountandMarginAccount - 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_accountfor custom account classes - Separate
PortfolioFacadefromPortfolio
- Data subscription handling in
DataEngine Cashaccounts no longer generate spurious margins- Fix
TimeBarAggregator._stored_close_nsproperty 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
DataEngineorder 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_nstots_init - Renamed
ts_recv_nstots_event - Renamed various event timestamp parameters to
ts_event - Removed null object methods on identifiers
- Added
Actorcomponent 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
ExecutionEngineposition 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
MessageTypeenum toMessageCategory - Renamed
fill.order_sidetofill.side - Renamed
fill.order_typetofill.type - All
Eventserialization due to domain refactorings
- Added
MessageBusclass - Added
TraderIdtoOrderandPosition - Added
OrderTypeto OrderFilled - Added unrealized PnL to position events
- Added order in-flight concept to
OrderandCache - Improved efficiency of
Throttler - Standardized events
strandrepr - Standardized commands
strandrepr - Standardized identifiers on events and objects
- Improved
Accountstrandrepr - Using
orjsonoverjsonfor efficiency - Removed redundant
BypassCacheDatabase - Introduced
mypyto 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_nstots_opened_ns - Renamed
Position.closed_timestamp_nstots_closed_ns - Renamed
Position.open_duration_nstoduration_ns - Renamed Loggers
bypass_loggingtobypass - Refactored
PositionEventtypes
- Add pre-trade risk checks to
RiskEngineiteration 2 - Improve
Throttlerfunctionality and performance - Removed redundant
OrderInvalidstate and associated code - Improve analysis reports
- PnL calculations for
CASHaccount 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_REPLACEtoOrderState.PENDING_UPDATE - Renamed
timestamp_origin_nstots_event_ns - Renamed
timestamp_nsfor data tots_recv_ns - Renamed
updated_nstots_updated_ns - Renamed
submitted_nstots_submitted_ns - Renamed
rejected_nstots_rejected_ns - Renamed
accepted_nstots_accepted_ns - Renamed
pending_nstots_pending_ns - Renamed
canceled_nstots_canceled_ns - Renamed
triggered_nstots_triggered_ns - Renamed
expired_nstots_expired_ns - Renamed
execution_nstots_filled_ns - Renamed
OrderBookLeveltoBookLevel - Renamed
Order.volumetoOrder.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_analysisconfig option forBacktestEngine - Removed
TradeMatchIdin favour of bare string - Removed redundant conversion to
pd.Timestampwhen checking timestamps - Removed redundant data
to_serializable_strmethods - Removed redundant data
from_serializable_strmethods - Removed redundant
__ne__implementations - Removed redundant
MsgPackSerializercruft - Removed redundant
ObjectCacheandIdentifierCache - Removed redundant string constants
- Fixed millis to nanos in
CCXTExecutionClient - Added missing trigger to
UpdateOrderhandling - 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.dataintoTradingStrategy.cache - Consolidated
TradingStrategy.executionintoTradingStrategy.cache - Moved
redissubpackage 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
InMemoryExecutionDatabasetoBypassCacheDatabase - Renamed
Position.relative_qtytoPosition.net_qty - Renamed
default_currencytobase_currency - Removed
cost_currencyproperty fromInstrument
ExecutionClientnow has the option of calculating account state- Unified data and execution caches into single
Cache - Improved configuration options and naming
- Simplified
Portfoliocomponent registration - Simplified wiring of
Cacheinto components - Added
reprto execution messages - Added
AccountTypeenum - Added
cost_currencytoPosition - Added
get_cost_currency()toInstrument - Added
get_base_currency()toInstrument
- Fixed
Order.is_workingforPENDING_CANCELandPENDING_REPLACEstates - 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_venueaddedvenue_typeto method paramsExecutionClientaddedvenue_typeto constructor paramsTraderIdinstantiationStrategyIdinstantiationInstrumentserialization
Portfoliopending calculations if data not immediately available- Added
instrumentssubpackage with expanded class definitions - Added
timestamp_origin_nstimestamp when originally occurred - Added
AccountState.is_reportedflagging if reported by exchange or calculated - Simplified
TraderIdandStrategyIdidentifiers - Improved
ExecutionEngineorder routing - Improved
ExecutionEngineclient registration - Added order routing configuration
- Added
VenueTypeenum and parser - Improved param typing for identifier generators
- Improved log formatting of
MoneyandQuantitythousands commas
- CCXT
TICK_SIZEprecision mode - size precisions (BitMEX, FTX) - State reconciliation (various bugs)
This release focuses on simplifications and enhancements of existing machinery
Positionnow requires anInstrumentparamis_inverseremoved fromOrderFilledClientIdremoved fromTradingCommandand subclassesAccountIdremoved fromTradingCommandand subclassesTradingCommandserialization
- Added
Instrumentmethods toExecutionCache - Added
Venuefilter 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
PriceandQuantity - Renamed
BypassExecutionDatabasetoBypassCacheDatabase
- Rewired
RiskEngineandExecutionEnginesequence - Added
Instrumentdatabase 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.Decimalvalues 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'.
SimulatedExchangeno longer generatesOrderAcceptedforMarketOrder- Removed redundant
BacktestDataContainer - Removed redundant
OrderFilled.cum_qty - Removed redundant
OrderFilled.leaves_qty BacktestEngineconstructor simplifiedBacktestMarketDataClientno longer needs instruments- Rename
PortfolioAnalyzer.get_realized_pnlsto.realized_pnls
- Re-engineered
BacktestEngineto take data directly - Added
OrderState.PENDING_CANCEL - Added
OrderState.PENDING_REPLACE - Added
OrderPendingUpdateevent - Added
OrderPendingCancelevent - Added
OrderFilled.is_buyproperty (with correspondingis_buy_c()fast method) - Added
OrderFilled.is_sellproperty (with correspondingis_sell_c()fast method) - Added
Position.is_opposite_side(OrderSide side)convenience method - Modified the
OrderFSM and event handling for the above - Consolidated event generation into
ExecutionClientbase class - Refactored
SimulatedExchangefor greater clarity
ExecutionCachepositions 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.createnow takesInstrumentandBookLevel
SimulatedExchangenow maintains order books internallyLiveLoggernow exhibits better blocking behavior and logging
- Various patches to the
Betfairadapter - 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.createforBookLevel.L3now 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
ClientIdfor data and execution client identification - Standardize client IDs to upper case
- Rename
OrderBookOperationtoOrderBookDelta - Rename
OrderBookOperationstoOrderBookDeltas - Rename
OrderBookOperationTypetoOrderBookDeltaType
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
OrderIdtoVenueOrderId - Rename
Order.idtoOrder.venue_order_id - Rename
Order.cl_ord_idtoOrder.client_order_id - Rename
AssetClass.STOCKtoAssetClass.EQUITY - Remove redundant flag
generate_position_ids(handled byOmsType)
- Introduce integration for Betfair.
- Add
AssetClass.METALandAssetClass.ENERGY - Add
VenueStatusEvent,InstrumentStatusEventandInstrumentClosePrice - Usage of
np.ndarrayto 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
AmendOrdertoUpdateOrder - Rename
OrderAmendedtoOrderUpdated - Rename
amendandamendedrelated methods toupdateandupdated - Rename
OrderCancelRejecttoOrderCancelRejected(standardize tense)
- Improve efficiency of data wrangling
- Simplify
Loggerand general system logging - Add
stdoutandstderrlog streams with configuration - Add
OrderBookDatabase class
- Backtest handling of
GenericDataandOrderBookrelated data - Backtest
DataClientcreation logic prevented client registering
This release includes substantial breaking changes.
Further standardization of naming conventions along with internal refinements and fixes.
- Rename
AmendOrdertoUpdateOrder - Rename
OrderAmendedtoOrderUpdated - Rename
amendandamendedrelated methods toupdateandupdated - Rename
OrderCancelRejecttoOrderCancelRejected(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
VenueOrderIdequality when applying order events
- Removed
UNDEFINEDenum 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
BarTypeintoBaras a property - Change signature of
Barhandling methods due to above - Remove
Instrument.leverage(incorrect place for concept) - Change
ExecutionClient.venueas aVenuetoExecutionClient.nameas astr - Change serialization of timestamp datatype to
int64 - Extensive changes to serialization constant names
- Rename
OrderFilled.filled_qtytoOrderFilled.last_qty - Rename
OrderFilled.filled_pricetoOrderFilled.last_px - Rename
avg_pricetoavg_pxin methods and properties - Rename
avg_opentoavg_px_openin methods and properties - Rename
avg_closetoavg_px_closein methods and properties - Rename
Position.relative_quantitytoPosition.relative_qty - Rename
Position.peak_quantitytoPosition.peak_qty
- Standardize nanosecond timestamps
- Add time unit conversion functions as found in
nautilus_trader.core.datetime - Add optional
brokerproperty toVenueto assist with routing - Enhance state reconciliation from both
LiveExecutionEngineandLiveExecutionClient - Add internal messages to aid state reconciliation
DataCacheincorrectly caching bars
This release adds further enhancements to the platform.
None
RiskEnginebuilt out including configuration options hook andLiveRiskEngineimplementation- Add generic
Throttler - Add details
dicttoinstrument_idrelated requests to cover IB futures contracts - Add missing Fiat currencies
- Add additional Crypto currencies
- Add ISO 4217 codes
- Add currency names
- Queue
putcoroutines in live engines when blocking atmaxlenwas 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.
Securityrenamed toInstrumentIdInstrument.securityrenamed toInstrument.idDatabecomes an abstract base class withtimestampandunix_timestamppropertiesDataandDataTypemoved tomodel.dataon_datamethods now takeGenericData
- Add
GenericData - Add
Futureinstrument
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.
InstrumentIdnow takes first class value objectSymbolInstrumentIdasset_classandasset_typeno longer optionalSimulatedExchange.venuechanged toSimulatedExchange.id
- Ensure
TestTimeradvances monotonically increase - Add
AssetClass.BETTING
- CCXT data and execution clients regarding
instrument_idvssymbolnaming InstrumentIdequality 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
SecurityreplacesSymbolwith expanded propertiesAssetClass.EQUITYchanged toAssetClass.STOCKfrom_serializable_stringchanged tofrom_serializable_strto_serializable_stringchanged toto_serializable_str
- Reports now include full instrument_id name
- Add
AssetType.WARRANT
StopLimitOrderserialization
This is a patch release which applies various fixes and refactorings.
The behavior of the StopLimitOrder continued to be fixed and refined.
SimulatedExchange was refactored further to reduce complexity.
None
None
TRIGGEREDstates in order FSMStopLimitOrdertriggering behaviorOrderFactory.stop_limitmissingpost_onlyandhiddenOrderandStopLimitOrder__repr__string (duplicate id)
The main thrust of this release is to refine some subtleties relating to order
matching and amendment behavior 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 behavior regarding
when a marketable limit order will become a liquidity TAKER during order placement
and amendment.
Test coverage was moderately increased.
None
- Refactored
SimulatedExchangeorder matching and amendment logic - Add
risksubpackage to group risk components
StopLimitOrdertriggering behavior- 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_stringmethods changed tofrom_serializable_str
- Scaffold Interactive Brokers integration in
adapters/ib - Add the
Futureinstrument type - Add the
StopLimitOrderorder type - Add the
DataandDataTypetypes to support custom data handling - Add the
InstrumentIdidentifier types initial implementation to support extending the platforms capabilities
BracketOrdercorrectness- CCXT precision parsing bug
- Some log formatting