Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { OriginalCandles []*kline.Item EnhancedCandles []EnhancedKline Statistics *statistics.Statistic Config *config.Config TemplatePath string OutputPath string Warnings []Warning UseDarkTheme bool USDTotalsChart *Chart HoldingsOverTimeChart *Chart PNLOverTimeChart *Chart FuturesSpotDiffChart *Chart Prettify PrettyNumbers }
Data holds all statistical information required to output detailed backtesting results
func (*Data) GenerateReport ¶
GenerateReport sends final data from statistics to a template to create a lovely final report for someone to view
func (*Data) SetKlineData ¶
SetKlineData updates an existing kline item for LIVE data usage
func (*Data) UseDarkMode ¶
UseDarkMode sets whether to use a dark theme by default for the html generated report
type DetailedCandle ¶
type DetailedCandle struct { UnixMilli int64 Open float64 High float64 Low float64 Close float64 Volume float64 VolumeColour string MadeOrder bool OrderDirection order.Side OrderAmount decimal.Decimal Shape string Text string Position string Colour string PurchasePrice float64 }
DetailedCandle contains extra details to enable rich reporting results
type EnhancedKline ¶
type EnhancedKline struct { IsOverLimit bool Watermark string Exchange string Asset asset.Item Pair currency.Pair Interval kline.Interval Candles []DetailedCandle }
EnhancedKline enhances kline details for the purpose of rich reporting results
type Handler ¶
Handler contains all functions required to generate statistical reporting for backtesting results
type PrettyNumbers ¶
type PrettyNumbers struct{}
PrettyNumbers is used for report rendering one cannot access packages when rendering data in a template this struct exists purely to help make numbers look pretty
func (*PrettyNumbers) Decimal2 ¶
func (p *PrettyNumbers) Decimal2(d decimal.Decimal) string
Decimal2 renders a decimal nicely with 2 decimal places
func (*PrettyNumbers) Decimal64 ¶
func (p *PrettyNumbers) Decimal64(d decimal.Decimal) string
Decimal64 renders a decimal nicely with the idea not to limit decimal places and to make you nostalgic for Nintendo
func (*PrettyNumbers) Decimal8 ¶
func (p *PrettyNumbers) Decimal8(d decimal.Decimal) string
Decimal8 renders a decimal nicely with 8 decimal places
func (*PrettyNumbers) Float8 ¶
func (p *PrettyNumbers) Float8(f float64) string
Float8 renders a float nicely with 8 decimal places