|
@@ -10,15 +10,19 @@ type Position interface {
|
|
|
// GetSymbol returns the ticker symbol of the traded contract
|
|
|
GetSymbol() string
|
|
|
|
|
|
- // GetPnL unrealized profit/loss in dollars
|
|
|
+ // GetPnL returns unrealized profit/loss in dollars
|
|
|
GetPnL() float64
|
|
|
+
|
|
|
+ // GetCurrentPrice returns current asset price per share
|
|
|
+ GetCurrentPrice() float64
|
|
|
}
|
|
|
|
|
|
type PositionStub struct {
|
|
|
- Symbol string
|
|
|
- Size float64
|
|
|
- Price float64
|
|
|
- PnL float64
|
|
|
+ Symbol string
|
|
|
+ Size float64
|
|
|
+ Price float64
|
|
|
+ PnL float64
|
|
|
+ Current float64
|
|
|
}
|
|
|
|
|
|
func (p PositionStub) GetSize() float64 {
|
|
@@ -36,3 +40,7 @@ func (p PositionStub) GetSymbol() string {
|
|
|
func (p PositionStub) GetPnL() float64 {
|
|
|
return p.PnL
|
|
|
}
|
|
|
+
|
|
|
+func (p PositionStub) GetCurrentPrice() float64 {
|
|
|
+ return p.Current
|
|
|
+}
|