ctubio / tribeca

Self-hosted crypto trading bot (automated high frequency market making) in node.js, angular, typescript and c++
https://127.0.0.1:3000
Other
95 stars 26 forks source link

Backtest docs #43

Closed holoiii closed 7 years ago

holoiii commented 7 years ago

It would be great to have some kind of documentation on how to run backtests - I noticed that there was only this:

https://github.com/ctubio/tribeca/blob/master/MANUAL.md#how-can-i-test-new-trading-strategies

But it doesn't really provide any info on how to actually run backtests.

Thanks for any guidance, and great work!

ctubio commented 7 years ago

just read or make use ofsrc/server/backtest.ts and /test/*.ts files.

see https://github.com/michaelgrosner/tribeca/issues/59

ctubio commented 7 years ago

at https://github.com/ctubio/tribeca/blob/master/src/server/config.ts#L17 there is the name of the environment variable used to make the app run in enabled backtest mode, and at https://github.com/ctubio/tribeca/blob/master/src/server/backtest.ts#L395 there is the port used to access the backtest methods (/inputData, /nextParameters, /result); but i dont like to manually do tests, i would preffer to instead use scripts at /test/*.ts to periodically run the tests with mocha using command npm test (since the app is updated daily, a manual test today will become useless tomorrow if the test is not executed again).

ctubio commented 7 years ago

at https://github.com/ctubio/tribeca/blob/master/test/backtest.ts#L67 there is an example of moving forward the time, and at https://github.com/ctubio/tribeca/blob/master/test/backtest.ts#L94 there is another example to feed market data to the app and to wait for orders to be completed.

holoiii commented 7 years ago

Amazing, thanks!