From a879c0cf3eb2110e807a6c693f6b626c86391dbf Mon Sep 17 00:00:00 2001 From: moshferatu Date: Fri, 10 Jan 2025 08:42:05 -0800 Subject: [PATCH] Add test for TPS strategy --- test/tps_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/tps_test.py diff --git a/test/tps_test.py b/test/tps_test.py new file mode 100644 index 0000000..f885b4a --- /dev/null +++ b/test/tps_test.py @@ -0,0 +1,13 @@ +from datetime import datetime, timedelta + +from ohlc import ohlc +from strategies import tps + +today = datetime.today() +data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today) + +signals = tps(data) + +result = data[['Date']].copy() +result['Signal'] = signals +print(result.tail(50)) \ No newline at end of file