switch ix to loc, ix is apparently deprecated

This commit is contained in:
Janne Sinivirta 2017-11-16 20:16:54 +02:00
parent 174122a09b
commit 5d1f874041

View File

@ -66,14 +66,14 @@ def populate_buy_trend(dataframe: DataFrame) -> DataFrame:
:param dataframe: DataFrame :param dataframe: DataFrame
:return: DataFrame with buy column :return: DataFrame with buy column
""" """
dataframe.ix[ dataframe.loc[
(dataframe['close'] < dataframe['sma']) & (dataframe['close'] < dataframe['sma']) &
(dataframe['tema'] <= dataframe['blower']) & (dataframe['tema'] <= dataframe['blower']) &
(dataframe['mfi'] < 25) & (dataframe['mfi'] < 25) &
(dataframe['fastd'] < 25) & (dataframe['fastd'] < 25) &
(dataframe['adx'] > 30), (dataframe['adx'] > 30),
'buy'] = 1 'buy'] = 1
dataframe.ix[dataframe['buy'] == 1, 'buy_price'] = dataframe['close'] dataframe.loc[dataframe['buy'] == 1, 'buy_price'] = dataframe['close']
return dataframe return dataframe
@ -83,10 +83,10 @@ def populate_sell_trend(dataframe: DataFrame) -> DataFrame:
:param dataframe: DataFrame :param dataframe: DataFrame
:return: DataFrame with buy column :return: DataFrame with buy column
""" """
dataframe.ix[ dataframe.loc[
(crossed_above(dataframe['rsi'], 70)), (crossed_above(dataframe['rsi'], 70)),
'sell'] = 1 'sell'] = 1
dataframe.ix[dataframe['sell'] == 1, 'sell_price'] = dataframe['close'] dataframe.loc[dataframe['sell'] == 1, 'sell_price'] = dataframe['close']
return dataframe return dataframe