Go to file
kroutony b6bd45b151 Fix SELL P&L calculation, add debug logging, and multiple improvements
- Fix realized_pnl always being 0 on SELL (use amount*price instead of amount_usdt)
- Add debug logging for all-HOLD LLM cycles (log sample HOLD reasons)
- Fix nonce collision in Bitfinex API auth (add counter)
- Fix timezone to UTC+8 in main, trade_logger, sync_cost_basis, check_errors
- Fix stop-loss retry with longer delay after cancel
- Add min order amount check in trader before BUY
- Fix risk_manager to skip positions with amount <= 0
- Cap trade_history to 500 entries to prevent unbounded growth
- Fix greedy regex in LLM response parser
- Reset cost_tracking start dates to null

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 06:23:54 +00:00
memory Backup Claude memory files to project repo 2026-03-13 11:23:22 +00:00
.env.example Initial commit: LLM-driven crypto trading bot 2026-03-13 03:25:18 +00:00
.gitignore Remove stop_orders.json from git, add to gitignore with deposit_cache.json 2026-03-15 13:19:15 +00:00
check_errors.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
config.py Align cost basis start date to 2026-03-10 UTC 2026-03-15 10:27:11 +00:00
cost_tracking.json Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
data_fetcher.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
indicators.py Add advanced indicators: MTF analysis, ADX, StochRSI, OBV, CMF, pivot points 2026-03-14 03:26:59 +00:00
llm_analyzer.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
main.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
portfolio.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
requirements.txt Initial commit: LLM-driven crypto trading bot 2026-03-13 03:25:18 +00:00
risk_manager.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
setup.sh Add Claude auto-fix to check_errors.py, distinguish LLM failure in Slack reports 2026-03-16 03:08:06 +00:00
slack_notifier.py Add Claude auto-fix to check_errors.py, distinguish LLM failure in Slack reports 2026-03-16 03:08:06 +00:00
sync_cost_basis.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
trade_logger.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00
trader.py Fix SELL P&L calculation, add debug logging, and multiple improvements 2026-03-17 06:23:54 +00:00