backtest

package
v0.0.0-...-83dca6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 44 Imported by: 0

README

GoCryptoTrader Backtester: Backtest package

Build Status Software License GoDoc Coverage Status Go Report Card

This backtest package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

Backtest package overview

The backtest package is the most important package of the GoCryptoTrader backtester. It is the engine which combines all elements. It is responsible for the following functionality

  • Loading settings from a provided config file
  • Retrieving data
  • Loading the data into assessable chunks
  • Analysing the data via the handleEvent function
  • Looping through all data
  • Outputting results into a report

A flow of the application is as follows: workflow

Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackTest

type BackTest struct {
	Datas      data.Holder
	Strategy   strategies.Handler
	Portfolio  portfolio.Handler
	Exchange   exchange.ExecutionHandler
	Statistic  statistics.Handler
	EventQueue eventholder.EventHolder
	Reports    report.Handler
	Funding    funding.IFundingManager
	// contains filtered or unexported fields
}

BackTest is the main holder of all backtesting functionality

func New

func New() *BackTest

New returns a new BackTest instance

func NewFromConfig

func NewFromConfig(cfg *config.Config, templatePath, output string) (*BackTest, error)

NewFromConfig takes a strategy config and configures a backtester variable to run

func (*BackTest) Reset

func (bt *BackTest) Reset()

Reset BackTest values to default

func (*BackTest) Run

func (bt *BackTest) Run() error

Run will iterate over loaded data events save them and then handle the event based on its type

func (*BackTest) RunLive

func (bt *BackTest) RunLive() error

RunLive is a proof of concept function that does not yet support multi currency usage It runs by constantly checking for new live datas and running through the list of events once new data is processed. It will run until application close event has been received

func (*BackTest) Stop

func (bt *BackTest) Stop()

Stop shuts down the live data loop

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL