From 4480b3b39374439296407128b816a797749865c9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 9 Sep 2020 15:39:35 +0200 Subject: [PATCH] Fix error in documentation (wrong sequence of steps) --- docs/strategy-customization.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index a1de1044c..615be0247 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -580,10 +580,6 @@ All columns of the informative dataframe will be available on the returning data A custom implementation for this is possible, and can be done as follows: ``` python - # Rename columns to be unique - informative.columns = [f"{col}_{inf_tf}" for col in informative.columns] - # Assuming inf_tf = '1d' - then the columns will now be: - # date_1d, open_1d, high_1d, low_1d, close_1d, rsi_1d # Shift date by 1 candle # This is necessary since the data is always the "open date" @@ -592,6 +588,11 @@ All columns of the informative dataframe will be available on the returning data # Only do this if the timeframes are different: informative['date_merge'] = informative["date"] + pd.to_timedelta(minutes, 'm') + # Rename columns to be unique + informative.columns = [f"{col}_{inf_tf}" for col in informative.columns] + # Assuming inf_tf = '1d' - then the columns will now be: + # date_1d, open_1d, high_1d, low_1d, close_1d, rsi_1d + # Combine the 2 dataframes # all indicators on the informative sample MUST be calculated before this point dataframe = pd.merge(dataframe, informative, left_on='date', right_on=f'date_merge_{inf_tf}', how='left')