Open tdrobbin opened 6 years ago
I've managed to get custom OHLCV data into Catalyst by loading data from a CSV in the initialize
function like so:
df = pandas.read_csv('minute-price-test.csv', parse_dates=['last_traded'], index_col=['last_traded'])
context.imported_prices = df
Then using the price from context.imported_prices
in handle_data
instead of the data that's piped in by Catalyst:
price = context.imported_prices.loc[context.datetime]['close']
You could probably skip the CSV reading part and just pass in your dataframe.
I'm looking at enhancing the exchange_bundle module to allow us to ingest data directly from a Pandas DataFrame into an exchange.
Hope the above workaround helps in the meantime!
Dear Catalyst Maintainers,
Thank you for your work on an amazing platform!
Before I tell you about my issue, let me describe my environment:
Environment
I'm running mac osx, and installed everything with combination of pip and conda in a custom conda environment. catalyst was installe with pip. here's what my environment looks like
name: sdac channels:
Now that you know a little about me, let me tell you about the issue I am having:
Description of Issue
I tried running the backtest using this data by passing it to
run_algorithm
via thedata
param as follows:I recieved an error that i must pass an exchange_name, so uncommented out the portion above. so my
bt_options
looks as follows:I recieved the following traceback:
I believe there may be an issue with how I'm accessing the asset in the following:
Nearly identical code, however, works when using zipline.
Here is how you can reproduce this issue on your machine:
Reproduction Steps
If it would be helpful I can upload a binary of the data panel, as a pickle or zipped hdf5 or something else that would be useful.
I have also already ingested the bitfinex daily exchange data hence the
btc_usd
symbol lookup succeeds (when I uncomment it out)....
What steps have you taken to resolve this already?
Looking through the stack trace and catalyst's documentation, it seems that
symbol
expects a target currency as well a base currency in the string with an underscore separating them. So I tried the following:everything ran successfully but the resulting data (returns) were exactly the same, out to the 4th decimal place as when I used
btc_usd
so perhaps it is not case sensitive...
Anything else?
I'm looking to test some idea on a large cross section using custom ohlcv data. I can get it to work with zipline, but the calendar is a bit messed up (not designed for cryptos like catalyst is!). But catalyst is designed for cryptos and in the future it would be nice to ues the live feature as well, so ideally I can do it all using catalyst.
Again, thanks a lot! ...
Sincerely,
tyler