mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
binance: fix futures position
This commit is contained in:
parent
ffd46fd71d
commit
69e03c8428
|
@ -41,7 +41,12 @@ func toGlobalFuturesPositions(futuresPositions []*futures.AccountPosition) types
|
|||
retFuturesPositions := make(types.FuturesPositionMap)
|
||||
for _, futuresPosition := range futuresPositions {
|
||||
retFuturesPositions[futuresPosition.Symbol] = types.FuturesPosition{ // TODO: types.FuturesPosition
|
||||
Isolated: futuresPosition.Isolated,
|
||||
Isolated: futuresPosition.Isolated,
|
||||
AverageCost: fixedpoint.MustNewFromString(futuresPosition.EntryPrice),
|
||||
ApproximateAverageCost: fixedpoint.MustNewFromString(futuresPosition.EntryPrice),
|
||||
Base: fixedpoint.MustNewFromString(futuresPosition.PositionAmt),
|
||||
Quote: fixedpoint.MustNewFromString(futuresPosition.Notional),
|
||||
|
||||
PositionRisk: &types.PositionRisk{
|
||||
Leverage: fixedpoint.MustNewFromString(futuresPosition.Leverage),
|
||||
},
|
||||
|
|
|
@ -257,8 +257,6 @@ type FuturesPosition struct {
|
|||
Isolated bool `json:"isolated"`
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
PositionRisk *PositionRisk
|
||||
|
||||
sync.Mutex
|
||||
}
|
||||
|
||||
func NewPositionFromMarket(market Market) *Position {
|
||||
|
|
Loading…
Reference in New Issue
Block a user