example how to use best bid and ask in strategy

This commit is contained in:
Yuliyan Perfanov 2019-06-02 13:27:44 +03:00
parent 199426460a
commit c68fe7a685

View File

@ -253,6 +253,15 @@ class TestStrategy(IStrategy):
dataframe['ha_low'] = heikinashi['low'] dataframe['ha_low'] = heikinashi['low']
""" """
# Retrieve best bid and best ask
# ------------------------------------
"""
ob = self.dp.orderbook(metadata['pair'], 1)
print(ob)
dataframe['best_bid'] = ob['bids'][0][0]
dataframe['best_ask'] = ob['asks'][0][0]
"""
return dataframe return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: