Documentation
¶
Index ¶
- type Base
- func (b *Base) AppendStream(s ...common.DataEventHandler)
- func (b *Base) GetStream() []common.DataEventHandler
- func (b *Base) History() []common.DataEventHandler
- func (b *Base) Latest() common.DataEventHandler
- func (b *Base) List() []common.DataEventHandler
- func (b *Base) Next() (dh common.DataEventHandler)
- func (b *Base) Offset() int
- func (b *Base) Reset()
- func (b *Base) SetStream(s []common.DataEventHandler)
- func (b *Base) SortStream()
- type Handler
- type HandlerPerCurrency
- func (h *HandlerPerCurrency) GetAllData() map[string]map[asset.Item]map[currency.Pair]Handler
- func (h *HandlerPerCurrency) GetDataForCurrency(e string, a asset.Item, p currency.Pair) Handler
- func (h *HandlerPerCurrency) Reset()
- func (h *HandlerPerCurrency) SetDataForCurrency(e string, a asset.Item, p currency.Pair, k Handler)
- func (h *HandlerPerCurrency) Setup()
- type Holder
- type Loader
- type Streamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is the base implementation of some interface functions where further specific functions are implmented in DataFromKline
func (*Base) AppendStream ¶
func (b *Base) AppendStream(s ...common.DataEventHandler)
AppendStream appends new datas onto the stream, however, will not add duplicates. Used for live analysis
func (*Base) GetStream ¶
func (b *Base) GetStream() []common.DataEventHandler
GetStream will return entire data list
func (*Base) History ¶
func (b *Base) History() []common.DataEventHandler
History will return all previous data events that have happened
func (*Base) Latest ¶
func (b *Base) Latest() common.DataEventHandler
Latest will return latest data event
func (*Base) List ¶
func (b *Base) List() []common.DataEventHandler
List returns all future data events from the current iteration ill-advised to use this in strategies because you don't know the future in real life
func (*Base) Next ¶
func (b *Base) Next() (dh common.DataEventHandler)
Next will return the next event in the list and also shift the offset one
func (*Base) Offset ¶
Offset returns the current iteration of candle data the backtester is assessing
func (*Base) SetStream ¶
func (b *Base) SetStream(s []common.DataEventHandler)
SetStream sets the data stream for candle analysis
type HandlerPerCurrency ¶
type HandlerPerCurrency struct {
// contains filtered or unexported fields
}
HandlerPerCurrency stores an event handler per exchange asset pair
func (*HandlerPerCurrency) GetAllData ¶
GetAllData returns all set data in the data map
func (*HandlerPerCurrency) GetDataForCurrency ¶
GetDataForCurrency returns the Handler for a specific exchange, asset, currency
func (*HandlerPerCurrency) Reset ¶
func (h *HandlerPerCurrency) Reset()
Reset returns the struct to defaults
func (*HandlerPerCurrency) SetDataForCurrency ¶
SetDataForCurrency assigns a data Handler to the data map by exchange, asset and currency
type Holder ¶
type Holder interface {
Setup()
SetDataForCurrency(string, asset.Item, currency.Pair, Handler)
GetAllData() map[string]map[asset.Item]map[currency.Pair]Handler
GetDataForCurrency(string, asset.Item, currency.Pair) Handler
Reset()
}
Holder interface dictates what a data holder is expected to do
type Loader ¶
type Loader interface {
Load() error
}
Loader interface for Loading data into backtest supported format
type Streamer ¶
type Streamer interface {
Next() common.DataEventHandler
GetStream() []common.DataEventHandler
History() []common.DataEventHandler
Latest() common.DataEventHandler
List() []common.DataEventHandler
Offset() int
StreamOpen() []decimal.Decimal
StreamHigh() []decimal.Decimal
StreamLow() []decimal.Decimal
StreamClose() []decimal.Decimal
StreamVol() []decimal.Decimal
HasDataAtTime(time.Time) bool
}
Streamer interface handles loading, parsing, distributing BackTest data