-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (24 loc) · 832 Bytes
/
main.py
File metadata and controls
30 lines (24 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json
from utils import Agent
from datetime import datetime, timedelta
def main():
try:
with open('config.json', 'r') as config_file:
config = json.load(config_file)
except Exception as e:
print(f"Error reading config.json: {e}")
return
agent = Agent(config)
print("Agent initialized successfully.")
print("\n")
# print(config)
today = datetime.today()
start_date = today - timedelta(days=config['num_days'])
end_date = today
# agent.get_news(start_date, end_date)
# agent.get_stock_data(start_date, end_date)
# price = agent.predict(start_date, end_date)
# print(f"Predicted price for {config['ticker']} on {start_date.strftime('%Y-%m-%d')}: {price}")
agent.plotting(start_date, end_date)
if __name__ == '__main__':
main()