calumrussell / rotala

Backtesting engine written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rotala - Implement source abstraction

calumrussell opened this issue · comments

Data sources are currently a bit of a grey area because the HTTP layer isn't particularly well-defined. One path here was to try and go for LOB immediately: this is probably necessary for use cases but is going to mean doing more stuff with exchanges (which is tedious).

I think it would make more sense to define the required functionality of source/inputs so that we have a foundation to come back to LOB later.

Key functions are:

  • At the start of a backtest, load data from file (it doesn't make sense to support network in any way)
  • The data on file has to be CSV
  • Data is immutable over the runtime of the server
  • Only way to change data is stop server and reload

This is less flexible than the current situation but we need a defined way of dealing with data, and this creates limitations to build on later.

commented

An optimization here is that the Exchange currently requires a copy of the dataset, this is not needed because the datasets are immutable. All the exchange needs to store is the name of the dataset that it is using and it's position in this.

I am not sure why this was done but I think this is going to require changes across repo, as this mistake was copied multiple times.

#79 - closed with

commented

This is mostly implemented already but should also add data sources. There are no real abstractions here so should be able to load from CSV.

Penelope/Uist is currently working on L1 data. So should also implement source/exchange for l2. May need to split off Orderbook abstraction from exchange too.