Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DoNothing is an explicit signal for the backtester to not perform an action // based upon indicator results DoNothing order.Side = "DO NOTHING" // TransferredFunds is a status signal to do nothing TransferredFunds order.Side = "TRANSFERRED FUNDS" // CouldNotBuy is flagged when a BUY signal is raised in the strategy/signal phase, but the // portfolio manager or exchange cannot place an order CouldNotBuy order.Side = "COULD NOT BUY" // CouldNotSell is flagged when a SELL signal is raised in the strategy/signal phase, but the // portfolio manager or exchange cannot place an order CouldNotSell order.Side = "COULD NOT SELL" // MissingData is signalled during the strategy/signal phase when data has been identified as missing // No buy or sell events can occur MissingData order.Side = "MISSING DATA" // CandleStr is a config readable data type to tell the backtester to retrieve candle data CandleStr = "candle" // TradeStr is a config readable data type to tell the backtester to retrieve trade data TradeStr = "trade" )
View Source
const ( DataCandle = iota DataTrade )
DataCandle is an int64 representation of a candle data type
View Source
const ASCIILogo = `` /* 2280-byte string literal not displayed */
ASCIILogo is a sweet logo that is optionally printed to the command line window
Variables ¶
View Source
var ( // ErrNilArguments is a common error response to highlight that nils were passed in // when they should not have been ErrNilArguments = errors.New("received nil argument(s)") // ErrNilEvent is a common error for whenever a nil event occurs when it shouldn't have ErrNilEvent = errors.New("nil event received") // ErrInvalidDataType occurs when an invalid data type is defined in the config ErrInvalidDataType = errors.New("invalid datatype received") )
Functions ¶
func DataTypeToInt ¶
DataTypeToInt converts the config string value into an int
Types ¶
type DataEventHandler ¶
type DataEventHandler interface { EventHandler GetClosePrice() decimal.Decimal GetHighPrice() decimal.Decimal GetLowPrice() decimal.Decimal GetOpenPrice() decimal.Decimal }
DataEventHandler interface used for loading and interacting with Data
type Directioner ¶
Directioner dictates the side of an order
type EventHandler ¶
type EventHandler interface { GetOffset() int64 SetOffset(int64) IsEvent() bool GetTime() time.Time Pair() currency.Pair GetExchange() string GetInterval() kline.Interval GetAssetType() asset.Item GetReason() string AppendReason(string) }
EventHandler interface implements required GetTime() & Pair() return
Click to show internal directories.
Click to hide internal directories.