A first example of a trading strategy tested using the Grademark JavaScript backtesting API.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
data A first example for the grademark backtesting API. Oct 26, 2018
docs Updated example notebook. Feb 12, 2019
output Updated various depenencies. Jan 25, 2019
LICENSE Initial commit Oct 26, 2018
README.md Updated readme. Jan 26, 2019
index.js Updated to Grademark v0.1.0. Jan 25, 2019
package-lock.json Updated to Grademark v0.1.0. Jan 25, 2019
package.json Updated to Grademark v0.1.0. Jan 25, 2019



This is an example trading strategy that demonstrates the grademark API for backtesting financial trading strategies.

Please click here to see this code as a notebook.

To keep up with my work on quantitative trading in JavaScript please see my blog or YouTube channel.

Try it out

You need Node.js installed to run this.

Clone or download the repo.

Change to repo's directory and install dependencies:

cd grademark-first-example
npm install

Now run it:

node index.js


npm start

You will see some stats printed to the console.

Inspect the output sub-directory for charts.

Examples of output

Here's a screenshot of the analysis:

Analysis of trades screenshot

Here's one of the charts that visualizes the equity curve:

Equity curve

Here's another chart, this is a visualization of the drawdown: