Anonymous View
1.0.2 • Published 1 year ago

back-mark-plotter v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

BackMark Plotter

TypeScript

Small lib to Plot Backmark Trades with Plotty.js as an HTML output file

Installation

 npm i back-mark-plotter

Usage Example

import { expect } from 'chai';
import { TradePlotter } from '../src/index.js';
import path from 'path';
import { SmaStrategy } from './strategies/smaStrategy.js';

async function plotExample(){
    const options = {
        accountBalance: 1000,
        fee: 1.5,
        productName: 'BTC-USD',
    };
    const backTest = new BackTest('./test/data/btcusd_short.csv', SmaStrategy, options);

    await backTest.run();

    const result = backTest.getResult();

    const plotter = new TradePlotter(result.tradeHistory);

    plotter.plot();
}

A trades_plot.html file output will be generated.

Example:

trades_plot.html

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago