Documentation ¶
Index ¶
- func GetAverageColumnFloat32(cols io.ColumnInterface, srcCols []io.DataShape) (avgCol []float32, err error)
- type Candle
- type CandleMap
- type Candler
- func (ca *Candler) Accum(cols io.ColumnInterface) error
- func (ca *Candler) GetCandle(t time.Time, cndl ...*Candle) *Candle
- func (ca *Candler) GetInitArgs() []io.DataShape
- func (ca *Candler) GetOptionalArgs() []io.DataShape
- func (ca *Candler) GetRequiredArgs() []io.DataShape
- func (ca *Candler) Init(args ...interface{}) error
- func (c Candler) New() (ca *Candler, am *functions.ArgumentMap)
- func (ca *Candler) Output() *io.ColumnSeries
- func (ca *Candler) Reset()
- type EOHLCStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAverageColumnFloat32 ¶
func GetAverageColumnFloat32(cols io.ColumnInterface, srcCols []io.DataShape) (avgCol []float32, err error)
Utility Functions
Types ¶
type Candle ¶
type Candle struct { StartTime time.Time Duration *utils.CandleDuration /* Every candle has OHLC */ EOHLC EOHLCStruct OpenTime, CloseTime time.Time // The time at which the Open and Close prices happened /* Some candles optionally sum quantities like "Volume" from the input columns */ SumMap map[string]float64 // One sum per mapped column Count int64 // Counts the elements incorporated in the Sums /* Does this candle have complete data? Sometimes we can tell... */ Complete bool }
func (*Candle) SerializeToRowData ¶
type Candler ¶
type Candler struct { uda.AggInterface // Input arguments mapping ArgMap *functions.ArgumentMap /* Manages one timeframe, creates candles in that timeframe from input and outputs them on demand. */ MyCD *utils.CandleDuration CMap CandleMap /* We need to keep an ordered list of sum and avg names to ensure ordered output */ SumNames, AvgNames []string // A cache of the column names that are summed and averaged in the candles AccumSumNames []string // Consolidated list of names either summed or averaged }
func NewCandler ¶
CONCRETE - these may be suitable methods for general usage
func (*Candler) Accum ¶
func (ca *Candler) Accum(cols io.ColumnInterface) error
OVERRIDES - these methods should be overridden in a concrete implementation of this class
OVERRIDE THIS METHOD Accum() sends new data to the aggregate
func (*Candler) GetInitArgs ¶
func (*Candler) GetOptionalArgs ¶
func (*Candler) GetRequiredArgs ¶
func (Candler) New ¶
func (c Candler) New() (ca *Candler, am *functions.ArgumentMap)
OVERRIDE THIS METHOD Creates a new candler using the arguments of the specific implementation for inputColumns and optionalInputColumns
func (*Candler) Output ¶
func (ca *Candler) Output() *io.ColumnSeries
Output() returns the currently valid output of this aggregate
type EOHLCStruct ¶
*********************************** Candle ******************************************* - Represents quantities within an interval of time - Always has Open, High, Low, Close prices defined within - Optionally has averaged and summed quantities inside - Has a starting time representing the candle, it begins the interval *********************************** Candle *******************************************