Update app.py
Browse files
app.py
CHANGED
|
@@ -59,16 +59,6 @@ for i, row in df_multi.iterrows():
|
|
| 59 |
df_multi.at[i,'FinBERT_Confidence'] = 0.0
|
| 60 |
|
| 61 |
# Regression (Tesla & MSFT)
|
| 62 |
-
try:
|
| 63 |
-
if company == "Tesla, Inc.":
|
| 64 |
-
val = price_pipeline_tesla(row['Summary'])[0]['score']
|
| 65 |
-
df_multi.at[i,'Predicted'] = min(val, 1.0)
|
| 66 |
-
elif company == "Microsoft":
|
| 67 |
-
val = price_pipeline_msft(row['Summary'])[0]['score']
|
| 68 |
-
df_multi.at[i,'Predicted'] = min(val, 1.0)
|
| 69 |
-
except:
|
| 70 |
-
df_multi.at[i,'Predicted'] = 0.0
|
| 71 |
-
|
| 72 |
# --- FETCH STOCK PRICES ---
|
| 73 |
prices = {}
|
| 74 |
for company, ticker in TICKERS.items():
|
|
@@ -113,7 +103,7 @@ for company in companies:
|
|
| 113 |
|
| 114 |
if predicted > 1:
|
| 115 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative'] + price * pct
|
| 116 |
-
elif predicted < 1:
|
| 117 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative'] - price * pct
|
| 118 |
else:
|
| 119 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative']
|
|
|
|
| 59 |
df_multi.at[i,'FinBERT_Confidence'] = 0.0
|
| 60 |
|
| 61 |
# Regression (Tesla & MSFT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
# --- FETCH STOCK PRICES ---
|
| 63 |
prices = {}
|
| 64 |
for company, ticker in TICKERS.items():
|
|
|
|
| 103 |
|
| 104 |
if predicted > 1:
|
| 105 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative'] + price * pct
|
| 106 |
+
elif predicted < -1:
|
| 107 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative'] - price * pct
|
| 108 |
else:
|
| 109 |
df_c.loc[i,'StrategyB_Cumulative'] = df_c.loc[i-1,'StrategyB_Cumulative']
|