mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +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)
|
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 {
|
if updateInterval > 0 {
|
||||||
executor.SetUpdateInterval(updateInterval)
|
executor.SetUpdateInterval(updateInterval)
|
||||||
|
|
|
@ -74,7 +74,7 @@ type FixedQuantityExecutor struct {
|
||||||
done *DoneSignal
|
done *DoneSignal
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStreamExecutor(
|
func NewFixedQuantityExecutor(
|
||||||
exchange types.Exchange,
|
exchange types.Exchange,
|
||||||
symbol string,
|
symbol string,
|
||||||
market types.Market,
|
market types.Market,
|
||||||
|
|
|
@ -170,7 +170,7 @@ func TestNewStreamExecutor(t *testing.T) {
|
||||||
}
|
}
|
||||||
mockEx.EXPECT().SubmitOrder(gomock.AssignableToTypeOf(ctx), firstSubmitOrder).Return(&firstOrder, nil)
|
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)
|
executor.SetUpdateInterval(200 * time.Millisecond)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user