mirror of
https://github.com/lukewilson2002/autotrader.git
synced 2025-06-15 08:23:51 +00:00
Reordered interface items
This commit is contained in:
parent
fae70079dd
commit
02799477a5
56
data.go
56
data.go
@ -29,32 +29,47 @@ func EasyIndex(i, n int) int {
|
|||||||
type Series interface {
|
type Series interface {
|
||||||
Signaler
|
Signaler
|
||||||
|
|
||||||
|
// Reading data.
|
||||||
Copy(start, end int) Series
|
Copy(start, end int) Series
|
||||||
Name() string // Name returns the immutable name of the Series.
|
|
||||||
SetName(name string) Series
|
|
||||||
Len() int
|
Len() int
|
||||||
|
Name() string // Name returns the immutable name of the Series.
|
||||||
// Statistical functions.
|
|
||||||
Rolling(period int) *RollingSeries
|
|
||||||
|
|
||||||
Push(val interface{}) Series
|
|
||||||
|
|
||||||
// Data access functions.
|
|
||||||
Value(i int) interface{}
|
|
||||||
ValueRange(start, end int) []interface{}
|
|
||||||
Values() []interface{} // Values is the same as ValueRange(0, -1).
|
|
||||||
Float(i int) float64
|
Float(i int) float64
|
||||||
Int(i int) int64
|
Int(i int) int64
|
||||||
Str(i int) string
|
Str(i int) string
|
||||||
Time(i int) time.Time
|
Time(i int) time.Time
|
||||||
|
Value(i int) interface{}
|
||||||
|
ValueRange(start, end int) []interface{}
|
||||||
|
Values() []interface{} // Values is the same as ValueRange(0, -1).
|
||||||
|
|
||||||
|
// Writing data.
|
||||||
|
SetName(name string) Series
|
||||||
|
Push(val interface{}) Series
|
||||||
|
|
||||||
|
// Statistical functions.
|
||||||
|
Rolling(period int) *RollingSeries
|
||||||
}
|
}
|
||||||
|
|
||||||
type Frame interface {
|
type Frame interface {
|
||||||
|
// Reading data.
|
||||||
|
Contains(names ...string) bool // Contains returns true if the frame contains all the columns specified.
|
||||||
Copy(start, end int) Frame
|
Copy(start, end int) Frame
|
||||||
Len() int
|
Len() int
|
||||||
|
Names() []string
|
||||||
|
Series(name string) Series
|
||||||
String() string
|
String() string
|
||||||
|
Value(column string, i int) interface{}
|
||||||
|
Float(column string, i int) float64
|
||||||
|
Int(column string, i int) int64
|
||||||
|
Str(column string, i int) string
|
||||||
|
Time(column string, i int) time.Time
|
||||||
|
|
||||||
// Easy access functions.
|
// Writing data.
|
||||||
|
PushSeries(s ...Series) error
|
||||||
|
PushValues(values map[string]interface{}) error
|
||||||
|
RemoveSeries(name string)
|
||||||
|
|
||||||
|
// Easy access functions for common columns.
|
||||||
|
ContainsDOHLCV() bool // ContainsDOHLCV returns true if the frame contains all the columns: Date, Open, High, Low, Close, and Volume.
|
||||||
Date(i int) time.Time
|
Date(i int) time.Time
|
||||||
Open(i int) float64
|
Open(i int) float64
|
||||||
High(i int) float64
|
High(i int) float64
|
||||||
@ -67,22 +82,7 @@ type Frame interface {
|
|||||||
Lows() Series
|
Lows() Series
|
||||||
Closes() Series
|
Closes() Series
|
||||||
Volumes() Series
|
Volumes() Series
|
||||||
Contains(names ...string) bool // Contains returns true if the frame contains all the columns specified.
|
|
||||||
ContainsDOHLCV() bool // ContainsDOHLCV returns true if the frame contains the columns: Date, Open, High, Low, Close, Volume.
|
|
||||||
|
|
||||||
PushCandle(date time.Time, open, high, low, close, volume float64) error
|
PushCandle(date time.Time, open, high, low, close, volume float64) error
|
||||||
PushValues(values map[string]interface{}) error
|
|
||||||
PushSeries(s ...Series) error
|
|
||||||
RemoveSeries(name string)
|
|
||||||
|
|
||||||
Names() []string
|
|
||||||
Series(name string) Series
|
|
||||||
Value(column string, i int) interface{}
|
|
||||||
Float(column string, i int) float64
|
|
||||||
Int(column string, i int) int64
|
|
||||||
Str(column string, i int) string
|
|
||||||
// Time returns the value of the column at index i. The first value is at index 0. A negative value for i (-n) can be used to get n values from the latest, like Python's negative indexing. If i is out of bounds, 0 is returned.
|
|
||||||
Time(column string, i int) time.Time
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppliedSeries is like Series, but it applies a function to each row of data before returning it.
|
// AppliedSeries is like Series, but it applies a function to each row of data before returning it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user