Documentation ¶
Index ¶
- Variables
- func GetCsv(file string) (*csv.Reader, error)
- func GetPreviousIntervalDates(date time.Time, intervalDuration int) (time.Time, time.Time)
- type FileTickerCollector
- func (ftc *FileTickerCollector) GetTicker(tickerSymbol string) (float32, error)
- func (ftc *FileTickerCollector) Regist(observable domain.OnNewAssetPrice)
- func (ftc *FileTickerCollector) SetIndicators(indicators *[]domain.Indicator)
- func (ftc *FileTickerCollector) Start()
- func (ftc *FileTickerCollector) Stop()
- type KrakenCollector
- func (kc *KrakenCollector) GetTicker(tickerSymbol string) (float32, error)
- func (kc *KrakenCollector) PublishAssetPrice(ohlc *domain.OHLC) error
- func (kc *KrakenCollector) Regist(observable domain.OnNewAssetPrice)
- func (kc *KrakenCollector) SetIndicators(indicators *[]domain.Indicator)
- func (kc *KrakenCollector) Start()
- func (kc *KrakenCollector) Stop()
- type SocketEvent
- type TickerMessage
Constants ¶
This section is empty.
Variables ¶
var Pairs = map[string]string{
"BTC": "XBT/EUR",
"ETH": "ETH/EUR",
"ADA": "ADA/EUR",
"ATOM": "ATOM/EUR",
"DOT": "DOT/EUR",
}
Functions ¶
Types ¶
type FileTickerCollector ¶
type FileTickerCollector struct {
// contains filtered or unexported fields
}
FileTickerCollector collects data from a csv file
func NewFileTickerCollector ¶
func NewFileTickerCollector(options domain.CollectorOptions, indicators *[]domain.Indicator) *FileTickerCollector
NewFileTickerCollector returns an instance of FileTickerCollector
func (*FileTickerCollector) GetTicker ¶
func (ftc *FileTickerCollector) GetTicker(tickerSymbol string) (float32, error)
GetTicker is a stub
func (*FileTickerCollector) Regist ¶
func (ftc *FileTickerCollector) Regist(observable domain.OnNewAssetPrice)
Regist add function to be executed when a new price is received
func (*FileTickerCollector) SetIndicators ¶
func (ftc *FileTickerCollector) SetIndicators(indicators *[]domain.Indicator)
func (*FileTickerCollector) Start ¶
func (ftc *FileTickerCollector) Start()
Start starts collecting data from data source
type KrakenCollector ¶
type KrakenCollector struct {
// contains filtered or unexported fields
}
KrakenCollector collects data from kraken exchange
func NewKrakenCollector ¶
func NewKrakenCollector(asset string, options domain.CollectorOptions, krakenAPI *krakenapi.KrakenAPI, indicators *[]domain.Indicator) *KrakenCollector
NewKrakenCollector returns an instance of KrakenCollector
func (*KrakenCollector) GetTicker ¶
func (kc *KrakenCollector) GetTicker(tickerSymbol string) (float32, error)
GetTicker calls kraken API to get ticker pair price
func (*KrakenCollector) PublishAssetPrice ¶
func (kc *KrakenCollector) PublishAssetPrice(ohlc *domain.OHLC) error
func (*KrakenCollector) Regist ¶
func (kc *KrakenCollector) Regist(observable domain.OnNewAssetPrice)
Regist add function to be executed when ticker price changes
func (*KrakenCollector) SetIndicators ¶
func (kc *KrakenCollector) SetIndicators(indicators *[]domain.Indicator)
SetIndicators set indicators that listen for price changes
func (*KrakenCollector) Start ¶
func (kc *KrakenCollector) Start()
Start connects to a kraken websocket that send prices variations
func (*KrakenCollector) Stop ¶
func (kc *KrakenCollector) Stop()
Stop closes connection with kraken websocket
type SocketEvent ¶
type SocketEvent struct {
Event string
}
SocketEvent is a type used to decode kraken websocket messages
type TickerMessage ¶
type TickerMessage struct { A []interface{} B []interface{} V []interface{} }
TickerMessage is a type used to decode messages of ticker price change events