Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
## 2025-03-23 - Game Key Scrolling
**Learning:** Browsers natively scroll the page when users press Space or Arrow keys. When building a web-based game, this creates a frustrating UX where the game viewport jumps around while playing.
**Action:** Always call `e.preventDefault()` on keydown events for typical game controls ("Space", "ArrowUp", etc.) when the focus is on a game container or the body.

## 2025-03-23 - Cognitive Load in CLI Financial Outputs
**Learning:** Large numbers without thousands separators in CLI outputs significantly increase cognitive load and reduce readability for users.
**Action:** Always use thousands separators (e.g., `:,2f`) when formatting large financial or numerical values in console output to improve accessibility and parsing speed.
8 changes: 4 additions & 4 deletions bitcoin_trading_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,22 @@ def simulate_trading(signals, initial_cash=10000, quiet=False):
portfolio.loc[i, 'btc'] += btc_to_buy
portfolio.loc[i, 'cash'] -= btc_to_buy * row['price']
if not quiet:
print(f"{Colors.GREEN}🟒 Day {i}: Buy {btc_to_buy:.4f} BTC at ${row['price']:.2f}{Colors.ENDC}")
print(f"{Colors.GREEN}🟒 Day {i}: Buy {btc_to_buy:,.4f} BTC at ${row['price']:,.2f}{Colors.ENDC}")

# Sell signal
elif row['positions'] == -2.0:
if portfolio.loc[i, 'btc'] > 0:
cash_received = portfolio.loc[i, 'btc'] * row['price']
portfolio.loc[i, 'cash'] += cash_received
if not quiet:
print(f"{Colors.FAIL}πŸ”΄ Day {i}: Sell {portfolio.loc[i, 'btc']:.4f} BTC at ${row['price']:.2f}{Colors.ENDC}")
print(f"{Colors.FAIL}πŸ”΄ Day {i}: Sell {portfolio.loc[i, 'btc']:,.4f} BTC at ${row['price']:,.2f}{Colors.ENDC}")
portfolio.loc[i, 'btc'] = 0

portfolio.loc[i, 'total_value'] = portfolio.loc[i, 'cash'] + portfolio.loc[i, 'btc'] * row['price']

if not quiet:
print(f"Day {i}: Portfolio Value: ${portfolio.loc[i, 'total_value']:.2f}, "
f"Cash: ${portfolio.loc[i, 'cash']:.2f}, BTC: {portfolio.loc[i, 'btc']:.4f}")
print(f"Day {i}: Portfolio Value: ${portfolio.loc[i, 'total_value']:,.2f}, "
f"Cash: ${portfolio.loc[i, 'cash']:,.2f}, BTC: {portfolio.loc[i, 'btc']:,.4f}")

if quiet and sys.stdout.isatty():
print()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
numpy
pandas
requests
venv
Loading