DEV Community

Discussion on: Who's looking for open source contributors? (September 17 edition)

Collapse
dirkolbrich profile image
Dirk Olbrich

Moin,

gobacktest is an event-driven backtesting framework written in Golang.

dirkolbrich / gobacktest

event-driven backtesting framework written in golang

Go Doc Travis Coverage Status Go Report Card Software License

Heads up: This is a framework in development, with only basic functionality.


gobacktest - Fundamental stock analysis backtesting

An event-driven backtesting framework to test stock trading strategies based on fundamental analysis. Preferably this package will be the core of a backend service exposed via a REST API.

Usage

Basic example:

package main
import (
  "github.com/dirkolbrich/gobacktest"
  "github.com/dirkolbrich/gobacktest/data"
  "github.com/dirkolbrich/gobacktest/strategy"
)
func main() {
  // initiate a new backtester
  test := gobacktest.New()
  // define and load symbols
  symbols := []string{"TEST.DE"}
  test.SetSymbols(symbols)
  // create a data provider and load the data into the backtest
  data := &data.BarEventFromCSVFile{FileDir: "../testdata/test/"}
  data.Load(symbols)
  test.SetData(data)

  // choose a strategy
  strategy := strategy.BuyAndHold()

  // create an asset and append it to the strategy
  strategy.SetChildren(gobacktest.NewAsset("TEST.DE"))
  
  

The goal is to create a flexible backtesting system, which could be used as a backend or as a stand alone within a Jupyter notebook.

If you are interested in financial stuff, algorithmic trading or quantitative finance and writing code in Go, feel welcome.

I would appreciate contributors for basic algos, tearsheet and graph integration, documentation or just in general discussion about the structure of the framework from an end user perspective.

Cheers.