From 0dd2472385766f76d392fe136365812ecf2ea99e Mon Sep 17 00:00:00 2001 From: robcaulk Date: Sat, 4 Feb 2023 16:56:36 +0100 Subject: [PATCH] add metadata param to docstrings --- docs/freqai-feature-engineering.md | 4 ++++ freqtrade/strategy/interface.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/freqai-feature-engineering.md b/docs/freqai-feature-engineering.md index 7cd5c88e6..9f2696628 100644 --- a/docs/freqai-feature-engineering.md +++ b/docs/freqai-feature-engineering.md @@ -34,6 +34,7 @@ It is advisable to start from the template `feature_engineering_*` functions in :param df: strategy dataframe which will receive the features :param period: period of the indicator - usage example: + :param metadata: metadata of current pair dataframe["%-ema-period"] = ta.EMA(dataframe, timeperiod=period) """ @@ -86,6 +87,7 @@ It is advisable to start from the template `feature_engineering_*` functions in All features must be prepended with `%` to be recognized by FreqAI internals. :param df: strategy dataframe which will receive the features + :param metadata: metadata of current pair dataframe["%-pct-change"] = dataframe["close"].pct_change() dataframe["%-ema-200"] = ta.EMA(dataframe, timeperiod=200) """ @@ -113,6 +115,7 @@ It is advisable to start from the template `feature_engineering_*` functions in All features must be prepended with `%` to be recognized by FreqAI internals. :param df: strategy dataframe which will receive the features + :param metadata: metadata of current pair usage example: dataframe["%-day_of_week"] = (dataframe["date"].dt.dayofweek + 1) / 7 """ dataframe["%-day_of_week"] = (dataframe["date"].dt.dayofweek + 1) / 7 @@ -130,6 +133,7 @@ It is advisable to start from the template `feature_engineering_*` functions in `metadata["pair"]` :param df: strategy dataframe which will receive the targets + :param metadata: metadata of current pair usage example: dataframe["&-target"] = dataframe["close"].shift(-1) / dataframe["close"] """ dataframe["&-s_close"] = ( diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index fce4e629e..8ec46c91b 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -636,6 +636,7 @@ class IStrategy(ABC, HyperStrategyMixin): :param df: strategy dataframe which will receive the features :param period: period of the indicator - usage example: + :param metadata: metadata of current pair dataframe["%-ema-period"] = ta.EMA(dataframe, timeperiod=period) """ return dataframe @@ -663,6 +664,7 @@ class IStrategy(ABC, HyperStrategyMixin): https://www.freqtrade.io/en/latest/freqai-feature-engineering/#defining-the-features :param df: strategy dataframe which will receive the features + :param metadata: metadata of current pair dataframe["%-pct-change"] = dataframe["close"].pct_change() dataframe["%-ema-200"] = ta.EMA(dataframe, timeperiod=200) """ @@ -687,6 +689,7 @@ class IStrategy(ABC, HyperStrategyMixin): https://www.freqtrade.io/en/latest/freqai-feature-engineering :param df: strategy dataframe which will receive the features + :param metadata: metadata of current pair usage example: dataframe["%-day_of_week"] = (dataframe["date"].dt.dayofweek + 1) / 7 """ return dataframe @@ -702,6 +705,7 @@ class IStrategy(ABC, HyperStrategyMixin): https://www.freqtrade.io/en/latest/freqai-feature-engineering :param df: strategy dataframe which will receive the targets + :param metadata: metadata of current pair usage example: dataframe["&-target"] = dataframe["close"].shift(-1) / dataframe["close"] """ return dataframe