Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic struct { }
Basic is a basic test strategy, which interprets every DataEvent as a signal to buy
func (*Basic) CalculateSignal ¶
func (s *Basic) CalculateSignal(e bt.DataEventHandler, data bt.DataHandler, p bt.PortfolioHandler) (bt.SignalEvent, error)
CalculateSignal handles the single Event
type BuyAndHold ¶
type BuyAndHold struct { }
BuyAndHold is a basic test strategy, which interprets the first DataEvent on a symbal as a signal to buy if the portfolio is not already invested.
func (*BuyAndHold) CalculateSignal ¶
func (s *BuyAndHold) CalculateSignal(e bt.DataEventHandler, data bt.DataHandler, p bt.PortfolioHandler) (bt.SignalEvent, error)
CalculateSignal handles the single Event
type MovingAverageCross ¶ added in v0.2.1
MovingAverageCross is a test strategy, which interprets the SMA on a series of data events specified by ShortWindow (SW) and LongWindow (LW). If SW bigger tha LW and there is not already an invested BOT position, the strategy creates a buy signal. If SW falls below LW and there is an invested BOT position, the strategy creates an exit signal.
func (*MovingAverageCross) CalculateSignal ¶ added in v0.2.1
func (s *MovingAverageCross) CalculateSignal(e bt.DataEventHandler, data bt.DataHandler, p bt.PortfolioHandler) (bt.SignalEvent, error)
CalculateSignal handles the single Event