From c01e8fb8591a67f5240637acf7bf19f898ed1edb Mon Sep 17 00:00:00 2001 From: moshferatu Date: Wed, 4 Dec 2024 11:22:00 -0800 Subject: [PATCH] Add test for simple moving average indicator --- test/sma_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/sma_test.py diff --git a/test/sma_test.py b/test/sma_test.py new file mode 100644 index 0000000..9660653 --- /dev/null +++ b/test/sma_test.py @@ -0,0 +1,10 @@ +from datetime import datetime, timedelta + +from indicators import sma +from ohlc import ohlc + +today = datetime.today() +data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today) + +sma_values = sma(data, period = 10) +print(sma_values) \ No newline at end of file