Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Snapshots []Snapshot
}
Manager holds a snapshot of all orders at each timeperiod, allowing study of all changes across time
func (*Manager) AddSnapshot ¶
func (m *Manager) AddSnapshot(orders []SnapshotOrder, t time.Time, offset int64, overwriteExisting bool) error
AddSnapshot creates a snapshot in time of the orders placed to allow for finer detail tracking and to protect against anything modifying order details elsewhere
func (*Manager) GetLatestSnapshot ¶
GetLatestSnapshot returns the snapshot of t - 1 interval
type Snapshot ¶
type Snapshot struct { Orders []SnapshotOrder `json:"orders"` Timestamp time.Time `json:"timestamp"` Offset int64 `json:"offset"` }
Snapshot consists of the timestamp the snapshot is from, along with all orders made up until that time
type SnapshotOrder ¶
type SnapshotOrder struct { ClosePrice float64 `json:"close-price"` VolumeAdjustedPrice float64 `json:"volume-adjusted-price"` SlippageRate float64 `json:"slippage-rate"` CostBasis float64 `json:"cost-basis"` *order.Detail `json:"order-detail"` }
SnapshotOrder adds some additional data that's only relevant for backtesting to the order.Detail without adding to order.Detail
Click to show internal directories.
Click to hide internal directories.