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