From 15ce56fff1a2b8cececd446311e48f1ef72121e6 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Mon, 23 Apr 2018 22:23:12 -0700 Subject: [PATCH] Long strategy generates about 1.81% a trade, at an average time of 277 min and a total returns of 0.018BTC over 20 days. Sell points are decent, could execute more buys technically --- user_data/strategies/Long.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/user_data/strategies/Long.py b/user_data/strategies/Long.py index 0b64ca1e3..07c85ecd1 100644 --- a/user_data/strategies/Long.py +++ b/user_data/strategies/Long.py @@ -9,6 +9,7 @@ from pandas import DataFrame import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib +import numpy # noqa class Long(IStrategy): @@ -47,6 +48,17 @@ class Long(IStrategy): dataframe['bb_lowerband'] = bollinger['lower'] dataframe['bb_middleband'] = bollinger['mid'] dataframe['bb_upperband'] = bollinger['upper'] + + # RSI + dataframe['rsi'] = ta.RSI(dataframe) + + # 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) + + # SAR Parabol + dataframe['sar'] = ta.SAR(dataframe) + return dataframe def populate_buy_trend(self, dataframe: DataFrame) -> DataFrame: @@ -73,7 +85,10 @@ class Long(IStrategy): """ dataframe.loc[ ( - (dataframe['tema'] < dataframe['close']) +# (dataframe['tema'] < dataframe['close']) + + (dataframe['sar'] > dataframe['close']) & + (dataframe['fisher_rsi'] > 0.3) ), 'sell'] = 1 return dataframe