From 0410654c2cac12b4b2e8c13b432dfb1bf29cdde0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 9 May 2019 06:51:30 +0200 Subject: [PATCH 1/2] Add printing dataframe to documentation --- docs/bot-optimization.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/bot-optimization.md b/docs/bot-optimization.md index 9e754c213..c83e4d0b1 100644 --- a/docs/bot-optimization.md +++ b/docs/bot-optimization.md @@ -345,6 +345,30 @@ if self.wallets: - `get_used(asset)` - currently tied up balance (open orders) - `get_total(asset)` - total available balance - sum of the 2 above +### Print created dataframe + +To inspect the created dataframe, you can issue a print-statement in either `populate_buy_trend()` or `populate_sell_trend()`. +You may also want to print the pair so it's clear what data is currently shown. + +``` python +def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: + dataframe.loc[ + ( + #>> whatever condition<<< + ), + 'buy'] = 1 + + # Print the Analyzed pair + print(f"result for {metadata['pair']}") + + # Inspect the last 5 rows + print(dataframe.tail()) + + return dataframe +``` + +Printing more than a few rows is possible (don't use `.tail()`), however not recommended, as that will be very verbose (~500 lines per pair every 5 seconds). + ### Where is the default strategy? The default buy strategy is located in the file From 909df0d7bbe2094a53c0799c4f17d42b11a2debb Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 9 May 2019 08:56:27 +0200 Subject: [PATCH 2/2] Improve doc wording --- docs/bot-optimization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/bot-optimization.md b/docs/bot-optimization.md index c83e4d0b1..5e080eab1 100644 --- a/docs/bot-optimization.md +++ b/docs/bot-optimization.md @@ -367,7 +367,7 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: return dataframe ``` -Printing more than a few rows is possible (don't use `.tail()`), however not recommended, as that will be very verbose (~500 lines per pair every 5 seconds). +Printing more than a few rows is also possible (simply use `print(dataframe)` instead of `print(dataframe.tail())`), however not recommended, as that will be very verbose (~500 lines per pair every 5 seconds). ### Where is the default strategy?