debug logging of metadata added; description of metadata['timeframe']

added to docs
This commit is contained in:
hroff-1902 2019-06-08 08:04:52 +03:00
parent d0a1fc551d
commit af127d00ff
2 changed files with 14 additions and 4 deletions

View File

@ -230,12 +230,16 @@ Common values are `"1m"`, `"5m"`, `"15m"`, `"1h"`, however all values supported
Please note that the same buy/sell signals may work with one interval, but not the other. Please note that the same buy/sell signals may work with one interval, but not the other.
This setting is accessible within the strategy by using `self.ticker_interval`. This setting is accessible within the strategy by using `self.ticker_interval`.
### Metadata dict ### Metadata dictionary
The metadata-dict (available for `populate_buy_trend`, `populate_sell_trend`, `populate_indicators`) contains additional information. The metadata dictionary (available for `populate_buy_trend`, `populate_sell_trend`, `populate_indicators`) contains additional information.
Currently this is `pair`, which can be accessed using `metadata['pair']` - and will return a pair in the format `XRP/BTC`.
The Metadata-dict should not be modified and does not persist information across multiple calls. Currently this is:
- Currency pair in the format `XRP/BTC`, which can be accessed using `metadata['pair']`.
- Timeframe used by the bot in its string form (`5m`, `1h`), which can be accessed as `metadata['timeframe']`.
The metadata dictionary should not be modified and does not persist information across multiple calls.
Instead, have a look at the section [Storing information](#Storing-information) Instead, have a look at the section [Storing information](#Storing-information)
### Storing information ### Storing information

View File

@ -379,6 +379,8 @@ class IStrategy(ABC):
:param metadata: Additional information, like the currently traded pair :param metadata: Additional information, like the currently traded pair
:return: a Dataframe with all mandatory indicators for the strategies :return: a Dataframe with all mandatory indicators for the strategies
""" """
logger.debug(f"Populating indicators: "
f"pair {metadata.get('pair')}, timeframe {metadata.get('timeframe')}")
if self._populate_fun_len == 2: if self._populate_fun_len == 2:
warnings.warn("deprecated - check out the Sample strategy to see " warnings.warn("deprecated - check out the Sample strategy to see "
"the current function headers!", DeprecationWarning) "the current function headers!", DeprecationWarning)
@ -394,6 +396,8 @@ class IStrategy(ABC):
:param pair: Additional information, like the currently traded pair :param pair: Additional information, like the currently traded pair
:return: DataFrame with buy column :return: DataFrame with buy column
""" """
logger.debug(f"Populating buy signals: "
f"pair {metadata.get('pair')}, timeframe {metadata.get('timeframe')}")
if self._buy_fun_len == 2: if self._buy_fun_len == 2:
warnings.warn("deprecated - check out the Sample strategy to see " warnings.warn("deprecated - check out the Sample strategy to see "
"the current function headers!", DeprecationWarning) "the current function headers!", DeprecationWarning)
@ -409,6 +413,8 @@ class IStrategy(ABC):
:param pair: Additional information, like the currently traded pair :param pair: Additional information, like the currently traded pair
:return: DataFrame with sell column :return: DataFrame with sell column
""" """
logger.debug(f"Populating sell signals: "
f"pair {metadata.get('pair')}, timeframe {metadata.get('timeframe')}")
if self._sell_fun_len == 2: if self._sell_fun_len == 2:
warnings.warn("deprecated - check out the Sample strategy to see " warnings.warn("deprecated - check out the Sample strategy to see "
"the current function headers!", DeprecationWarning) "the current function headers!", DeprecationWarning)