-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (28 loc) 路 1.11 KB
/
Copy pathmain.py
File metadata and controls
39 lines (28 loc) 路 1.11 KB
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
30
31
32
33
34
35
36
37
38
39
"""Run the Semantic Kernel quantitative-investment workflow.
This produces research artifacts only; it does not connect to a brokerage or execute trades.
"""
from __future__ import annotations
import asyncio
import os
from dotenv import load_dotenv
from .workflow import InvestmentWorkflow
def task() -> str:
ticker = os.getenv("INVESTMENT_TICKER", "MSFT")
start = os.getenv("INVESTMENT_START_DATE", "2020-01-01")
end = os.getenv("INVESTMENT_END_DATE", "2026-07-01")
capital = os.getenv("INVESTMENT_INITIAL_CAPITAL", "10000")
return (
f"Analyze {ticker} from {start} to {end}. Develop one transparent technical-analysis "
f"signal strategy as Python code, execute it, backtest ${capital}, and report CAGR, "
"total return, final value, drawdown, and Sharpe ratio."
)
async def main() -> None:
load_dotenv()
workflow = InvestmentWorkflow()
try:
print(await workflow.run(task()))
print(f"Semantic Kernel output directory: {workflow.output_dir.resolve()}")
finally:
await workflow.close()
if __name__ == "__main__":
asyncio.run(main())