Skip to content

clojure-finance/clojure-backtesting

Repository files navigation

Clojure Backtesting Library

A backtesting framework for quantitative investing and trading.

Requirements

  • Java
  • Clojure Leiningen

A good tutorial about installing the above softwares. Remember to reboot the system after changing the environment path every time.

How to install

  1. Lein REPL

    No need to install extra softwares. Recommended for new users.

    1. Clone the repo and decompress.

    2. Under the directory, run below command in the terminal to start a Lein REPL.

      lein repl

    3. Run the examples in the /examples folder line by line in the REPL.

  2. Gorilla REPL

    Can save strategies in notebooks.

    every time you open Gorilla REPL, run

    lein gorilla
    
  3. Try it out online

    Only try out the basic APIs with a small dataset.

    Online interactive notebook

How to use

  1. Go through every examples in the /examples folder to get a basic understanding of the system.
  2. Documentations for every detailed APIs can be found here.
  3. Learn to use the APIs to write your own strategy!

Update

Make sure you have the latest version of the code installed by running after each clone:

make add_kernel

Report bugs

As we are still working to fully debug the code and create more examples, feel free to report issues in the repository and we appreciate your kind support.

Development

To start an interactive prompt where you can enter arbitrary code to run in the context of your project:

lein repl

To run the default :main set in project.clj:

lein run

To run all tests written in the test namespace:

lein test