Spaces:
Running
Running
Commit
·
d90be64
1
Parent(s):
3f99637
app: include forecasts in plot
Browse files
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
from src.stock_analysis_agent import StockAnalyst
|
| 4 |
from src.technical_analysis import TechnicalAnalysis
|
| 5 |
|
|
@@ -44,10 +46,15 @@ def plot_stock(agent_instance, ticker):
|
|
| 44 |
return 'Stock-Analysis Agent is not initialized. Please initialize first.'
|
| 45 |
ticker_exists = agent_instance.tickerfinder.does_ticker_exist(ticker)
|
| 46 |
if ticker_exists:
|
|
|
|
|
|
|
|
|
|
| 47 |
# run the technical analysis
|
| 48 |
_, fig = TechnicalAnalysis(
|
| 49 |
ticker=ticker,
|
| 50 |
fetchperiodinweeks=12,
|
|
|
|
|
|
|
| 51 |
plot_ta=True,
|
| 52 |
savefig=False,
|
| 53 |
debug=False).run()
|
|
|
|
| 1 |
+
import dotenv
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
from src.fetch_forecast import FetchForecast
|
| 5 |
from src.stock_analysis_agent import StockAnalyst
|
| 6 |
from src.technical_analysis import TechnicalAnalysis
|
| 7 |
|
|
|
|
| 46 |
return 'Stock-Analysis Agent is not initialized. Please initialize first.'
|
| 47 |
ticker_exists = agent_instance.tickerfinder.does_ticker_exist(ticker)
|
| 48 |
if ticker_exists:
|
| 49 |
+
# fetch the forecasts
|
| 50 |
+
dotenv.load_dotenv(dotenv.find_dotenv())
|
| 51 |
+
df_past, df_fcst = FetchForecast(ticker).run()
|
| 52 |
# run the technical analysis
|
| 53 |
_, fig = TechnicalAnalysis(
|
| 54 |
ticker=ticker,
|
| 55 |
fetchperiodinweeks=12,
|
| 56 |
+
df_past=df_past,
|
| 57 |
+
df_fcst=df_fcst,
|
| 58 |
plot_ta=True,
|
| 59 |
savefig=False,
|
| 60 |
debug=False).run()
|