Skip to content

Commit

Permalink
Merge pull request #37 from joshyattridge/unit_testing
Browse files Browse the repository at this point in the history
Added unit testing
  • Loading branch information
joshyattridge authored May 14, 2024
2 parents da9ca70 + 0c8c0ae commit 58bb145
Show file tree
Hide file tree
Showing 11 changed files with 219,937 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smartmoneyconcepts/smc.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def ob(
)
percentage[obIndex] = (
np.min([highVolume[obIndex], lowVolume[obIndex]], axis=0)
/ np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0)
/ np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0) if np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0) != 0 else 1
) * 100.0

for i in range(len(ohlc)):
Expand Down Expand Up @@ -547,7 +547,7 @@ def ob(
highVolume[obIndex] = ohlc["volume"].iloc[close_index - 2]
percentage[obIndex] = (
np.min([highVolume[obIndex], lowVolume[obIndex]], axis=0)
/ np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0)
/ np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0) if np.max([highVolume[obIndex], lowVolume[obIndex]], axis=0) != 0 else 1
) * 100.0

ob = np.where(ob != 0, ob, np.nan)
Expand Down
24,425 changes: 24,425 additions & 0 deletions tests/test_data/EURUSD_15M.csv

Large diffs are not rendered by default.

Loading

0 comments on commit 58bb145

Please sign in to comment.