Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def exchange():
return exchanges.get('fbm')
def test_injects_string_initialized_action_scheme():
with TradingContext(**config):
exchange = get('simulated')
assert hasattr(exchange.context, 'credentials')
assert exchange.context.credentials == config['exchanges']['credentials']
assert exchange.context['credentials'] == config['exchanges']['credentials']
def test_simulated_exchange():
assert isinstance(exchanges.get('simulated'), SimulatedExchange)
def test_stochastic_exchange():
assert isinstance(exchanges.get('stochastic'), StochasticExchange)
def test_injects_string_initialized_action_scheme():
with TradingContext(**config):
exchange = get('simulated')
assert hasattr(exchange.context, 'credentials')
assert exchange.context.credentials == config['exchanges']['credentials']
assert exchange.context['credentials'] == config['exchanges']['credentials']
def exchange():
return exchanges.get('fbm')
def test_ccxt_exchanges():
for exchange_id in ['coinbasepro', 'coinbase', 'binance', 'bitstamp']:
assert isinstance(exchanges.get(exchange_id), CCXTExchange)
def exchange(self, exchange: Union[Exchange, str]):
self._exchange = exchanges.get(exchange) if isinstance(exchange, str) else exchange
self._broker = Broker(self._exchange)