xmaker: fix trade window test

This commit is contained in:
c9s 2024-10-16 15:55:55 +08:00
parent c066a187d9
commit 4f1b216fbf
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -46,9 +46,7 @@ func TestMarketTradeWindowSignal(t *testing.T) {
ctx := context.Background()
sigNum, err := sig.CalculateSignal(ctx)
if assert.NoError(t, err) {
// buy ratio: 1/1.5 = 0.6666666666666666
// sell ratio: 0.5/1.5 = 0.3333333333333333
assert.InDelta(t, 0.0083333, sigNum, 0.0001)
assert.InDelta(t, 1.3333333, sigNum, 0.0001)
}
assert.Len(t, sig.trades, 2)