calumrussell / rotala

Backtesting engine written in Rust
MIT License
64 stars 11 forks source link

Backend shouldn't be file system #112

Open calumrussell opened 3 weeks ago

calumrussell commented 3 weeks ago

The file system is used as the backend so startup times are high and multi-asset backtests don't really work.

Implementing this may involve:

Most logical approach is that we set a frequency for the backtest and a fixed start_time/end_time to query over ranges? Multiple quotes in a frequency range would be resolved to the final quote.

Clients should get times from ticks. Now should be removed. This has ended up being an issue after moving to range queries because clients can now get empty results and we need to update the time without necessarily having quotes for that time.

calumrussell commented 2 weeks ago

This will require changing the BacktestState implementation.

Clients should call info for a dataset and get back a start/end date. Clients can then init between these dates declaring a minimum latency for ticks (they could control their own ticks but would be messy).

Inner will need to be reimplemented as BTreeHashMap to perform range queries. This will be how DB code is effectively implemented.

Should probably do this separately so that the BacktestState can be moved onto DB.