mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-02 02:21:19 +08:00
- Redesign dashboard into a cream-paper + vermilion IBM Plex Mono terminal (live L2 order book, cost/liq map, WS K-line, signal matrix, orchestration topology, risk radar, execution log, current positions, equity curve) - Convert all user-facing UI and backend strings/prompts from Chinese to English (multi-language retained, default English) - Add /api/statistics/full endpoint + full-stats frontend wiring - Fix Autopilot launch: reuse the existing trader instead of creating duplicates (eliminates repeat ~35s create cost and stale-trader 404s); launch sends 5m scan interval - Fix unreadable toasts: cream theme with high-contrast text + per-type accent - Silence background dashboard polls (getTraderConfig) to stop error-toast spam
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package kernel
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"nofx/provider/vergex"
|
|
)
|
|
|
|
func TestDirectionalCandidates(t *testing.T) {
|
|
e := &StrategyEngine{
|
|
vergexRankingCache: map[string]*vergex.SignalRankItem{
|
|
"xyz:NVDA": {Symbol: "xyz:NVDA", Bias: "bullish", Rank: 2},
|
|
"xyz:AAPL": {Symbol: "xyz:AAPL", Bias: "bullish", Rank: 1},
|
|
"BTC": {Symbol: "BTC", Bias: "bearish", Rank: 3},
|
|
"ETH": {Symbol: "ETH", Bias: "bearish", Rank: 1},
|
|
"SOL": {Symbol: "SOL", Bias: "neutral", Rank: 1},
|
|
},
|
|
}
|
|
|
|
bull, bear := e.DirectionalCandidates()
|
|
|
|
if len(bull) != 2 || bull[0] != "xyz:AAPL" || bull[1] != "xyz:NVDA" {
|
|
t.Fatalf("bullish should be rank-ordered [xyz:AAPL xyz:NVDA], got %v", bull)
|
|
}
|
|
if len(bear) != 2 || bear[0] != "ETH" || bear[1] != "BTC" {
|
|
t.Fatalf("bearish should be rank-ordered [ETH BTC], got %v", bear)
|
|
}
|
|
}
|
|
|
|
func TestDirectionalCandidatesEmpty(t *testing.T) {
|
|
e := &StrategyEngine{}
|
|
bull, bear := e.DirectionalCandidates()
|
|
if len(bull) != 0 || len(bear) != 0 {
|
|
t.Fatalf("empty cache should yield no candidates, got %v %v", bull, bear)
|
|
}
|
|
}
|