mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
twap: rename constructor
This commit is contained in:
parent
ebaf3a330f
commit
a06b63c897
|
@ -161,7 +161,7 @@ var executeOrderCmd = &cobra.Command{
|
|||
return fmt.Errorf("market %s not found", symbol)
|
||||
}
|
||||
|
||||
executor := twap.NewStreamExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)
|
||||
executor := twap.NewFixedQuantityExecutor(session.Exchange, symbol, market, side, targetQuantity, sliceQuantity)
|
||||
|
||||
if updateInterval > 0 {
|
||||
executor.SetUpdateInterval(updateInterval)
|
||||
|
|
|
@ -74,7 +74,7 @@ type FixedQuantityExecutor struct {
|
|||
done *DoneSignal
|
||||
}
|
||||
|
||||
func NewStreamExecutor(
|
||||
func NewFixedQuantityExecutor(
|
||||
exchange types.Exchange,
|
||||
symbol string,
|
||||
market types.Market,
|
||||
|
|
|
@ -170,7 +170,7 @@ func TestNewStreamExecutor(t *testing.T) {
|
|||
}
|
||||
mockEx.EXPECT().SubmitOrder(gomock.AssignableToTypeOf(ctx), firstSubmitOrder).Return(&firstOrder, nil)
|
||||
|
||||
executor := NewStreamExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
|
||||
executor := NewFixedQuantityExecutor(mockEx, symbol, market, types.SideTypeBuy, targetQuantity, sliceQuantity)
|
||||
executor.SetUpdateInterval(200 * time.Millisecond)
|
||||
|
||||
go func() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user