|
@@ -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
|
|
|
+}
|