Commit Graph

806 Commits

Author SHA1 Message Date
tinkle-community
abaffaddb9 fix: add SSRF protection for user-controlled URLs
- Add security/url_validator.go with ValidateURL, SafeHTTPClient, SafeGet
- Block private IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16)
- Block cloud metadata endpoints (169.254.169.254, metadata.google.internal)
- Validate DNS resolution to prevent DNS rebinding attacks
- Check redirect destinations for SSRF
- Fix FetchQuantData, FetchOIRanking, fetchAI500, fetchOITop, fetchSingleExternalSource
2025-12-14 12:01:23 +08:00
tinkle-community
48084f50cf docs: update README screenshots with backtest lab
- Rename img.png to backtest-lab.png
- Arrange 12 screenshots in 6 pairs (2 per row)
- Add Backtest Lab to Web Interface Features section
2025-12-14 00:42:26 +08:00
tinkle-community
1e135ea9c3 feat: redesign backtest module UI and fix 404 issue
- Fix backtest API 404 by registering routes in setupRoutes()
- Redesign BacktestPage with 3-step wizard configuration
- Add progress ring visualization with animation
- Add equity chart with trade markers using Recharts
- Add trade timeline with card-style display
- Add stats cards for equity, return, drawdown, sharpe
- Add tab navigation for overview/chart/trades/decisions
- Improve run history list with status icons
- Add lightweight-charts dependency (for future use)
2025-12-14 00:23:51 +08:00
tinkle-community
4aa612f397 refactor: rename pool to provider (Data Provider) 2025-12-13 21:43:43 +08:00
tinkle-community
c4363f3bc7 fix: use strategy config for position value ratio validation instead of hardcoded 1.5x 2025-12-13 20:47:15 +08:00
tinkle-community
0381815a13 feat: add dropdown selector for Recent Decisions count (5/10/20/50/100) 2025-12-13 00:13:29 +08:00
tinkle-community
7806749297 fix: use max_completion_tokens for OpenAI newer models 2025-12-12 23:32:32 +08:00
tinkle-community
5391f39749 chore: upgrade OpenAI default model to gpt-5.2 2025-12-12 23:30:24 +08:00
Ember
ed041b9183 refactor: replace inline SVG exchange icons with local image files (#1224) 2025-12-12 21:09:57 +08:00
tinkle-community
dcc16fec82 feat: add Bitget futures trading support
- Add BitgetTrader with full trading implementation
- Support one-way position mode with proper API parameters
- Add Bitget to all exchange switch statements
- Update exchange icons (Bybit, OKX, Bitget, Lighter)
- Add Bitget to frontend exchange config modal
2025-12-12 18:59:09 +08:00
tinkle-community
76574aacb2 docs: add debate arena screenshots to README 2025-12-12 16:58:44 +08:00
tinkle-community
cc390706d0 feat: add OI ranking data support and fix trader config update issues
- Add OI ranking data fetching and formatting for AI prompts
- Fix trader update not saving strategy_id, ai_model_id, initial_balance
- Fix AI API key not set for non-qwen/deepseek providers
- Add strategy_id to trader config API response
- Remove old trader from memory before reloading on update
- Clean up unused useTraderActions.ts
2025-12-12 16:08:21 +08:00
tinkle-community
f5ae22d85c feat: add debate arena and fix multiple issues
- Add AI debate arena for multi-AI trading decisions
- Fix debate consensus calculation and display
- Fix vote parsing to support both <decision> and <final_vote> tags
- Fix JSON field name compatibility (stop_loss/stop_loss_pct)
- Fix symbol validation to prevent AI hallucinating invalid symbols
- Fix Bybit position side display (was uppercase, now lowercase for consistency)
- Fix NOFX logo navigation to home page
- Add detailed logging for debugging trade execution
2025-12-12 11:24:32 +08:00
tinkle-community
e5703ffab6 feat: add Grok, OpenAI, Claude, Gemini, Kimi AI providers
- Add new MCP clients for Grok (xAI), OpenAI, Claude, Gemini, Kimi
- Update auto_trader, backtest, and strategy to support all providers
- Add provider icons and fix SVG gradient conflicts
- Add API application links and hints in model config modal
- Show model version in AI model list cards
- Add Chinese/English translations for provider hints
- Remove deprecated traders component files
2025-12-11 15:16:59 +08:00
tinkle-community
78b5e73966 fix: competition chart data sync and display issues
- Add real-time data point to equity history API for chart/leaderboard consistency
- Fix chart legend showing 0% by finding each trader's last available data point
- Use consistent timestamp for all real-time data points in batch requests
- Increase chart trader limit from 5 to 10
- Remove Mini Stats Bar trader limit
2025-12-11 12:32:04 +08:00
tinkle-community
438f55bc30 fix: OKX contract size conversion issues
- Fix OpenLong/OpenShort: use quantity/ctVal instead of quantity*price/ctVal
- Fix GetPositions: convert contract count to base asset (posAmt = contracts * ctVal)
- Fix CloseLong/CloseShort: convert base asset to contracts before sending order
- Fix GetOrderStatus: convert executedQty from contracts to base asset
- Fix SetStopLoss/SetTakeProfit/FormatQuantity: same contract conversion fix
2025-12-11 11:17:43 +08:00
tinkle-community
19937ee260 fix: improve trading and UI 2025-12-11 00:47:53 +08:00
tinkle-community
e9e60c82cb fix: further reduce competition screenshot size 2025-12-10 22:05:54 +08:00
tinkle-community
b1664d4178 fix: reduce competition screenshot size 2025-12-10 22:05:19 +08:00
tinkle-community
ecbedc6525 fix: OKX trading issues and improve position tracking
- Add maxMktSz check for OKX market orders to prevent exceeding limits
- Increase margin safety buffer (0.1% fee + 1% buffer) for all exchanges
- Fix Binance position closure detection with direct trade queries
- Move Recent Completed Trades before Current Positions in AI prompt
- Update README screenshots with table layout for better alignment
2025-12-10 22:01:57 +08:00
tinkle-community
870faa0843 fix: only main branch should create latest docker tag 2025-12-10 15:10:18 +08:00
tinkle-community
f6869a3d30 fix: handle zero entry_time in position sync and update gitignore
- Add fallback for zero/invalid entry_time when syncing positions
- Update .gitignore to ignore data/ directory and all .db files
- Remove accidentally committed nofx.db and image files
2025-12-10 15:06:06 +08:00
Maximilian Ford
8f07869d74 docs: complete ja and ko READMEs (#1206) 2025-12-10 14:45:46 +08:00
tinkle-community
319ccb8ca3 fix: initial balance calculation and UI improvements
- Fix initial balance using available_balance instead of total_equity
- Fix WSMonitor nil pointer by starting market monitor before loading traders
- Add strategy name display on traders list and dashboard pages
- Various position sync and trading improvements
2025-12-10 14:40:08 +08:00
tinkle-community
c19ee51dee fix: update docker-compose.yml to use data directory
Changed volume mount from ./data.db:/app/data.db to ./data:/app/data
Removed decision_logs mount (logs now stored in data directory)
2025-12-09 21:32:40 +08:00
tinkle-community
8be44cdf6e fix: return default models and exchanges when database is empty
API now returns default AI models (deepseek, qwen, openai, claude, gemini, grok) and exchanges (binance, bybit, okx, hyperliquid, aster, lighter) when database has no data.
2025-12-09 21:11:51 +08:00
tinkle-community
fa88bac812 feat: write logs to data directory
- Log files are saved to data/nofx_YYYY-MM-DD.log
- Removed decision_logs mount from docker-compose
2025-12-09 20:50:00 +08:00
tinkle-community
94abf1d491 fix: remove problematic volume mount that caused 502 error
The ./data:/app mount was overwriting the entire /app directory
including application binaries, causing the backend to fail.
2025-12-09 20:34:48 +08:00
tinkle-community
0c744c4954 fix: use bind mount instead of named volume for data persistence
- Changed from Docker named volume to bind mount (./data:/app/data)
- Data files now visible in deployment directory (/root/nofx/data/)
- Easier to backup, inspect, and manage data files directly
2025-12-09 20:09:48 +08:00
tinkle-community
32d420dace fix: change database path to data/data.db for Docker volume persistence
- Changed default dbPath from 'data.db' to 'data/data.db'
- This ensures database is stored in /app/data/ which is mounted as Docker volume
- Added automatic creation of data directory if it doesn't exist
- Fixes issue where database was lost on container restart
2025-12-09 20:01:45 +08:00
tinkle-community
e6f4c9a0ef fix: remove FOREIGN KEY constraint from traders table
- Remove FK constraint that was causing 'FOREIGN KEY constraint failed' error
- Add migration to automatically remove FK from existing databases
- FK constraint was problematic when database is reset while user has cached JWT token
2025-12-09 19:52:27 +08:00
tinkle-community
6546264df9 fix: backend respect TRANSPORT_ENCRYPTION config for model/exchange updates 2025-12-09 19:30:00 +08:00
tinkle-community
23277fc39f chore: remove tweets from community section 2025-12-09 19:19:06 +08:00
tinkle-community
8b1cf2e6fe fix: respect transport_encryption setting in API config functions
When TRANSPORT_ENCRYPTION=false, updateModelConfigs and
updateExchangeConfigsEncrypted now send plain JSON instead of
attempting encryption which would fail with an empty public key.
2025-12-09 19:08:04 +08:00
tinkle-community
c720d663f1 feat: add TRANSPORT_ENCRYPTION toggle for easier deployment
- Add TRANSPORT_ENCRYPTION env config (default: false)
- Allow HTTP/IP access when transport encryption is disabled
- Add /api/crypto/config endpoint to expose encryption status
- Update WebCryptoEnvironmentCheck with 'disabled' status
- Update ExchangeConfigModal and AITradersPage to allow form submission when disabled
- Add i18n translations for disabled status (EN/CN)
- Update README with two deployment modes documentation
2025-12-09 18:04:42 +08:00
tinkle-community
5f3797e255 feat: add one-click install and simplify README
- Add docker-compose.prod.yml with env_file support
- Add install.sh with auto-generated encryption keys
- Remove API endpoints and recommendations from README
- Add multi-language links to README
2025-12-09 17:44:45 +08:00
tinkle-community
63ddeec7ba docs: rewrite README with updated features and deployment guide
- Update project description to reflect current AI trading platform
- Rewrite Core Features with 6 key capabilities
- Add complete deployment guide (Docker + manual installation)
- Update all i18n versions (zh-CN, ja, ko, ru, uk, vi)
- Remove outdated JSON config examples
2025-12-09 17:27:38 +08:00
tinkle-community
9fa2432705 feat: improve strategy studio and fix trader deletion bug
- Add strategy export/import functionality to Strategy Studio
- Fix trader deletion not removing from memory (competition page ghost data)
- Simplify TraderConfigViewModal: remove unused fields, show strategy name
- Improve quant data formatting: OI/Netflow multi-timeframe display
- Add configurable OI/Netflow toggles in indicator settings
- Clean up unused frontend components and dead code
2025-12-09 16:46:58 +08:00
tinkle-community
48792907b3 feat: redesign landing page UI and improve header 2025-12-09 13:59:14 +08:00
tinkle-community
4291b80273 fix: filter Area entries from chart legend to show only trader names
Use custom Legend content to filter out entries with raw dataKey (_pnl_pct)
and only display Line entries with proper trader names.
2025-12-08 19:38:36 +08:00
tinkle-community
1e7c756dd7 docs: add new screenshots and update README
- Add dashboard-market-chart.png (market chart view)
- Add dashboard-positions.png (positions view)
- Add dashboard-page.png (full dashboard overview)
- Add strategy-indicators.png (technical indicators config)
- Update competition-page.png with latest UI
- Update README Screenshots section with all 7 images
2025-12-08 18:23:02 +08:00
tinkle-community
30f7113a81 fix: calculate pnl_pct in frontend when backend doesn't return it
Frontend now calculates total_pnl_pct from equity values if the backend
doesn't return this field. This ensures the performance chart displays
correctly regardless of backend version.
2025-12-08 18:08:01 +08:00
tinkle-community
9d6b631cd9 feat: add Web3 punk avatars and official social links
- Add PunkAvatar component for Web3-style trader avatars
- Integrate punk avatars into trader cards and dashboard header
- Add official Twitter/Telegram links to footer with anti-fork protection
- Create branding.ts with Base64 encoded official links
2025-12-08 17:52:11 +08:00
tinkle-community
e55a6a6ff4 feat: fix competition chart with accurate PnL calculation and improved UI
Backend:
- Add GetByID method to TraderStore for fetching trader without userID
- Calculate total_pnl_pct in equity history API using initial_balance
- Falls back to first snapshot equity if initial_balance not set

Frontend (ComparisonChart):
- Redesign with modern UI: gradient fills, glow effects, rounded corners
- Add mini stats bar showing all traders with current PnL
- Improved tooltip with date, time, and trend icons
- Better Y-axis domain calculation ensuring zero is visible
- Bottom stats grid: Leader, Lead PnL, Gap, Data Points
- Use ComposedChart with Area + Line for visual depth
- Animated loading state with spinning indicator
2025-12-08 13:36:52 +08:00
tinkle-community
c6f6d3ba9f feat: auto-restart traders that were running before shutdown
When the program restarts, traders that had is_running=true in the
database will now automatically start. If a trader fails to run,
its status will be updated to false in the database.
2025-12-08 13:19:41 +08:00
tinkle-community
9c53a266c0 feat: redesign indicator editor with required raw klines and improved UX
Backend:
- Add enable_raw_klines field to IndicatorConfig (always true, required)
- Change defaults: disable EMA/MACD/RSI/ATR, keep volume/OI/funding enabled

Frontend:
- Completely redesign IndicatorEditor with 4 clear sections:
  1. Market Data: Raw OHLCV (required, locked) + timeframe selection
  2. Technical Indicators: EMA/MACD/RSI/ATR (optional, AI can calculate)
  3. Market Sentiment: Volume/OI/Funding Rate
  4. Quant Data: External API integration
- Add helpful tips and descriptions in both Chinese and English
- Improve visual hierarchy with section headers and color coding
- Auto-ensure enable_raw_klines is always true
2025-12-08 13:02:51 +08:00
tinkle-community
7a6e6f2d92 fix: preserve AI model API key when updating and add default URLs
Backend:
- Fix AIModelStore.Update to preserve existing API key when new key is empty
  (prevents clearing API key when adding a new model)
- Add default OI Top API URL to strategy config

Frontend:
- Add "Fill Default" buttons for Coin Pool, OI Top, and Quant Data URLs
- Pre-configured default URLs for all data sources
- Users can click to auto-fill with working defaults
2025-12-08 12:58:13 +08:00
tinkle-community
9c1a322901 fix: OI Top API response parsing and quant data URL validation
- Fix OITopAPIResponse struct to use Code int (0=success) instead of Success bool
- Add all response fields from actual API (time_range_param, rank_type, limit)
- Add {symbol} placeholder validation warning in FetchQuantData
- Add API-level validation in strategy create/update to warn about missing {symbol}
2025-12-08 12:49:49 +08:00
tinkle-community
ce3f62cb50 docs: add quant data plugin API documentation 2025-12-08 12:42:26 +08:00
tinkle-community
24717d8589 feat: use OHLCV table format for kline data in AI prompts
- Add KlineBar struct with full OHLCV data and timestamp
- Store complete kline data in TimeframeSeriesData.Klines
- Format klines as readable table with Time, Open, High, Low, Close, Volume
- Mark current (latest) bar for clarity
- Use kline count from strategy config instead of hardcoded 10
- Keep MidPrices/Volume for backward compatibility
- Update both market/data.go and decision/strategy_engine.go formatters
2025-12-08 12:27:27 +08:00