From 79f9f9c5bb111d67ad99e37673bfd15a238d1481 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 15 Feb 2023 15:41:20 +0800 Subject: [PATCH] grid2: pull out quote investment variable --- pkg/strategy/grid2/strategy_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/grid2/strategy_test.go b/pkg/strategy/grid2/strategy_test.go index 216d65931..29346932d 100644 --- a/pkg/strategy/grid2/strategy_test.go +++ b/pkg/strategy/grid2/strategy_test.go @@ -226,7 +226,8 @@ func TestStrategy_calculateQuoteInvestmentQuantity(t *testing.T) { // q = 0.2 s := newTestStrategy() lastPrice := number(13_500.0) - quantity, err := s.calculateQuoteInvestmentQuantity(number(12_000.0), lastPrice, []Pin{ + quoteInvestment := number(12_000.0) + quantity, err := s.calculateQuoteInvestmentQuantity(quoteInvestment, lastPrice, []Pin{ Pin(number(10_000.0)), // buy Pin(number(11_000.0)), // buy Pin(number(12_000.0)), // buy @@ -263,7 +264,8 @@ func TestStrategy_calculateQuoteInvestmentQuantity(t *testing.T) { s := newTestStrategy() s.ProfitSpread = number(2000.0) lastPrice := number(13_500.0) - quantity, err := s.calculateQuoteInvestmentQuantity(number(7500.0), lastPrice, []Pin{ + quoteInvestment := number(7500.0) + quantity, err := s.calculateQuoteInvestmentQuantity(quoteInvestment, lastPrice, []Pin{ Pin(number(10_000.0)), // sell order @ 12_000 Pin(number(11_000.0)), // sell order @ 13_000 Pin(number(12_000.0)), // sell order @ 14_000