From 8a1d02e185119ff11fd5b5031ced8f331acab9b6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 2 Nov 2019 15:34:09 +0100 Subject: [PATCH] Update numpy imports in sample strategies --- freqtrade/templates/base_strategy.py.j2 | 6 +++--- freqtrade/templates/sample_strategy.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/freqtrade/templates/base_strategy.py.j2 b/freqtrade/templates/base_strategy.py.j2 index 3fbd26997..312aa0f27 100644 --- a/freqtrade/templates/base_strategy.py.j2 +++ b/freqtrade/templates/base_strategy.py.j2 @@ -2,15 +2,15 @@ # --- Do not remove these libs --- from freqtrade.strategy.interface import IStrategy from pandas import DataFrame +import pandas as pd # -------------------------------- # Add your lib to import here import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib -import numpy # noqa +import numpy as np # noqa -# This class is a sample. Feel free to customize it. class {{ strategy }}(IStrategy): """ This is a strategy template to get you started.. @@ -140,7 +140,7 @@ class {{ strategy }}(IStrategy): # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy) rsi = 0.1 * (dataframe['rsi'] - 50) - dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1) + dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1) # Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy) dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1) diff --git a/freqtrade/templates/sample_strategy.py b/freqtrade/templates/sample_strategy.py index 77a2d261a..d62e6120c 100644 --- a/freqtrade/templates/sample_strategy.py +++ b/freqtrade/templates/sample_strategy.py @@ -7,7 +7,8 @@ from pandas import DataFrame # Add your lib to import here import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib -import numpy # noqa +import pandas as pd # noqa +import numpy as np # noqa # This class is a sample. Feel free to customize it. @@ -147,7 +148,7 @@ class SampleStrategy(IStrategy): # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy) rsi = 0.1 * (dataframe['rsi'] - 50) - dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1) + dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1) # Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy) dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)