Documentation ¶
Index ¶
- func DeltaRange(resolution Resolution, delta int) (time.Time, time.Time)
- func MonthsDiff(from, to time.Time) int64
- func NormalizeTimestamp(res Resolution, t time.Time) (time.Time, error)
- func RangeBetweenTimestamps(res Resolution, from, to time.Time) (int64, error)
- type Candle
- type Quote
- type Resolution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeltaRange ¶
func MonthsDiff ¶
func NormalizeTimestamp ¶
func RangeBetweenTimestamps ¶
func RangeBetweenTimestamps(res Resolution, from, to time.Time) (int64, error)
Types ¶
type Candle ¶
type Candle struct { Source string `json:"source,omitempty" gorm:"index:idx_unique_candle,unique"` Symbol string `json:"symbol,omitempty" gorm:"index:idx_unique_candle,unique"` Timestamp time.Time `json:"timestamp,omitempty" gorm:"index:idx_unique_candle,unique"` Resolution Resolution `json:"resolution,omitempty" gorm:"index:idx_unique_candle,unique"` Open float64 `json:"open,omitempty"` High float64 `json:"high,omitempty"` Low float64 `json:"low,omitempty"` Close float64 `json:"close,omitempty"` PrevClose float64 `json:"prevClose,omitempty"` Volume float64 `json:"volume,omitempty"` Value float64 `json:"value,omitempty"` }
type Resolution ¶
type Resolution string
const ( Second Resolution = "s" ThirtySeconds Resolution = "30s" Minute Resolution = "1m" FiveMinutes Resolution = "5m" TenMinutes Resolution = "10m" FifteenMinutes Resolution = "15m" ThirtyMinutes Resolution = "30m" Hour Resolution = "H" Day Resolution = "D" Week Resolution = "W" Month Resolution = "M" ThreeMonths Resolution = "3M" )
Click to show internal directories.
Click to hide internal directories.