Documentation ¶
Overview ¶
Package hodl offers a buy and hold trading algo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶
type Bot struct { // BuyBarIndex is the index in the price sequence to open the position BuyBarIndex int // SellBarIndex is the index in the price sequence to close the position. SellBarIndex int // contains filtered or unexported fields }
Bot implements a buy and hold algo. Should only be used for backtesting purposes. At a given bar index a long position is opened. Default is to buy on the first price received, call Close() to then sell the position and create a trade.
func (*Bot) ReceivePrice ¶
ReceivePrice updates the algo with the next market price.
Click to show internal directories.
Click to hide internal directories.