Skip to content

Commit

Permalink
Merge pull request #48 from skhan877/master
Browse files Browse the repository at this point in the history
catering for FutureWarning DataFrame.fillna with method is deprecated
  • Loading branch information
saeedamen authored Nov 9, 2024
2 parents c0d6a07 + fc771ba commit 854c5e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions finmarketpy/economics/techindicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ def create_tech_ind(
self._techind = None

if tech_params.fillna:
data_frame = data_frame_non_nan.fillna(method="ffill")
data_frame = data_frame_non_nan.ffill()
else:
data_frame = data_frame_non_nan

if data_frame_non_nan_early is not None:
data_frame_early = data_frame_non_nan_early.fillna(method="ffill")
data_frame_early = data_frame_non_nan_early.ffill()

if name == "SMA":

Expand Down Expand Up @@ -236,7 +236,7 @@ def create_tech_ind(
signal[buys] = 1
signal[sells] = -1
signal[~(buys | sells)] = np.nan
signal = signal.fillna(method='ffill')
signal = signal.ffill()

self._signal = signal

Expand Down Expand Up @@ -272,7 +272,7 @@ def create_tech_ind(
signal[buys] = 1
signal[sells] = -1
signal[~(buys | sells)] = np.nan
signal = signal.fillna(method='ffill')
signal = signal.ffill()

self._signal = signal
self._signal.iloc[0:tech_params.bb_period] = np.nan
Expand Down

0 comments on commit 854c5e9

Please sign in to comment.