Open Aladdin - Pytorch
Project description
Open-Aladdin
Install
$ pip3 install -U open-aladdin
Example
from open_aladdin.main import fetch_stock_data, AdvancedRealTimeRiskAssessment
import time
if __name__ == "__main__":
# Example usage
# from data_integration import fetch_stock_data
tickers = [
"AAPL",
"GOOGL",
"MSFT",
"AMZN",
"^GSPC",
] # Including S&P 500 for market returns
historical_data = {
ticker: fetch_stock_data(ticker) for ticker in tickers
}
risk_assessor = AdvancedRealTimeRiskAssessment(historical_data)
risk_assessor.start_continuous_training()
try:
# Run for a while to allow some training iterations
time.sleep(60)
# Perform risk assessment
risk_results = risk_assessor.run_risk_assessment(
forecast_horizon=4
) # 1-year forecast
# Output results
risk_assessor.output_results(risk_results, "json")
risk_assessor.output_results(risk_results, "csv")
# Print some results
for ticker, measures in risk_results.items():
print(f"\nRisk Assessment for {ticker}:")
for measure, value in measures.items():
if isinstance(value, list):
print(
f"{measure}: [showing first 5 values] {value[:5]}"
)
else:
print(f"{measure}: {value:.4f}")
finally:
# Ensure we stop the continuous training when done
risk_assessor.stop_continuous_training()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
open_aladdin-0.0.2.tar.gz
(6.6 kB
view hashes)
Built Distribution
Close
Hashes for open_aladdin-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 081f710b89a3e228da3c2d217f88d078f5f8730322defd574117fed3dd5ea8ee |
|
MD5 | 9b5e69b8038e49470a5a1af7010ebc6c |
|
BLAKE2b-256 | 949f41820e7351d3d704e25d55bf2da071470cbfd1a38715d5a325fa375d8d8d |