Versions in this module Expand all Collapse all v0 v0.0.7 Jul 24, 2022 Changes in this version + type CSVRenderer struct + Header bool + func NewCSVRenderer(header bool) *CSVRenderer + func (f *CSVRenderer) Render(r Result) string + type Renderer interface + Render func(Result) string type Result + func (r *Result) Summary() []string + type TableRenderer struct + Header bool + func NewTableRenderer(header bool) *TableRenderer + func (f *TableRenderer) Render(r Result) string v0.0.6 Jul 21, 2022 v0.0.5 Jul 21, 2022 v0.0.4 Jul 18, 2022 v0.0.3 Jul 17, 2022 Changes in this version + const DefaultRiskFreeReturn + const Long + const OrderTypeClose + const OrderTypeLimit + const OrderTypeMarket + const Short + type Backtest struct + Balance float64 + Candles []Candle + Location *time.Location + Orders []Order + Positions []Position + RiskFreeReturn float64 + Strategy Strategy + func NewBacktest(candles []Candle, strategy Strategy) *Backtest + func (b *Backtest) Run() Result + type Candle struct + Close float64 + High float64 + Low float64 + Open float64 + Time int64 + Volume float64 + type Direction int + type Order struct + CreatedAt int64 + Direction Direction + Entry float64 + ID int64 + RiskPercent float64 + StopLoss float64 + Target float64 + Type int + type Position struct + Close float64 + ClosedAt int64 + FilledAt int64 + Order Order + Profit float64 + Risk float64 + RiskReward float64 + type Result struct + Balance float64 + Losses int + MaxDrawdown float64 + MaxValue float64 + NetProfit float64 + ROIPercent float64 + SharpeRatio float64 + TradeCount int + Trades []Position + WinRate float64 + Wins int + func (r *Result) String() string + type Strategy interface + Tick func(Candle) []Order v0.0.2 Jul 17, 2022 v0.0.1 Jun 23, 2022