Skip to content

Commit

Permalink
Merge pull request #20 from joshyattridge/18-index-0-is-out-of-bounds…
Browse files Browse the repository at this point in the history
…-for-axis-0-with-size-0

fixed the index 0 is out of bounds for axis 0 with size 0 issue
  • Loading branch information
joshyattridge authored Apr 20, 2024
2 parents 56bac5f + 989010a commit 6e7e01d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions smartmoneyconcepts/smc.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ def swing_highs_lows(
continue_ = True

positions = np.where(~np.isnan(swing_highs_lows))[0]
if swing_highs_lows[positions[0]] == 1:
swing_highs_lows[0] = -1
if swing_highs_lows[positions[-1]] == -1:
swing_highs_lows[-1] = 1
if len(positions) > 0:
if swing_highs_lows[positions[0]] == 1:
swing_highs_lows[0] = -1
if swing_highs_lows[positions[-1]] == -1:
swing_highs_lows[-1] = 1

level = np.where(
~np.isnan(swing_highs_lows),
Expand Down

0 comments on commit 6e7e01d

Please sign in to comment.