mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 17:34:39 +08:00
feat: simplify Claw402 autopilot trading flow
This commit is contained in:
@@ -2,41 +2,41 @@ package store
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestDefaultHyperliquidStrategyDoesNotEnableNofxOSData(t *testing.T) {
|
||||
func TestDefaultVergexStrategyDoesNotEnableNofxOSData(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
assertHyperliquidStockRankDefault(t, cfg)
|
||||
assertVergexSignalDefault(t, cfg)
|
||||
ind := cfg.Indicators
|
||||
if ind.NofxOSAPIKey != "" {
|
||||
t.Fatalf("default should not include a NofxOS API key for Hyperliquid strategies")
|
||||
t.Fatalf("default should not include a NofxOS API key for Claw402/Vergex strategies")
|
||||
}
|
||||
if ind.EnableQuantData || ind.EnableQuantOI || ind.EnableQuantNetflow || ind.EnableOIRanking || ind.EnableNetFlowRanking || ind.EnablePriceRanking {
|
||||
t.Fatalf("default Hyperliquid strategy must not enable NofxOS datasets: %+v", ind)
|
||||
t.Fatalf("default Claw402/Vergex strategy must not enable NofxOS datasets: %+v", ind)
|
||||
}
|
||||
if !ind.EnableRawKlines {
|
||||
t.Fatalf("raw Hyperliquid klines must stay enabled")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHyperliquidRankDefaultSurvivesClampAndNormalize(t *testing.T) {
|
||||
func TestVergexSignalDefaultSurvivesClampAndNormalize(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
cfg.CoinSource.UseAI500 = true
|
||||
cfg.ClampLimits()
|
||||
assertHyperliquidStockRankDefault(t, cfg)
|
||||
assertVergexSignalDefault(t, cfg)
|
||||
if cfg.CoinSource.UseAI500 {
|
||||
t.Fatalf("Hyperliquid rank strategy must clear stale AI500 flag: %+v", cfg.CoinSource)
|
||||
t.Fatalf("Claw402/Vergex signal strategy must clear stale AI500 flag: %+v", cfg.CoinSource)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmptyCoinSourceInfersHyperliquidRankNotAI500(t *testing.T) {
|
||||
func TestEmptyCoinSourceInfersVergexSignalNotAI500(t *testing.T) {
|
||||
cfg := GetDefaultStrategyConfig("zh")
|
||||
cfg.CoinSource = CoinSourceConfig{}
|
||||
cfg.NormalizeProductSchema()
|
||||
assertHyperliquidStockRankDefault(t, cfg)
|
||||
assertVergexSignalDefault(t, cfg)
|
||||
}
|
||||
|
||||
func assertHyperliquidStockRankDefault(t *testing.T, cfg StrategyConfig) {
|
||||
func assertVergexSignalDefault(t *testing.T, cfg StrategyConfig) {
|
||||
t.Helper()
|
||||
if cfg.CoinSource.SourceType != "hyper_rank" || cfg.CoinSource.HyperRankCategory != "stock" || cfg.CoinSource.HyperRankDirection != "gainers" || cfg.CoinSource.HyperRankLimit != 5 {
|
||||
t.Fatalf("coin source = %+v, want Hyperliquid dynamic stock gainers top 5", cfg.CoinSource)
|
||||
if cfg.CoinSource.SourceType != "vergex_signal" || cfg.CoinSource.VergexLimit != 10 || cfg.CoinSource.VergexMarketType != "all" || cfg.CoinSource.VergexChain != "hyperliquid" {
|
||||
t.Fatalf("coin source = %+v, want Claw402/Vergex all-market signal top 10", cfg.CoinSource)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user