Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -67,8 +67,8 @@ def get_account_info():
|
|
| 67 |
'buying_power': float(account.buying_power),
|
| 68 |
'cash': float(account.cash),
|
| 69 |
'equity': float(account.equity),
|
| 70 |
-
'day_change': float(account
|
| 71 |
-
'day_change_percent': float(account
|
| 72 |
'last_equity': float(account.last_equity) if account.last_equity else 0
|
| 73 |
}
|
| 74 |
except Exception as e:
|
|
@@ -83,7 +83,7 @@ def get_portfolio_history():
|
|
| 83 |
try:
|
| 84 |
portfolio_history_request = GetPortfolioHistoryRequest(
|
| 85 |
period="1M",
|
| 86 |
-
timeframe=
|
| 87 |
extended_hours=False
|
| 88 |
)
|
| 89 |
|
|
|
|
| 67 |
'buying_power': float(account.buying_power),
|
| 68 |
'cash': float(account.cash),
|
| 69 |
'equity': float(account.equity),
|
| 70 |
+
'day_change': float(getattr(account, 'unrealized_pl', 0)) if hasattr(account, 'unrealized_pl') else 0,
|
| 71 |
+
'day_change_percent': float(getattr(account, 'unrealized_plpc', 0)) * 100 if hasattr(account, 'unrealized_plpc') else 0,
|
| 72 |
'last_equity': float(account.last_equity) if account.last_equity else 0
|
| 73 |
}
|
| 74 |
except Exception as e:
|
|
|
|
| 83 |
try:
|
| 84 |
portfolio_history_request = GetPortfolioHistoryRequest(
|
| 85 |
period="1M",
|
| 86 |
+
timeframe="1Day",
|
| 87 |
extended_hours=False
|
| 88 |
)
|
| 89 |
|