2
0

position.go 573 B

123456789101112131415161718192021222324252627282930
  1. package sentio
  2. type Position interface {
  3. // GetSize returns the total size of the position
  4. GetSize() float64
  5. // GetAvgPrice returns the average cost of each share in the position when purchased
  6. GetAvgPrice() float64
  7. // GetSymbol returns the ticker symbol of the traded contract
  8. GetSymbol() string
  9. }
  10. type PositionStub struct {
  11. Symbol string
  12. Size float64
  13. Price float64
  14. }
  15. func (p PositionStub) GetSize() float64 {
  16. return p.Size
  17. }
  18. func (p PositionStub) GetAvgPrice() float64 {
  19. return p.Price
  20. }
  21. func (p PositionStub) GetSymbol() string {
  22. return p.Symbol
  23. }