From 2dd3b341360dc3f85068bf1408c6d2414cd08ace Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 23 Apr 2023 19:36:27 +0200 Subject: [PATCH] Fix malrendering in freqAI docs --- docs/freqai-feature-engineering.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/freqai-feature-engineering.md b/docs/freqai-feature-engineering.md index 52d5e1b2c..82b7569a5 100644 --- a/docs/freqai-feature-engineering.md +++ b/docs/freqai-feature-engineering.md @@ -181,15 +181,14 @@ You can ask for each of the defined features to be included also for informative In total, the number of features the user of the presented example strat has created is: length of `include_timeframes` * no. features in `feature_engineering_expand_*()` * length of `include_corr_pairlist` * no. `include_shifted_candles` * length of `indicator_periods_candles` $= 3 * 3 * 3 * 2 * 2 = 108$. - ### Gain finer control over `feature_engineering_*` functions with `metadata` - All `feature_engineering_*` and `set_freqai_targets()` functions are passed a `metadata` dictionary which contains information about the `pair`, `tf` (timeframe), and `period` that FreqAI is automating for feature building. As such, a user can use `metadata` inside `feature_engineering_*` functions as criteria for blocking/reserving features for certain timeframes, periods, pairs etc. +All `feature_engineering_*` and `set_freqai_targets()` functions are passed a `metadata` dictionary which contains information about the `pair`, `tf` (timeframe), and `period` that FreqAI is automating for feature building. As such, a user can use `metadata` inside `feature_engineering_*` functions as criteria for blocking/reserving features for certain timeframes, periods, pairs etc. - ```python -def feature_engineering_expand_all(self, dataframe, period, metadata, **kwargs): - if metadata["tf"] == "1h": - dataframe["%-roc-period"] = ta.ROC(dataframe, timeperiod=period) +```python +def feature_engineering_expand_all(self, dataframe: DataFrame, period, metadata, **kwargs) -> DataFrame: + if metadata["tf"] == "1h": + dataframe["%-roc-period"] = ta.ROC(dataframe, timeperiod=period) ``` This will block `ta.ROC()` from being added to any timeframes other than `"1h"`.