From a9ed5da369d606da23223b16bf7fcc834bb13949 Mon Sep 17 00:00:00 2001 From: Yuliyan Perfanov Date: Thu, 6 Jun 2019 18:48:26 +0300 Subject: [PATCH] added doc for DataProvider.orderbook() --- docs/strategy-customization.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index 51540f690..b44775dfb 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -298,6 +298,18 @@ if self.dp: !!! Warning Warning in hyperopt This option cannot currently be used during hyperopt. +#### Orderbook + +``` python +if self.dp: + if self.dp.runmode in ('live', 'dry_run'): + ob = self.dp.orderbook(metadata['pair'], 1) + dataframe['best_bid'] = ob['bids'][0][0] + dataframe['best_ask'] = ob['asks'][0][0] +``` +!Warning The order book is not part of the historic data which means backtesting and hyperopt will not work if this + method is used. + #### Available Pairs ``` python @@ -306,6 +318,7 @@ if self.dp: print(f"available {pair}, {ticker}") ``` + #### Get data for non-tradeable pairs Data for additional, informative pairs (reference pairs) can be beneficial for some strategies.