Skip to content

Commit

Permalink
1.114.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
cjdsellers authored Apr 5, 2021
2 parents ba99d7d + b8a35d3 commit 5420954
Show file tree
Hide file tree
Showing 112 changed files with 1,931 additions and 1,757 deletions.
25 changes: 25 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# NautilusTrader 1.114.0 Beta - Release Notes

**This release includes substantial breaking changes.**

Further standardization of naming conventions along with internal refinements
and fixes.

## Breaking Changes
- Rename `AmendOrder` to `UpdateOrder`.
- Rename `OrderAmended` to `OrderUpdated`.
- Rename `amend` and `amended` related methods to `update` and `updated`.
- Rename `OrderCancelReject` to `OrderCancelRejected` (standardize tense).

## Enhancements
- Improve efficiency of data wrangling.
- Simplify `Logger` and general system logging.
- Add `stdout` and `stderr` log streams with configuration.
- Add `OrderBookData` base class.

## Fixes
- Backtest handling of `GenericData` and `OrderBook` related data.
- Backtest `DataClient` creation logic prevented client registering.

---

# NautilusTrader 1.113.0 Beta - Release Notes

**This release includes substantial breaking changes.**
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-binance_ema_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-binance_market_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-bitmex_ema_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-bitmex_ema_cross_stop_entry_with_trail.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-bitmex_market_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/ccxt-bitmex_testnet_market_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
8 changes: 2 additions & 6 deletions examples/live/oanda_ema_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@
"id_tag": "001", # Used to ensure orders are unique for this trader
},
"system": {
"loop_debug": False, # The event loop debug mode
"connection_timeout": 5.0, # Timeout for successful connections for all engine clients
"disconnection_timeout": 5.0, # Timeout for successful disconnection for all engine clients
"check_residuals_delay": 5.0, # How long to wait after stopping for residual events (secs)
},
"logging": {
"log_level_console": "INF",
"log_level_file": "DBG",
"log_level_store": "WRN",
"log_thread_id": False,
"log_to_file": False,
"log_file_dir": "logs/",
"level_stdout": "INF",
},
"exec_database": {
"type": "redis",
Expand Down
Binary file removed nautilus_trader/.DS_Store
Binary file not shown.
16 changes: 8 additions & 8 deletions nautilus_trader/adapters/ccxt/execution.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ cdef class CCXTExecutionClient(LiveExecutionClient):
for order in orders_all:
if order.is_completed_c():
continue
if order.venue.first() == self.name:
if order.instrument_id.venue.first() == self.name:
self._cached_orders[order.id] = order
self._cached_filled[order.id] = order.filled_qty.as_decimal()

if self._client.check_required_credentials():
self._log.info("API credentials validated.", LogColor.GREEN)
self._log.info("API credentials validated.", color=LogColor.GREEN)
else:
self._log.error("API credentials missing or invalid.")
self._log.error(f"Required: {self._client.required_credentials()}.")
Expand Down Expand Up @@ -209,7 +209,7 @@ cdef class CCXTExecutionClient(LiveExecutionClient):
try:
response = await self._client.fetch_order(
id=order.id.value,
symbol=order.symbol.value,
symbol=order.instrument_id.symbol.value,
)
# self._log.info(str(response), LogColor.BLUE) # TODO: Development
except CCXTError as ex:
Expand Down Expand Up @@ -285,7 +285,7 @@ cdef class CCXTExecutionClient(LiveExecutionClient):
return reports # TODO: Is this necessary??

cdef list fills = [fill for fill in response if fill["order"] == order_id.value]
self._log.info(str(fills), LogColor.GREEN) # TODO: Development
self._log.info(str(fills), color=LogColor.GREEN) # TODO: Development

if not fills:
return reports
Expand Down Expand Up @@ -510,7 +510,7 @@ cdef class CCXTExecutionClient(LiveExecutionClient):
try:
# Submit order and await response
await self._client.create_order(
symbol=order.symbol.value,
symbol=order.instrument_id.symbol.value,
type=OrderTypeParser.to_str(order.type).lower(),
side=OrderSideParser.to_str(order.side).lower(),
amount=str(order.quantity),
Expand All @@ -537,7 +537,7 @@ cdef class CCXTExecutionClient(LiveExecutionClient):
try:
await self._client.cancel_order(
id=order.id.value,
symbol=order.symbol.value,
symbol=order.instrument_id.symbol.value,
)
except CCXTError as ex:
self._log_ccxt_error(ex, self._cancel_order.__name__)
Expand Down Expand Up @@ -765,7 +765,7 @@ cdef class BinanceCCXTExecutionClient(CCXTExecutionClient):
try:
# Submit order and await response
await self._client.create_order(
symbol=order.symbol.value,
symbol=order.instrument_id.symbol.value,
type=order_type,
side=OrderSideParser.to_str(order.side),
amount=str(order.quantity),
Expand Down Expand Up @@ -870,7 +870,7 @@ cdef class BitmexCCXTExecutionClient(CCXTExecutionClient):
try:
# Submit order and await response
await self._client.create_order(
symbol=order.symbol.value,
symbol=order.instrument_id.symbol.value,
type=order_type,
side=OrderSideParser.to_str(order.side).capitalize(),
amount=str(order.quantity),
Expand Down
20 changes: 10 additions & 10 deletions nautilus_trader/adapters/ccxt/factories.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ cdef class CCXTDataClientFactory(LiveDataClientFactory):

# Check required CCXT methods are available
if not client.has.get("fetchTrades", False):
raise RuntimeError(f"CCXT `fetch_trades` not available for {client.name}.")
raise RuntimeError(f"CCXT `fetch_trades` not available for {client.name}")
if not client.has.get("fetchOHLCV", False):
raise RuntimeError(f"CCXT `fetch_ohlcv` not available for {client.name}.")
raise RuntimeError(f"CCXT `fetch_ohlcv` not available for {client.name}")
if not client.has.get("watchOrderBook", False):
raise RuntimeError(f"CCXT `watch_order_book` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_order_book` not available for {client.name}")
if not client.has.get("watchTrades", False):
raise RuntimeError(f"CCXT `watch_trades` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_trades` not available for {client.name}")
if not client.has.get("watchOHLCV", False):
raise RuntimeError(f"CCXT `watch_ohlcv` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_ohlcv` not available for {client.name}")

# Create client
return CCXTDataClient(
Expand Down Expand Up @@ -184,15 +184,15 @@ cdef class CCXTExecutionClientFactory(LiveExecutionClientFactory):

# Check required CCXT methods are available
if not client.has.get("fetchTrades", False):
raise RuntimeError(f"CCXT `fetch_trades` not available for {client.name}.")
raise RuntimeError(f"CCXT `fetch_trades` not available for {client.name}")
if not client.has.get("fetchOHLCV", False):
raise RuntimeError(f"CCXT `fetch_ohlcv` not available for {client.name}.")
raise RuntimeError(f"CCXT `fetch_ohlcv` not available for {client.name}")
if not client.has.get("watchOrderBook", False):
raise RuntimeError(f"CCXT `watch_order_book` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_order_book` not available for {client.name}")
if not client.has.get("watchTrades", False):
raise RuntimeError(f"CCXT `watch_trades` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_trades` not available for {client.name}")
if not client.has.get("watchOHLCV", False):
raise RuntimeError(f"CCXT `watch_ohlcv` not available for {client.name}.")
raise RuntimeError(f"CCXT `watch_ohlcv` not available for {client.name}")

# Get account identifier env variable or set default
account_id_env_var = os.getenv(config.get("account_id", ""), "001")
Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/adapters/oanda/data.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ cdef class OandaDataClient(LiveMarketDataClient):
cdef dict res
try:
req = InstrumentsCandles(
instrument=instrument.symbol.value.replace('/', '_'),
instrument=instrument.id.symbol.value.replace('/', '_'),
params=params,
)
res = self._client.request(req)
Expand Down
5 changes: 3 additions & 2 deletions nautilus_trader/backtest/data_container.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@


cdef class BacktestDataContainer:
cdef set _added_instrument_ids
cdef readonly dict clients
cdef readonly list generic_data
cdef readonly list order_book_snapshots
cdef readonly list order_book_operations
cdef readonly list books
cdef readonly list order_book_data
cdef readonly dict instruments
cdef readonly dict quote_ticks
cdef readonly dict trade_ticks
Expand Down
Loading

0 comments on commit 5420954

Please sign in to comment.