indicator

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RefreshTime = map[string]int64{"4h": 14404000, "2h": 7204000, "1h": 3604000, "30m": 1804000, "15m": 904000, "5m": 304000, "1m": 64000}

Functions

func Kdj

func Kdj(rPeriod, kPeriod, dPeriod int, high, low, closing []float64) (k, d, j []float64)

func Rma

func Rma(period int, values []float64) []float64

func RsiPeriod

func RsiPeriod(period int, closing []float64) ([]float64, []float64)

func Sma

func Sma(period int, values []float64) []float64

func Sum

func Sum(period int, values []float64) []float64

func Vwap

func Vwap(period int, values []float64, volume []float64) []float64

Types

type ActionType

type ActionType string
const (
	ActionBuy  ActionType = "BUY"
	ActionSell ActionType = "SELL"
)

type Indicator

type Indicator struct {
	// contains filtered or unexported fields
}

func New

func New(klines []*Kline) *Indicator

func (*Indicator) WithKdj

func (i *Indicator) WithKdj(rPeriod, kPeriod, dPeriod int) ([]float64, []float64)

func (*Indicator) WithRsi

func (i *Indicator) WithRsi(period int) []float64

func (*Indicator) WithSma

func (i *Indicator) WithSma(period int) []float64

func (*Indicator) WithVwap

func (i *Indicator) WithVwap(period int) []float64

type Kline

type Kline struct {
	OpenTime  int64
	CloseTime int64
	Open      float64
	High      float64
	Low       float64
	Close     float64
	Volume    float64
}

type Ticker

type Ticker struct {
	O float64 // Open
	C float64 // Close
	H float64 // High
	L float64 // Low
	V float64 // Volume
	T int64   // Time
	S int64   // StartTime
	E int64   // EndTime
}

Jump to

Keyboard shortcuts

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