Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,7 @@ for company in companies:
|
|
| 96 |
df_c['StrategyA_Cumulative'] = 0.0
|
| 97 |
for i in range(1, len(df_c)):
|
| 98 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 99 |
-
price = df_c.loc[i-1, f'Close_{TICKERS[
|
| 100 |
|
| 101 |
if df_c.loc[i, 'Sentiment'] == "UP" and df_c.loc[i,'Confidence'] > 0.8:
|
| 102 |
df_c.loc[i,'StrategyA_Cumulative'] = df_c.loc[i-1,'StrategyA_Cumulative'] + price * pct
|
|
@@ -108,7 +108,7 @@ for company in companies:
|
|
| 108 |
df_c['StrategyB_Cumulative'] = 0.0
|
| 109 |
for i in range(1, len(df_c)):
|
| 110 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 111 |
-
price = df_c.loc[i-1, f'Close_{TICKERS[
|
| 112 |
predicted = df_c.loc[i, 'Predicted']
|
| 113 |
|
| 114 |
if predicted > 1:
|
|
@@ -123,7 +123,7 @@ for company in companies:
|
|
| 123 |
df_c['StrategyC_Cumulative'] = 0.0
|
| 124 |
for i in range(1, len(df_c)):
|
| 125 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 126 |
-
price = df_c.loc[i-1, f'Close_{TICKERS[
|
| 127 |
|
| 128 |
if df_c.loc[i, 'FinBERT_Sentiment'] == "POSITIVE" and df_c.loc[i,'FinBERT_Confidence'] > 0.8:
|
| 129 |
df_c.loc[i,'StrategyC_Cumulative'] = df_c.loc[i-1,'StrategyC_Cumulative'] + price * pct
|
|
|
|
| 96 |
df_c['StrategyA_Cumulative'] = 0.0
|
| 97 |
for i in range(1, len(df_c)):
|
| 98 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 99 |
+
price = df_c.loc[i-1, f'Close_{TICKERS[company]}'] # prezzo di acquisto del giorno precedente
|
| 100 |
|
| 101 |
if df_c.loc[i, 'Sentiment'] == "UP" and df_c.loc[i,'Confidence'] > 0.8:
|
| 102 |
df_c.loc[i,'StrategyA_Cumulative'] = df_c.loc[i-1,'StrategyA_Cumulative'] + price * pct
|
|
|
|
| 108 |
df_c['StrategyB_Cumulative'] = 0.0
|
| 109 |
for i in range(1, len(df_c)):
|
| 110 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 111 |
+
price = df_c.loc[i-1, f'Close_{TICKERS[company]}']
|
| 112 |
predicted = df_c.loc[i, 'Predicted']
|
| 113 |
|
| 114 |
if predicted > 1:
|
|
|
|
| 123 |
df_c['StrategyC_Cumulative'] = 0.0
|
| 124 |
for i in range(1, len(df_c)):
|
| 125 |
pct = df_c.loc[i, 'PctChangeDaily'] if pd.notnull(df_c.loc[i,'PctChangeDaily']) else 0
|
| 126 |
+
price = df_c.loc[i-1, f'Close_{TICKERS[company]}']
|
| 127 |
|
| 128 |
if df_c.loc[i, 'FinBERT_Sentiment'] == "POSITIVE" and df_c.loc[i,'FinBERT_Confidence'] > 0.8:
|
| 129 |
df_c.loc[i,'StrategyC_Cumulative'] = df_c.loc[i-1,'StrategyC_Cumulative'] + price * pct
|