1、主单增加减仓、加仓状态

2、bug修复
This commit is contained in:
2025-02-20 12:00:04 +08:00
parent b132ee879b
commit ade768c28a
13 changed files with 312 additions and 52 deletions

View File

@ -215,3 +215,35 @@ func TestFutOrderPlace(t *testing.T) {
fmt.Println("err:", err)
}
func TestFutureQueryOrder(t *testing.T) {
futureApi := FutRestApi{}
// dsn := "root:root@tcp(192.168.1.12:3306)/go_exchange_single?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
// db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
helper.InitDefaultRedis("192.168.1.12:6379", "", 2)
apiUserInfo, _ := GetApiInfo(49)
order, err := futureApi.GetOrderByOrderSnLoop("TRUMPUSDT", "380211842506555392", apiUserInfo, 3)
if err != nil {
fmt.Println("err:", err)
}
fmt.Println("future order:", order)
}
func TestSpotQueryOrder(t *testing.T) {
spotApi := SpotRestApi{}
// dsn := "root:root@tcp(192.168.1.12:3306)/go_exchange_single?charset=utf8mb4&parseTime=True&loc=Local&timeout=1000ms"
// db, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{})
helper.InitDefaultRedis("192.168.1.12:6379", "", 2)
apiUserInfo, _ := GetApiInfo(49)
order, err := spotApi.GetOrderByOrderSnLoop("ADAUSDT", "380577197825458177", apiUserInfo, 3)
if err != nil {
fmt.Println("err:", err)
}
fmt.Println("spot order:", order)
}