Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Sim command save config to file #1199

Closed
station384 opened this issue Jan 22, 2018 · 0 comments
Closed

Sim command save config to file #1199

station384 opened this issue Jan 22, 2018 · 0 comments

Comments

@station384
Copy link
Contributor

station384 commented Jan 22, 2018

TL;DR
Add parameter to sim command. outputs json file with sim results. Modify backtesters to use said json file.

The change comes from working with the genetic_backtester and some errors that occur when it scrapes the JSON results from stdio.
Occasionally the regex will fail with index 1 not found.
This error only seems to occur after a period of time, it is rather random. When debugging, it seems the failure is in the regex when decodes the first match. reworking/debugged the regex, filtering the text before the regex doesn't seem to correct the problem, I have a theory that it is some control character causing it to fail.

I propose and alternative solution; writing out the Config JSON output to a file after the sim completes with an additional item added to the json called simresults which has all the results (end currency, trades, etc) from the sim.

I have a modification to the sim command that adds a new parameter called backtester_generation. It accepts a number. if the number is greater than 0 it writes the json file in the format of <selectedexchange.marketpair>-<backtester_generation>.json

This file can then be read by the backtesters instead of scraping using regex, this will provide more reliability and eliminate the possibility of extra text in the stdio causing problems.

I also see an alternative approach where we store the results in mongodb, which I think should be the final direction, which would allow for easier continuation of generations instead of the current setup using json files, the downside is a lot of extra data bloating the database.

Looking for comments, thoughts, other ideas of what could be done with this, or nah not needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants