strategies

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MACrossStrategy

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

Strategy strategy

func (*MACrossStrategy) GetParams

func (ma *MACrossStrategy) GetParams() []*K.Params

func (*MACrossStrategy) Once

func (ma *MACrossStrategy) Once(ctx *K.Context, ohlc *K.OHLC) error

Setup is used to declare what indicators will be used

func (*MACrossStrategy) OrderEvent

func (ma *MACrossStrategy) OrderEvent(orderEvent K.Event)

OrderEvent gets called on order events

func (*MACrossStrategy) PerBar

func (ma *MACrossStrategy) PerBar(k int, callback K.Callback) error

Tick get called when there is new data coming in

func (*MACrossStrategy) Update

func (ma *MACrossStrategy) Update(k *int) error

Update is called before perBar

type RMICrossStrategy

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

Strategy strategy

func (*RMICrossStrategy) GetParams

func (rmi *RMICrossStrategy) GetParams() []*K.Params

func (*RMICrossStrategy) Once

func (rmi *RMICrossStrategy) Once(ctx *K.Context, ohlc *K.OHLC) error

Setup is used to declare what indicators will be used

func (*RMICrossStrategy) OrderEvent

func (rmi *RMICrossStrategy) OrderEvent(orderEvent K.Event)

OrderEvent gets called on order events

func (*RMICrossStrategy) PerBar

func (rmi *RMICrossStrategy) PerBar(k int, callback K.Callback) error

Tick get called when there is new data coming in

func (*RMICrossStrategy) Update

func (rmi *RMICrossStrategy) Update(k *int) error

Update is called before perBar

type RebalanceStrat

type RebalanceStrat struct {
	ROC100 []float64
}

Strategy strategy

func (*RebalanceStrat) GetInterval

func (rmi *RebalanceStrat) GetInterval() string

func (*RebalanceStrat) GetParams

func (rmi *RebalanceStrat) GetParams() []*K.Params

func (*RebalanceStrat) Once

func (rmi *RebalanceStrat) Once(ctx *K.Context, ohlc *K.OHLC) error

Setup is used to declare what indicators will be used

func (*RebalanceStrat) OrderEvent

func (rmi *RebalanceStrat) OrderEvent(orderEvent K.Event)

OrderEvent gets called on order events

func (*RebalanceStrat) PerBar

func (rmi *RebalanceStrat) PerBar(k int, callback K.Callback) error

Tick get called when there is new data coming in

func (*RebalanceStrat) Rebalance

func (rmi *RebalanceStrat) Rebalance(k int, date time.Time, callback K.Callback) error

func (*RebalanceStrat) Update

func (rmi *RebalanceStrat) Update(k *int) error

Update is called before perBar

Jump to

Keyboard shortcuts

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