jetpackjules commited on
Commit
26d245c
·
verified ·
1 Parent(s): eeda6d7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.unrealized_pl) if account.unrealized_pl else 0,
71
- 'day_change_percent': float(account.unrealized_plpc) * 100 if 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,7 +83,7 @@ def get_portfolio_history():
83
  try:
84
  portfolio_history_request = GetPortfolioHistoryRequest(
85
  period="1M",
86
- timeframe=TimeFrame.Day,
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