check for runmode before retrieving the orderbook
This commit is contained in:
parent
a9ed5da369
commit
f9fe266364
@ -258,6 +258,7 @@ class TestStrategy(IStrategy):
|
|||||||
"""
|
"""
|
||||||
# first check if dataprovider is available
|
# first check if dataprovider is available
|
||||||
if self.dp:
|
if self.dp:
|
||||||
|
if self.dp.runmode in ('live', 'dry_run'):
|
||||||
ob = self.dp.orderbook(metadata['pair'], 1)
|
ob = self.dp.orderbook(metadata['pair'], 1)
|
||||||
dataframe['best_bid'] = ob['bids'][0][0]
|
dataframe['best_bid'] = ob['bids'][0][0]
|
||||||
dataframe['best_ask'] = ob['asks'][0][0]
|
dataframe['best_ask'] = ob['asks'][0][0]
|
||||||
|
Loading…
Reference in New Issue
Block a user