period

package
v0.0.0-...-e7652ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPeriod = errors.New("invalid period")
)

Functions

This section is empty.

Types

type Symbol

type Symbol string
const (
	M1  Symbol = "M1"
	M3  Symbol = "M3"
	M5  Symbol = "M5"
	M15 Symbol = "M15"
	M30 Symbol = "M30"
	H1  Symbol = "H1"
	H2  Symbol = "H2"
	H4  Symbol = "H4"
	H6  Symbol = "H6"
	H8  Symbol = "H8"
	H12 Symbol = "H12"
	D1  Symbol = "D1"
	D3  Symbol = "D3"
	W1  Symbol = "W1"
)

func FromDuration

func FromDuration(d time.Duration) (Symbol, error)

func FromSeconds

func FromSeconds(i int64) (Symbol, error)

func FromString

func FromString(symbol string) (Symbol, error)

func Symbols

func Symbols() []Symbol

func UniqueArray

func UniqueArray(sym1, sym2 []Symbol) []Symbol

func (Symbol) CountBetweenTimes

func (s Symbol) CountBetweenTimes(start, end time.Time) int64

func (Symbol) Duration

func (s Symbol) Duration() time.Duration

func (Symbol) IsAligned

func (s Symbol) IsAligned(t time.Time) bool

func (Symbol) Opt

func (s Symbol) Opt() *Symbol

func (Symbol) RoundTime

func (s Symbol) RoundTime(t time.Time) time.Time

func (Symbol) String

func (s Symbol) String() string

func (Symbol) Validate

func (s Symbol) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL