normalization removed
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
# "min_days_listed": 100
|
||||
# },
|
||||
# IMPORTANT: INSTALL TA BEFOUR RUN(pip install ta)
|
||||
#
|
||||
#
|
||||
# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces roi buy sell --strategy Heracles
|
||||
# ######################################################################
|
||||
# --- Do not remove these libs ---
|
||||
@@ -26,44 +26,36 @@ from functools import reduce
|
||||
import numpy as np
|
||||
|
||||
|
||||
def normalize(df):
|
||||
# To enable normalization outcomment below line:
|
||||
df = (df-df.min())/(df.max()-df.min())
|
||||
return df
|
||||
|
||||
class Heracles(IStrategy):
|
||||
########################################## RESULT PASTE PLACE ##########################################
|
||||
# 35/50: 129 trades. 96/15/18 Wins/Draws/Losses. Avg profit 3.57%. Median profit 4.30%. Total profit 2302.93351920 USDT ( 46.06Σ%). Avg duration 2 days, 19:04:00 min. Objective: -21.29091
|
||||
|
||||
# 18/100: 111 trades. 77/23/11 Wins/Draws/Losses. Avg profit 3.81%. Median profit 4.40%. Total profit 2114.06222218 USDT ( 42.28Σ%). Avg duration 3 days, 3:04:00 min. Objective: -16.78579
|
||||
|
||||
# Buy hyperspace params:
|
||||
buy_params = {
|
||||
"buy_crossed_indicator_shift": -5,
|
||||
"buy_div": 4.7968,
|
||||
"buy_indicator_shift": 5,
|
||||
"buy_crossed_indicator_shift": 5,
|
||||
"buy_div": 3.61,
|
||||
"buy_indicator_shift": 1,
|
||||
}
|
||||
|
||||
# Sell hyperspace params:
|
||||
sell_params = {
|
||||
"sell_atol": 0.21256,
|
||||
"sell_crossed_indicator_shift": 0,
|
||||
"sell_indicator_shift": -1,
|
||||
"sell_rtol": 0.11195,
|
||||
"sell_atol": 0.30989,
|
||||
"sell_crossed_indicator_shift": 2,
|
||||
"sell_indicator_shift": 5,
|
||||
"sell_rtol": 0.19449,
|
||||
}
|
||||
|
||||
# ROI table:
|
||||
minimal_roi = {
|
||||
"0": 0.43,
|
||||
"994": 0.076,
|
||||
"2864": 0.043,
|
||||
"6947": 0
|
||||
"0": 0.725,
|
||||
"889": 0.171,
|
||||
"2776": 0.044,
|
||||
"5299": 0
|
||||
}
|
||||
|
||||
# Stoploss:
|
||||
stoploss = -0.312
|
||||
|
||||
########################################## END RESULT PASTE PLACE ######################################
|
||||
|
||||
########################################## END RESULT PASTE PLACE ######################################
|
||||
|
||||
# buy params
|
||||
buy_div = DecimalParameter(-5, 5, default=0.51844, decimals=4, space='buy')
|
||||
@@ -71,51 +63,47 @@ class Heracles(IStrategy):
|
||||
buy_crossed_indicator_shift = IntParameter(-5, 5, default=1, space='buy')
|
||||
|
||||
# sell params
|
||||
sell_rtol = DecimalParameter(1.e-10, 1.e-0, default=0.05468, decimals=4, space='sell')
|
||||
sell_atol = DecimalParameter(1.e-16, 1.e-0, default=0.00019, decimals=4, space='sell')
|
||||
sell_rtol = DecimalParameter(1.e-10, 1.e-0, default=0.05468, decimals=10, space='sell')
|
||||
sell_atol = DecimalParameter(1.e-16, 1.e-0, default=0.00019, decimals=10, space='sell')
|
||||
sell_indicator_shift = IntParameter(-5, 5, default=4, space='sell')
|
||||
sell_crossed_indicator_shift = IntParameter(-5, 5, default=1, space='sell')
|
||||
|
||||
|
||||
# Optimal timeframe use it in your config
|
||||
timeframe = '4h'
|
||||
|
||||
|
||||
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
dataframe = dropna(dataframe)
|
||||
|
||||
dataframe['volatility_kcw'] = normalize(ta.volatility.keltner_channel_wband(
|
||||
dataframe['high'],
|
||||
dataframe['low'],
|
||||
dataframe['close'],
|
||||
window=20,
|
||||
window_atr=10,
|
||||
fillna=False,
|
||||
original_version=True
|
||||
))
|
||||
|
||||
dataframe['volatility_dcp'] =normalize(ta.volatility.donchian_channel_pband(
|
||||
dataframe['high'],
|
||||
dataframe['low'],
|
||||
dataframe['close'],
|
||||
window=10,
|
||||
offset=0,
|
||||
fillna=False
|
||||
))
|
||||
|
||||
dataframe['trend_macd_signal'] =normalize(ta.trend.macd_signal(
|
||||
dataframe['close'],
|
||||
window_slow=26,
|
||||
window_fast=12,
|
||||
window_sign=9,
|
||||
fillna=False
|
||||
))
|
||||
|
||||
dataframe['volatility_kcw'] = ta.volatility.keltner_channel_wband(
|
||||
dataframe['high'],
|
||||
dataframe['low'],
|
||||
dataframe['close'],
|
||||
window=20,
|
||||
window_atr=10,
|
||||
fillna=False,
|
||||
original_version=True
|
||||
)
|
||||
|
||||
dataframe['trend_ema_fast'] =normalize(ta.trend.EMAIndicator(
|
||||
close=dataframe['close'], window=12, fillna=False
|
||||
).ema_indicator())
|
||||
|
||||
dataframe['volatility_dcp'] = ta.volatility.donchian_channel_pband(
|
||||
dataframe['high'],
|
||||
dataframe['low'],
|
||||
dataframe['close'],
|
||||
window=10,
|
||||
offset=0,
|
||||
fillna=False
|
||||
)
|
||||
|
||||
dataframe['trend_macd_signal'] = ta.trend.macd_signal(
|
||||
dataframe['close'],
|
||||
window_slow=26,
|
||||
window_fast=12,
|
||||
window_sign=9,
|
||||
fillna=False
|
||||
)
|
||||
|
||||
dataframe['trend_ema_fast'] = ta.trend.EMAIndicator(
|
||||
close=dataframe['close'], window=12, fillna=False
|
||||
).ema_indicator()
|
||||
|
||||
# for checking crossovers!
|
||||
# but we dont need to crossovers we just calculate dividation
|
||||
|
||||
Reference in New Issue
Block a user