Skip to content

Commit

Permalink
Remove buyframe dependency
Browse files Browse the repository at this point in the history
Removed buyframe from populate_sell_trend
  • Loading branch information
lebonez committed Jan 28, 2020
1 parent 20941f7 commit 5a68051
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions user_data/strategies/berlinguyinca/BinHV27.py
Expand Up @@ -90,32 +90,22 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
'buy'] = 1
return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
buyframe = dataframe[dataframe['buy'] == 1].tail(1)
if len(buyframe) == 0:
dataframe.loc[[False], 'sell'] = 0
return dataframe
trend = buyframe.iloc[0]['trend']
bigup = buyframe.iloc[0]['bigup']
bigdown = buyframe.iloc[0]['bigdown']
price = buyframe.iloc[0]['close']
dataframe.loc[
(
(
bigup &
~dataframe['preparechangetrendconfirm'] &
~dataframe['continueup'] &
(dataframe['close'].gt(dataframe['lowsma']) | dataframe['close'].gt(dataframe['highsma'])) &
dataframe['highsma'].gt(0) &
(dataframe['bigdown'] | dataframe['trend'].lt(trend))
dataframe['bigdown']
) |
(
bigdown &
~dataframe['preparechangetrendconfirm'] &
~dataframe['continueup'] &
dataframe['close'].gt(dataframe['highsma']) &
dataframe['highsma'].gt(0) &
(dataframe['emarsi'].ge(75) | dataframe['close'].gt(dataframe['slowsma'])) &
(dataframe['bigdown'] | dataframe['trend'].lt(trend))
dataframe['bigdown']
) |
(
~dataframe['preparechangetrendconfirm'] &
Expand Down

0 comments on commit 5a68051

Please sign in to comment.