aboutsummaryrefslogtreecommitdiff
path: root/simulate.py
diff options
context:
space:
mode:
Diffstat (limited to 'simulate.py')
-rw-r--r--simulate.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/simulate.py b/simulate.py
index 7b01c21..b576c4b 100644
--- a/simulate.py
+++ b/simulate.py
@@ -1,6 +1,6 @@
from algo import Algo
from ema_algo import Ema_Algo
-from api import fetch_chart_data, fetch_chart_data_backtest
+from api import fetch_chart_data_yahoo, fetch_chart_data_backtest
import datetime
import json
import random
@@ -140,20 +140,22 @@ def run_batch(batch_name, algo, num_trials=100):
# increment trial num
i += 1
-run_batch('test', Ema_Algo(), 5)
+# run_batch('test', Ema_Algo(), 5)
def test():
print("MAIN simulate.py")
ema_algo = Ema_Algo()
- ticker = 'ADA-USD'
+ ticker = 'XRP-USD'
period = '5d'
interval = '1m'
# get data
# data = fetch_chart_data(ticker, period, interval)
- data = fetch_chart_data_backtest()
+ # period_end_date = datetime.datetime.now(tz=datetime.timezone.utc) - datetime.timedelta(days=7)
+ # print(period_end_date)
+ data = fetch_chart_data_yahoo(ticker)
print(data.keys())
url_params = {
@@ -175,3 +177,5 @@ def test():
fd = open('bt-recent.json', 'w')
fd.write(json.dumps(trial_data))
fd.close()
+
+test() \ No newline at end of file