Documentation
¶
Index ¶
- Constants
- Variables
- type ElliottWave
- type HeikinAshi
- type SourceFunc
- type Strategy
- func (s *Strategy) CalcAssetValue(price fixedpoint.Value) fixedpoint.Value
- func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error
- func (s *Strategy) CurrentPosition() *types.Position
- func (s *Strategy) Draw(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)
- func (s *Strategy) DrawCumPNL(cumProfit types.Series) *types.Canvas
- func (s *Strategy) DrawIndicators(store *bbgo.SerialMarketDataStore) *types.Canvas
- func (s *Strategy) DrawPNL(profit types.Series) *types.Canvas
- func (s *Strategy) ID() string
- func (s *Strategy) InitDrawCommands(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)
- func (s *Strategy) InstanceID() string
- func (s *Strategy) Print(f io.Writer, pretty bool, withColor ...bool)
- func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, ...) error
- func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Constants ¶
View Source
const ID = "elliottwave"
Variables ¶
View Source
var Delta fixedpoint.Value = fixedpoint.NewFromFloat(0.00001)
View Source
var Four fixedpoint.Value = fixedpoint.NewFromInt(4)
View Source
var Three fixedpoint.Value = fixedpoint.NewFromInt(3)
View Source
var Two fixedpoint.Value = fixedpoint.NewFromInt(2)
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(i int) float64
func (*ElliottWave) Length ¶
func (s *ElliottWave) Length() int
func (*ElliottWave) Update ¶
func (s *ElliottWave) Update(v float64)
type HeikinAshi ¶
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 (*Strategy) CurrentPosition ¶
func (*Strategy) Draw ¶
func (s *Strategy) Draw(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)
func (*Strategy) DrawIndicators ¶
func (s *Strategy) DrawIndicators(store *bbgo.SerialMarketDataStore) *types.Canvas
func (*Strategy) InitDrawCommands ¶
func (s *Strategy) InitDrawCommands(store *bbgo.SerialMarketDataStore, profit, cumProfit types.Series)
func (*Strategy) InstanceID ¶
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)
Click to show internal directories.
Click to hide internal directories.