crypto-backtest
Version:
Backtesting on market data imported from crypto exchange
20 lines • 729 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Backtest = void 0;
const Advisor_1 = require("./Advisor");
const BacktestBase_1 = require("./BacktestBase");
class Backtest extends BacktestBase_1.BacktestBase {
constructor(options) {
super(options);
Object.assign(this, options);
}
async execute() {
const { candles, strategy, initialBalance } = this;
this.currencyBalance = initialBalance;
this.advices = await Advisor_1.Advisor.execute(candles, strategy);
candles.forEach(this.candleHandler.bind(this));
this.calculateRountrips();
}
}
exports.Backtest = Backtest;
//# sourceMappingURL=Backtest.js.map