strategy

package
v0.0.0-...-b8ff696 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ContrarianTrigger = 14
View Source
const PrevKlines = 52
View Source
const StopPercent = 0.15

Variables

This section is empty.

Functions

This section is empty.

Types

type Buf

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

func NewBuf

func NewBuf(period int64) *Buf

func (*Buf) Append

func (b *Buf) Append(value float64) float64

func (*Buf) Size

func (b *Buf) Size() int64

type Candle

type Candle struct {
	High   float64
	Low    float64
	Open   float64
	Close  float64
	Volume float64
}

func ToCandle

func ToCandle(high, low, open, cl, volume string) (*Candle, error)

type Elliott

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

func NewElliott

func NewElliott(alta, baixa, vende, compra, offset int) *Elliott

func (*Elliott) Update

func (e *Elliott) Update(candles ...*Candle) Signal

type Ema

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

func NewEMA

func NewEMA(period int64) *Ema

func (*Ema) Update

func (e *Ema) Update(value float64) float64

type EmaTest

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

func NewEMATest

func NewEMATest(period int64) *EmaTest

func (*EmaTest) Update

func (e *EmaTest) Update(candles ...*Candle) Signal

type First

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

func NewFirst

func NewFirst(period1, period2, period3, period4, period5 int64) *First

1 - 200, 2 - 10, 3 - 50, 4 - 9, 5 - 20

func (*First) Update

func (e *First) Update(candles ...*Candle) Signal

type Highest

type Highest []float64

func (Highest) Add

func (h Highest) Add(high float64)

func (Highest) Copy

func (h Highest) Copy() Highest

func (Highest) Max

func (h Highest) Max() float64

type KOV

type KOV struct {
	Ko        *KVO
	SignalEma *Ema
	Trend     *Ema
	// contains filtered or unexported fields
}

func NewKOV

func NewKOV(signalPeriodEma, trendPeriodEma int64) *KOV

func (*KOV) Update

func (k *KOV) Update(candles ...*Candle) Signal

type KVO

type KVO struct {
	Value float64
	// contains filtered or unexported fields
}

func NewKvo

func NewKvo() *KVO

func (*KVO) Update

func (k *KVO) Update(high, low, cl, volume float64) float64

type RSI

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

func NewRSI

func NewRSI(window int) *RSI

func (*RSI) Update

func (r *RSI) Update(price float64) float64

type SMA

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

func NewSMA

func NewSMA(period int64) *SMA

func (*SMA) Update

func (s *SMA) Update(value float64) float64

type Signal

type Signal int
const (
	BUY Signal = iota
	SELL
	PASSIVE
)

type StochRSI

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

func NewStochRSI

func NewStochRSI() *StochRSI

func (*StochRSI) Update

func (s *StochRSI) Update(cl float64) (float64, float64)

Jump to

Keyboard shortcuts

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