mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
realign account fields
This commit is contained in:
parent
44d7055809
commit
f692ef2c31
|
@ -90,8 +90,8 @@ func NewExchange(sourceName types.ExchangeName, srv *service.BacktestService, co
|
||||||
}
|
}
|
||||||
|
|
||||||
account := &types.Account{
|
account := &types.Account{
|
||||||
MakerCommission: config.Account.MakerCommission,
|
MakerFeeRate: config.Account.MakerFeeRate,
|
||||||
TakerCommission: config.Account.TakerCommission,
|
TakerFeeRate: config.Account.TakerFeeRate,
|
||||||
AccountType: "SPOT", // currently not used
|
AccountType: "SPOT", // currently not used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ func newLimitOrder(symbol string, side types.SideType, price, quantity float64)
|
||||||
|
|
||||||
func TestSimplePriceMatching_LimitOrder(t *testing.T) {
|
func TestSimplePriceMatching_LimitOrder(t *testing.T) {
|
||||||
account := &types.Account{
|
account := &types.Account{
|
||||||
MakerCommission: 15,
|
MakerFeeRate: fixedpoint.NewFromFloat(0.075 * 0.01),
|
||||||
TakerCommission: 15,
|
TakerFeeRate: fixedpoint.NewFromFloat(0.075 * 0.01),
|
||||||
}
|
}
|
||||||
|
|
||||||
account.UpdateBalances(types.BalanceMap{
|
account.UpdateBalances(types.BalanceMap{
|
||||||
|
|
|
@ -119,6 +119,10 @@ func (t Backtest) ParseStartTime() (time.Time, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type BacktestAccount struct {
|
type BacktestAccount struct {
|
||||||
|
// TODO: MakerFeeRate should replace the commission fields
|
||||||
|
MakerFeeRate fixedpoint.Value `json:"makerFeeRate"`
|
||||||
|
TakerFeeRate fixedpoint.Value `json:"takerFeeRate"`
|
||||||
|
|
||||||
MakerCommission fixedpoint.Value `json:"makerCommission"`
|
MakerCommission fixedpoint.Value `json:"makerCommission"`
|
||||||
TakerCommission fixedpoint.Value `json:"takerCommission"`
|
TakerCommission fixedpoint.Value `json:"takerCommission"`
|
||||||
BuyerCommission int `json:"buyerCommission"`
|
BuyerCommission int `json:"buyerCommission"`
|
||||||
|
|
|
@ -2,13 +2,14 @@ package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/slack-go/slack"
|
|
||||||
"math"
|
"math"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/slack-go/slack"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
@ -183,13 +184,14 @@ func (m BalanceMap) Print() {
|
||||||
type Account struct {
|
type Account struct {
|
||||||
sync.Mutex `json:"-"`
|
sync.Mutex `json:"-"`
|
||||||
|
|
||||||
// bps. 0.15% fee will be 15.
|
AccountType string `json:"accountType,omitempty"`
|
||||||
MakerCommission fixedpoint.Value `json:"makerCommission,omitempty"`
|
|
||||||
TakerCommission fixedpoint.Value `json:"takerCommission,omitempty"`
|
|
||||||
|
|
||||||
MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"`
|
MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"`
|
||||||
TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"`
|
TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"`
|
||||||
AccountType string `json:"accountType,omitempty"`
|
|
||||||
|
// bps. 0.15% fee will be 15.
|
||||||
|
MakerCommission fixedpoint.Value `json:"makerCommission,omitempty"`
|
||||||
|
TakerCommission fixedpoint.Value `json:"takerCommission,omitempty"`
|
||||||
|
|
||||||
TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"`
|
TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user