Only fetch accounts when authenticated.

This commit is contained in:
Matthias
2022-05-07 13:13:26 +02:00
parent 149704e748
commit dc0c1bf87d
3 changed files with 3 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ class Okx(Exchange):
Must be overridden in child methods if required.
"""
try:
if self.trading_mode == TradingMode.FUTURES:
if self.trading_mode == TradingMode.FUTURES and not self._config['dry_run']:
accounts = self._api.fetch_accounts()
if len(accounts) > 0:
self.net_only = accounts[0].get('info', {}).get('posMode') == 'net_mode'