Remove whitespaces

This commit is contained in:
Matthias
2021-05-15 08:36:42 +02:00
parent 0963462f97
commit eccd22be14
+39 -39
View File
@@ -35,47 +35,47 @@ class HOSwingHighToSky(IHyperOpt):
@staticmethod
def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame:
for cciTime in cciTimeRange:
cciName = "cci-" + str(cciTime)
cciName = "cci-" + str(cciTime)
dataframe[cciName] = ta.CCI(dataframe, timeperiod = cciTime)
for rsiTime in rsiTimeRange:
rsiName = "rsi-" + str(rsiTime)
dataframe[rsiName] = ta.RSI(dataframe, timeperiod = rsiTime)
return dataframe
@staticmethod
def buy_strategy_generator(params: Dict[str, Any]) -> Callable:
def populate_buy_trend(dataframe: DataFrame, metadata: dict) -> DataFrame:
conditions = []
# TRIGGERS & GUARDS
if 'cci-buy-trigger' in params:
for cciTime in cciTimeRange:
cciName = "cci-" + str(cciTime)
if params['cci-buy-trigger'] == cciName:
conditions.append(dataframe[cciName] < params["cci-buy-value"])
conditions.append(dataframe['volume'] > 0)
if 'rsi-buy-trigger' in params:
for rsiTime in rsiTimeRange:
rsiName = "rsi-" + str(rsiTime)
if params['rsi-buy-trigger'] == rsiName:
conditions.append(dataframe[rsiName] < params["rsi-buy-value"])
conditions.append(dataframe['volume'] > 0)
if conditions:
dataframe.loc[reduce(lambda x, y: x & y, conditions), 'buy'] = 1
@@ -85,20 +85,20 @@ class HOSwingHighToSky(IHyperOpt):
@staticmethod
def indicator_space() -> List[Dimension]:
cciBuyTriggerList = []
rsiBuyTriggerList = []
for cciTime in cciTimeRange:
cciName = "cci-" + str(cciTime)
cciBuyTriggerList.append(cciName)
for rsiTime in rsiTimeRange:
rsiName = "rsi-" + str(rsiTime)
rsiBuyTriggerList.append(rsiName)
return [
Integer(cciValueMin, cciValueMax, name='cci-buy-value'),
Integer(rsiValueMin, rsiValueMax, name='rsi-buy-value'),
@@ -110,28 +110,28 @@ class HOSwingHighToSky(IHyperOpt):
def sell_strategy_generator(params: Dict[str, Any]) -> Callable:
def populate_sell_trend(dataframe: DataFrame, metadata: dict) -> DataFrame:
conditions = []
# TRIGGERS & GUARDS
if 'cci-sell-trigger' in params:
for cciTime in cciTimeRange:
cciName = "cci-" + str(cciTime)
if params['cci-sell-trigger'] == cciName:
conditions.append(dataframe[cciName] > params["cci-sell-value"])
if 'rsi-sell-trigger' in params:
for rsiTime in rsiTimeRange:
rsiName = "rsi-" + str(rsiTime)
if params['rsi-sell-trigger'] == rsiName:
conditions.append(dataframe[rsiName] > params["rsi-sell-value"])
if conditions:
dataframe.loc[reduce(lambda x, y: x & y, conditions), 'sell'] = 1
@@ -141,20 +141,20 @@ class HOSwingHighToSky(IHyperOpt):
@staticmethod
def sell_indicator_space() -> List[Dimension]:
cciSellTriggerList = []
rsiSellTriggerList = []
for cciTime in cciTimeRange:
cciName = "cci-" + str(cciTime)
cciSellTriggerList.append(cciName)
for rsiTime in rsiTimeRange:
rsiName = "rsi-" + str(rsiTime)
rsiSellTriggerList.append(rsiName)
return [
Integer(cciValueMin, cciValueMax, name='cci-sell-value'),
Integer(rsiValueMin, rsiValueMax, name='rsi-sell-value'),