Skip to content

Commit

Permalink
Fixed unit tests with date time as index
Browse files Browse the repository at this point in the history
  • Loading branch information
joshyattridge committed May 25, 2024
1 parent 0dbc6ed commit 5dbf334
Show file tree
Hide file tree
Showing 13 changed files with 86,578 additions and 86,579 deletions.
4 changes: 2 additions & 2 deletions tests/SMC.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,15 @@ def fig_to_buffer(fig):
fvg_data = smc.fvg(window_df, join_consecutive=True)
swing_highs_lows_data = smc.swing_highs_lows(window_df, swing_length=5)
bos_choch_data = smc.bos_choch(window_df, swing_highs_lows_data)
ob_data = smc.ob(window_df, swing_highs_lows_data)
# ob_data = smc.ob(window_df, swing_highs_lows_data)
liquidity_data = smc.liquidity(window_df, swing_highs_lows_data)
previous_high_low_data = smc.previous_high_low(window_df, time_frame="4h")
sessions = smc.sessions(window_df, session="London")
retracements = smc.retracements(window_df, swing_highs_lows_data)
fig = add_FVG(fig, window_df, fvg_data)
fig = add_swing_highs_lows(fig, window_df, swing_highs_lows_data)
fig = add_bos_choch(fig, window_df, bos_choch_data)
fig = add_OB(fig, window_df, ob_data)
# fig = add_OB(fig, window_df, ob_data)
fig = add_liquidity(fig, window_df, liquidity_data)
fig = add_previous_high_low(fig, window_df, previous_high_low_data)
fig = add_sessions(fig, window_df, sessions)
Expand Down
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
def df():
test_instrument = "EURUSD"
instrument_data = f"{test_instrument}_15M.csv"
return pd.read_csv(
os.path.join("tests/test_data", test_instrument, instrument_data)
)
df = pd.read_csv(os.path.join("test_data", test_instrument, instrument_data))
df = df.set_index("Date")
df.index = pd.to_datetime(df.index)
return df


@pytest.fixture
Expand Down
Binary file modified tests/test.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5dbf334

Please sign in to comment.