Zenbot: Genetic back tester fails to fetch test results because of ansi codes

Created on 2 Oct 2017  路  3Comments  路  Source: DeviaVir/zenbot

There's a problem regarding #577 and the output containing ansi format codes (for colors).

The processOutput function constantly fails with the error message "Bad output detected" because the analysed simulation results contain ansi format codes and the corresponding regex functions to filter the results don't support these.

It's easily fixed with the npm module strip-ansi (https://www.npmjs.com/package/strip-ansi) at line 101 of of darwin.js:

let strippedOutput = StripAnsi(output);
let output2 = strippedOutput.substr(strippedOutput.length - 3500);

and

let StripAnsi = require('strip-ansi');

in the head of the file.

An even better solution would be to introduce a zenbot parameter called "--no-ansi" that would prevent zenbot from even using ansi color codes in it's results in the first place.

Please let me know if you're interested in a small pull request regarding solution 1 or 2.

Cheers,
Jens

bug

Most helpful comment

Hi @DeviaVir,

I'll submit a PR shortly. I'm glad I could help

All 3 comments

just saw that auto_backtester has the same problem

Hi @JensvdHeydt, excellent finding and thanks for doing the leg work on finding a solution for it.

I think your suggestion for adding --no-ansi (or perhaps --no-colors) would be the best, and would gladly merge a PR.

Hi @DeviaVir,

I'll submit a PR shortly. I'm glad I could help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asafyish picture asafyish  路  3Comments

MCrypto picture MCrypto  路  5Comments

0DTE picture 0DTE  路  3Comments

sam-perez picture sam-perez  路  5Comments

dymex0 picture dymex0  路  3Comments