Documentation ¶
Index ¶
- type DB
- func (r *DB) Compress()
- func (r *DB) GetDates() ([]time.Time, error)
- func (r *DB) Insert(ticks []TickData) error
- func (r *DB) LoadAllData() ([]TickData, error)
- func (r *DB) LoadDataForDate(dt time.Time) ([]TickData, error)
- func (r *DB) PlaybackAll(fn PlaybackFunc) error
- func (r *DB) PlaybackDate(dt time.Time, fn PlaybackFunc) error
- func (r *DB) PlaybackToday(fn PlaybackFunc) error
- func (r *DB) RecordStream(s *Socket)
- type DepthItem
- type PlaybackFunc
- type Socket
- type TickData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
DataPath string
}
DB Database
func (*DB) Compress ¶
func (r *DB) Compress()
Compress function compresses data from each date into a single file
func (*DB) LoadAllData ¶
LoadAllData loads all ticks from db
func (*DB) LoadDataForDate ¶
LoadDataForDate loads ticks from the date
func (*DB) PlaybackAll ¶
func (r *DB) PlaybackAll(fn PlaybackFunc) error
PlaybackAll all ticks from db
func (*DB) PlaybackDate ¶
func (r *DB) PlaybackDate(dt time.Time, fn PlaybackFunc) error
PlaybackDate ticks from the date
func (*DB) PlaybackToday ¶
func (r *DB) PlaybackToday(fn PlaybackFunc) error
PlaybackToday all ticks from db
func (*DB) RecordStream ¶
RecordStream starts recording the tick stream in database
type Socket ¶
Socket struct
func ConnectToStream ¶
ConnectToStream connect to a tick stream
func StartStreaming ¶
StartStreaming starts the stream publisher socket
func (*Socket) SubscribeTicks ¶
func (s *Socket) SubscribeTicks() chan interface{}
SubscribeTicks returns the ticks channel
type TickData ¶
type TickData struct { TradingSymbol string IsTradable bool Timestamp time.Time LastTradeTime time.Time LastPrice float32 LastTradedQuantity uint32 AverageTradePrice float32 VolumeTraded uint32 TotalBuyQuantity uint32 TotalSellQuantity uint32 DayOpen float32 DayHighPrice float32 DayLowPrice float32 LastDayClose float32 OI uint32 OIDayHigh uint32 OIDayLow uint32 Bid [5]DepthItem Ask [5]DepthItem }
TickData into .tck. symstr +16 len bytes
Click to show internal directories.
Click to hide internal directories.