Closed lomagno2003 closed 2 years ago
Hey thanks for using blankly!
The mocked data is definitely a hole in our accuracy so fixing that would be awesome.
Right now that patch exists because we were going to make a DataReader
object that could handle a variety of formats, like the csvs we provide or the WRDS
database.
If you want to deal with the caching, we have a generalized time series caching algorithm implemented here: https://github.com/blankly-finance/blankly/blob/fd0a37f115a09fec44277507ad662ccab17e0689/blankly/exchanges/interfaces/paper_trade/backtest_controller.py#L50
Supporting a multi symbol, multi exchange, ohlcv format would be awesome for keyless exchange, our original conception would look something like this:
{
"coinbase_pro": {
"BTC-USD": {
"open": [1,2,3,4,5],
"high": [1,2,3,4,5],
"low": [1,2,3,4,5],
"close": [1,2,3,4,5],
"volume": [1,2,3,4,5],
"time": [160000000,160000000],
}
}
}
These are just some thoughts but we're very open to the idea or anything you come up with.
Hey @lomagno2003 , what are your thoughts on this approach? Would also love to get some feedback from the overall community too?
Description of Feature Request
First of all, congratz on your work on Blankly. I've also used Freqtrade and Backtrader and even though they provide other capabilities that you don't, you rock on making this framework simple to use.
I'm developing a strategy using Artificial Neural Networks trained using Genetic Algorithms. In here, I need to run multiple back tests in order to calculate the fitness of each individual. For this, I'm using Blankly backtest where I need to initialize an Exchange. I was using Alpaca but during initialization and execution, it performs some HTTPS calls that slows down the training (even if they are just a few). I switched to KeyLess exchange but I noticed that it mocks the OHCLV data (reference).
Would be nice to have this Exchange (or maybe another exchange) to provide all the OHCLV data. Maybe one exchange that requires a directory with multiple CSV files, one per Symbol (maybe similar to the ones generated by the backtests on the price_cache folder).
Why is it important?
Maybe other people needs this feature to perform offline trainings and backtests using the full OHCLV data. Just as a silly example, I want to code while I'm flying without internet connectivity and be able to tests my strategy which uses volume indicators.
How would you use the feature?
I would like to provide a folder that will contains all the CSV files that can be consumed by this Exchange. For instance:
In here, the folder might have the following files:
AAPL,1614793059,1646329059,86400.csv
TSLA,1634688000,1641168000,1800.csv
How would you implement this? As mentioned, I'll probably do something quite similar to the KeylessExchange but instead of providing a file, I'll read each file on a folder looking for CSV files that follows the cached prices format and in their header have the
high,low,volume,close,open,time
. Then I'll somehow do a lazy load of those files (depending the symbols and date range that is needed)Would you like to Contribute?
Additional Information