Browse Source

test: testing change rate history

pull/15/head
QuentinN42 8 months ago
parent
commit
d7a7bc9474
Signed by: number42 GPG Key ID: 2CD7D563712B3A50
  1. 6
      tests/broker/test_backtest.py

6
tests/broker/test_backtest.py

@ -1,6 +1,7 @@
import pytest
import datetime
from pandas import DataFrame # type: ignore
from auto_trading.broker.backtest import Backtest
@ -22,6 +23,11 @@ def test_nyse_backtest(backtest, first_change):
assert backtest.current_change == first_change
assert backtest.properties.period == step
assert backtest.step == step
assert (
(backtest.change_rate_history == backtest.data.close.unstack(level=1))
.all()
.all()
)
k = first_day
for data in backtest:
k += step

Loading…
Cancel
Save