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 ¶
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 { Offset int64 `json:"offset"` Timestamp time.Time `json:"timestamp"` Orders []SnapshotOrder `json:"orders"` }
Snapshot consists of the timestamp the snapshot is from, along with all orders made up until that time
type SnapshotOrder ¶
type SnapshotOrder struct { ClosePrice decimal.Decimal `json:"close-price"` VolumeAdjustedPrice decimal.Decimal `json:"volume-adjusted-price"` SlippageRate decimal.Decimal `json:"slippage-rate"` CostBasis decimal.Decimal `json:"cost-basis"` Order *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.