period

package
v0.0.0-...-c68f7f2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PERIOD_UNIT_MINUTE  = iota // M, MINUTE
	PERIOD_UNIT_DAY            // D, DAY
	PERIOD_UNIT_WEEK           // W, WEEK
	PERIOD_UNIT_MONTH          // N, MONTH
	PERIOD_UNIT_QUARTER        // Q, QUARTER
	PERIOD_UNIT_YEAR           // Y, YEAR
)

Variables

View Source
var (
	_, PERIOD_M     = PeriodFromString("M1")
	_, PERIOD_M5    = PeriodFromString("M5")
	_, PERIOD_M15   = PeriodFromString("M15")
	_, PERIOD_M30   = PeriodFromString("M30")
	_, PERIOD_M60   = PeriodFromString("M60")
	_, PERIOD_D     = PeriodFromString("D1")
	_, PERIOD_W     = PeriodFromString("W1")
	_, PERIOD_MONTH = PeriodFromString("N1")
	_, PERIOD_Q     = PeriodFromString("Q1")
	_, PERIOD_Y     = PeriodFromString("Y1")
)

Functions

This section is empty.

Types

type Period

type Period interface {
	Name() string
	ShortName() string
	DisplayName() string
	Unit() PeriodUnit
	UnitCount() int
	Eq(other Period) bool
	Lt(other Period) bool
	Gt(other Period) bool
	CanConvertTo(other Period) bool
	CanConvertFrom(other Period) bool
	BasicMergePeriod() Period
	KLinePerDay(nMinutes int) int
}

func PeriodFromString

func PeriodFromString(periodStr string) (error, Period)

periodStr format: M1 or MINUTE1

func PeriodFromStringUnsafe

func PeriodFromStringUnsafe(periodStr string) Period

type PeriodUnit

type PeriodUnit int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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