move packages

This commit is contained in:
c9s 2020-10-05 14:25:58 +08:00
parent 9cc4505594
commit 3989531788
56 changed files with 56 additions and 58 deletions

View File

@ -6,7 +6,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
type ProfitAndLossCalculator struct {

View File

@ -7,8 +7,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/slack-go/slack"
"github.com/c9s/bbgo/pkg/bbgo/slack/slackstyle"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/slack/slackstyle"
"github.com/c9s/bbgo/types"
)
type ProfitAndLossReport struct {

View File

@ -4,9 +4,9 @@ import (
"context"
"sync"
"github.com/c9s/bbgo/pkg/bbgo/exchange/binance"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/exchange/binance"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
log "github.com/sirupsen/logrus"
)

View File

@ -3,8 +3,8 @@ package bbgo
import (
"sync"
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/accounting"
"github.com/c9s/bbgo/types"
)
type Context struct {

View File

@ -4,7 +4,7 @@ import (
"math"
"time"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
type MovingAverageIndicator struct {

View File

@ -4,7 +4,7 @@ package bbgo
import (
"testing"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
func TestCalculateMovingAverage(t *testing.T) {

View File

@ -6,9 +6,9 @@ import (
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/accounting"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
type BackTestStream struct {

View File

@ -3,7 +3,7 @@
package bbgo
import (
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
func (store *MarketDataStore) OnUpdate(cb KLineCallback) {

View File

@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
var (

View File

@ -1,8 +1,8 @@
package bbgo
import (
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/accounting"
"github.com/c9s/bbgo/types"
)
type Notifier interface {

View File

@ -2,12 +2,13 @@ package bbgo
import (
"fmt"
"github.com/c9s/bbgo/pkg/bbgo/types"
"math"
"sort"
"strconv"
"strings"
"sync"
"github.com/c9s/bbgo/types"
)
func zero(a float64) bool {

View File

@ -2,10 +2,12 @@ package bbgo
import (
"encoding/json"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/stretchr/testify/assert"
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
"github.com/c9s/bbgo/types"
)
func TestStockManager(t *testing.T) {

View File

@ -1,7 +1,7 @@
package bbgo
import (
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
type Interval string

View File

@ -10,11 +10,11 @@ import (
"github.com/jmoiron/sqlx"
log "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/config"
"github.com/c9s/bbgo/pkg/bbgo/exchange/binance"
"github.com/c9s/bbgo/pkg/bbgo/service"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/accounting"
"github.com/c9s/bbgo/bbgo/config"
"github.com/c9s/bbgo/exchange/binance"
"github.com/c9s/bbgo/service"
"github.com/c9s/bbgo/types"
)
// MarketStrategy represents the single Exchange strategy

View File

@ -2,8 +2,6 @@
package binance
import ()
func (f *DepthFrame) OnReady(cb func(snapshotDepth DepthEvent, bufEvents []DepthEvent)) {
f.readyCallbacks = append(f.readyCallbacks, cb)
}

View File

@ -10,8 +10,8 @@ import (
"github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
var log = logrus.WithFields(logrus.Fields{

View File

@ -9,9 +9,9 @@ import (
"github.com/adshao/go-binance"
"github.com/valyala/fastjson"
"github.com/c9s/bbgo/pkg/bbgo/fixedpoint"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/fixedpoint"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
/*

View File

@ -7,12 +7,12 @@ import (
"sync"
"time"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/util"
"github.com/adshao/go-binance"
"github.com/gorilla/websocket"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
type StreamRequest struct {

View File

@ -2,8 +2,6 @@
package binance
import ()
func (s *Stream) OnConnect(cb func(stream *Stream)) {
s.connectCallbacks = append(s.connectCallbacks, cb)
}

View File

@ -7,8 +7,8 @@ import (
"github.com/pkg/errors"
"github.com/valyala/fastjson"
"github.com/c9s/bbgo/pkg/bbgo/fixedpoint"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/fixedpoint"
"github.com/c9s/bbgo/types"
)
var ErrIncorrectBookEntryElementLength = errors.New("incorrect book entry element length")

View File

@ -4,8 +4,8 @@ import (
"github.com/pkg/errors"
"github.com/valyala/fastjson"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
type BaseEvent struct {

View File

@ -5,8 +5,8 @@ import (
log "github.com/sirupsen/logrus"
max "github.com/c9s/bbgo/pkg/bbgo/exchange/max/maxapi"
"github.com/c9s/bbgo/pkg/bbgo/types"
max "github.com/c9s/bbgo/exchange/max/maxapi"
"github.com/c9s/bbgo/types"
)
var logger = log.WithField("exchange", "max")

View File

@ -8,9 +8,9 @@ import (
"github.com/sirupsen/logrus"
"github.com/slack-go/slack"
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/accounting"
"github.com/c9s/bbgo/types"
"github.com/c9s/bbgo/util"
)
type SlackAttachmentCreator interface {

View File

@ -8,7 +8,7 @@ import (
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/bbgo/types"
"github.com/c9s/bbgo/types"
)
type TradeSync struct {

View File

@ -7,7 +7,7 @@ import (
"github.com/slack-go/slack"
"github.com/c9s/bbgo/pkg/util"
"github.com/c9s/bbgo/util"
)
type KLineOrWindow interface {

View File

@ -1,6 +1,7 @@
package types
import ("testing"
import (
"testing"
"github.com/stretchr/testify/assert"
)

View File

@ -5,8 +5,8 @@ import (
"sort"
"sync"
"github.com/c9s/bbgo/pkg/bbgo/fixedpoint"
"github.com/c9s/bbgo/pkg/bbgo/sigchan"
"github.com/c9s/bbgo/fixedpoint"
"github.com/c9s/bbgo/sigchan"
)
type PriceVolume struct {

View File

@ -2,8 +2,6 @@
package types
import ()
func (b *OrderBook) OnLoad(cb func(book *OrderBook)) {
b.loadCallbacks = append(b.loadCallbacks, cb)
}

View File

@ -2,8 +2,6 @@
package types
import ()
func (stream *StandardStream) OnTrade(cb func(trade *Trade)) {
stream.tradeCallbacks = append(stream.tradeCallbacks, cb)
}

View File

@ -2,9 +2,11 @@ package types
import (
"fmt"
"github.com/c9s/bbgo/pkg/util"
"github.com/slack-go/slack"
"time"
"github.com/slack-go/slack"
"github.com/c9s/bbgo/util"
)
type Trade struct {