- price_db: add sell_prices table (ensure/upsert/load/delete)
- trader: restore _last_sell_prices from DB on startup so re-entry
block survives restarts; persist each sell price immediately
- market: retry chunk requests up to 3 times with backoff on 429
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add trade_results table to Oracle DB for persistent trade history
- Record win/loss after each sell with pnl_pct
- Load last N trades per ticker from DB on startup (survives restarts)
- Block buy() when recent win rate (last 5 trades) < 40% threshold
- Configurable via WF_WINDOW and WF_MIN_WIN_RATE env vars
- Backtest showed improvement from -7.5% to +37.4% cumulative return
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- price_history table on Oracle ADB stores prices every 10 minutes
- check_trend(): current price vs N hours ago (default 1h, +3% threshold)
- check_momentum(): unchanged (MA20 + 2x volume still applies)
- Ticker list cached 5 minutes to avoid 429 rate limits
- Collector starts 30s after boot to avoid simultaneous API calls
- Configurable: TREND_HOURS, TREND_MIN_GAIN_PCT in .env
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wrap run_scanner() in while True loop so main thread recovers from
unhandled exceptions. Sends Telegram alert on crash before restarting.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Run status reporter thread every 60 minutes, sends current price,
PnL, drop from peak, and holding time for each position.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- restore_positions(): read Upbit balances on startup to prevent
double-buying after restart
- notify.py: read TOKEN/CHAT_ID inside _send() to avoid empty values
when module is imported before load_dotenv()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- notify.py: buy/sell/error alerts via upbit_trading_jm_bot
- STOP_LOSS_PCT: trailing stop configurable via .env (default -5%)
- notify_buy/notify_sell called on every trade execution
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sell position if held for TIME_STOP_HOURS (default 24h) with less than
TIME_STOP_MIN_GAIN_PCT (default +3%) gain. Frees up capital for
fresh momentum opportunities.
Priority: trailing stop (-10%) checked first, then time stop.
Both thresholds configurable via .env.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Strategy C: volatility breakout (Larry Williams K=0.5) AND momentum
(MA20 + 2x volume surge) must both trigger for a buy signal.
Hard rules:
- Trailing stop: sell when price drops -10% from peak
- Max budget: 1,000,000 KRW total, up to 3 positions (333,333 KRW each)
- Scan top 20 KRW tickers by 24h trading volume every 60s
- Monitor positions every 10s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>