Skip to content
Closed
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.

## 2026-04-10 - Thousands Separators for Numerical Output
**Learning:** Dense numerical data (like $10000.00) in CLI output is hard to parse and increases cognitive load. Adding thousands separators ($10,000.00) significantly improves readability and the perceived quality of the tool.
**Action:** Always use thousands separators (e.g., `:,.2f` in Python) when formatting large numerical or financial values in CLI outputs.
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