elliottwave

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: AGPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "elliottwave"

Variables

Functions

This section is empty.

Types

type ElliottWave

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

func (*ElliottWave) Index

func (s *ElliottWave) Index(i int) float64

func (*ElliottWave) Last

func (s *ElliottWave) Last() float64

func (*ElliottWave) Length

func (s *ElliottWave) Length() int

func (*ElliottWave) Update

func (s *ElliottWave) Update(v float64)

type HeikinAshi

type HeikinAshi struct {
	Values []types.KLine
	// contains filtered or unexported fields
}

func NewHeikinAshi

func NewHeikinAshi(size int) *HeikinAshi

func (*HeikinAshi) Last

func (inc *HeikinAshi) Last() *types.KLine

func (*HeikinAshi) Update

func (inc *HeikinAshi) Update(kline types.KLine)

type SourceFunc

type SourceFunc func(*types.KLine) fixedpoint.Value

type Strategy

type Strategy struct {
	Symbol string `json:"symbol"`

	bbgo.OpenPositionOptions
	bbgo.StrategyController
	bbgo.SourceSelector
	types.Market
	Session *bbgo.ExchangeSession

	Interval           types.Interval   `json:"interval"`
	MinInterval        types.Interval   `json:"minInterval"`
	Stoploss           fixedpoint.Value `json:"stoploss" modifiable:"true"`
	WindowATR          int              `json:"windowATR"`
	WindowQuick        int              `json:"windowQuick"`
	WindowSlow         int              `json:"windowSlow"`
	PendingMinInterval int              `json:"pendingMinInterval" modifiable:"true"`
	UseHeikinAshi      bool             `json:"useHeikinAshi"`

	// whether to draw graph or not by the end of backtest
	DrawGraph          bool   `json:"drawGraph"`
	GraphIndicatorPath string `json:"graphIndicatorPath"`
	GraphPNLPath       string `json:"graphPNLPath"`
	GraphCumPNLPath    string `json:"graphCumPNLPath"`

	*bbgo.Environment
	*bbgo.GeneralOrderExecutor
	*types.Position    `persistence:"position"`
	*types.ProfitStats `persistence:"profit_stats"`
	*types.TradeStats  `persistence:"trade_stats"`

	TrailingCallbackRate    []float64          `json:"trailingCallbackRate" modifiable:"true"`
	TrailingActivationRatio []float64          `json:"trailingActivationRatio" modifiable:"true"`
	ExitMethods             bbgo.ExitMethodSet `json:"exits"`
	// contains filtered or unexported fields
}

func (*Strategy) CalcAssetValue

func (s *Strategy) CalcAssetValue(price fixedpoint.Value) fixedpoint.Value

func (*Strategy) ClosePosition

func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error

func (*Strategy) CurrentPosition

func (s *Strategy) CurrentPosition() *types.Position

func (*Strategy) Draw

func (s *Strategy) Draw(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)

func (*Strategy) DrawCumPNL

func (s *Strategy) DrawCumPNL(cumProfit types.Series) *types.Canvas

func (*Strategy) DrawIndicators

func (s *Strategy) DrawIndicators(store *bbgo.SerialMarketDataStore) *types.Canvas

func (*Strategy) DrawPNL

func (s *Strategy) DrawPNL(profit types.Series) *types.Canvas

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) InitDrawCommands

func (s *Strategy) InitDrawCommands(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)

func (*Strategy) InstanceID

func (s *Strategy) InstanceID() string

func (*Strategy) Print added in v1.42.0

func (s *Strategy) Print(f io.Writer, pretty bool, withColor ...bool)

func (*Strategy) Run

func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error

func (*Strategy) Subscribe

func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)

Jump to

Keyboard shortcuts

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