mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +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{
|
||||
MakerCommission: config.Account.MakerCommission,
|
||||
TakerCommission: config.Account.TakerCommission,
|
||||
MakerFeeRate: config.Account.MakerFeeRate,
|
||||
TakerFeeRate: config.Account.TakerFeeRate,
|
||||
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) {
|
||||
account := &types.Account{
|
||||
MakerCommission: 15,
|
||||
TakerCommission: 15,
|
||||
MakerFeeRate: fixedpoint.NewFromFloat(0.075 * 0.01),
|
||||
TakerFeeRate: fixedpoint.NewFromFloat(0.075 * 0.01),
|
||||
}
|
||||
|
||||
account.UpdateBalances(types.BalanceMap{
|
||||
|
|
|
@ -119,6 +119,10 @@ func (t Backtest) ParseStartTime() (time.Time, error) {
|
|||
}
|
||||
|
||||
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"`
|
||||
TakerCommission fixedpoint.Value `json:"takerCommission"`
|
||||
BuyerCommission int `json:"buyerCommission"`
|
||||
|
|
|
@ -2,13 +2,14 @@ package types
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/slack-go/slack"
|
||||
"math"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/slack-go/slack"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
|
@ -183,13 +184,14 @@ func (m BalanceMap) Print() {
|
|||
type Account struct {
|
||||
sync.Mutex `json:"-"`
|
||||
|
||||
// bps. 0.15% fee will be 15.
|
||||
MakerCommission fixedpoint.Value `json:"makerCommission,omitempty"`
|
||||
TakerCommission fixedpoint.Value `json:"takerCommission,omitempty"`
|
||||
AccountType string `json:"accountType,omitempty"`
|
||||
|
||||
MakerFeeRate fixedpoint.Value `json:"makerFeeRate,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"`
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user