back-mark-plotter
v1.0.2
Published
Equity Curve plotting lib for Back Mark trades
Maintainers
Readme
BackMark Plotter
Small lib to Plot Backmark Trades with Plotty.js as an HTML output file
Installation
npm i back-mark-plotterUsage 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:

