mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: pull out quote investment variable
This commit is contained in:
parent
d1cbc6a9ca
commit
79f9f9c5bb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user