Alexey Kim пре 6 месеци
родитељ
комит
1933cc24c0
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      position.go

+ 8 - 0
position.go

@@ -9,12 +9,16 @@ type Position interface {
 
 	// GetSymbol returns the ticker symbol of the traded contract
 	GetSymbol() string
+
+	// GetPnL unrealized profit/loss in dollars
+	GetPnL() float64
 }
 
 type PositionStub struct {
 	Symbol string
 	Size   float64
 	Price  float64
+	PnL    float64
 }
 
 func (p PositionStub) GetSize() float64 {
@@ -28,3 +32,7 @@ func (p PositionStub) GetAvgPrice() float64 {
 func (p PositionStub) GetSymbol() string {
 	return p.Symbol
 }
+
+func (p PositionStub) GetPnL() float64 {
+	return p.PnL
+}