Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we load into our custom crypto data into cvxportfolio for backtesting and portfolio construction ? [bounty possible] #153

Open
blackivory opened this issue Apr 30, 2024 · 1 comment

Comments

@blackivory
Copy link

also would want to load our own custom alpha factors & models to forecast returns and run simulation
covariance can just be historical

can offer bounty if anyone can help to set this up :)

@enzbus
Copy link
Collaborator

enzbus commented Jun 5, 2024

Hi, yes of course you can use Cvxportfolio for any asset class, including crypto-currencies. If you have already returns dataframes I don't see any difference with what is shown in the examples with stocks or ETFs. Maybe you'll want to set cash_key='cash' in the cvx.UserProvidedMarketData initializer, since you probably can't collect USD risk free returns from an account on a crypto-currency exchange (with that shortkey you disable cash returns). You can do long-only portfolios, margined portfolios (using cvx.HoldingCost to model shorting fees and/or margin fees), and futures portfolios without any change. More complicated funding structures probably require custom cost objects. Other additions that may be useful could be a native cvx.data.SymbolData subclass to interface for example with binance API for their historical data, but I think Yahoo Finance in any case has historical returns for spot crypto-currencies, from Coinbase. In the future I plan to provide better infrastructure to run strategies online, now if you look in examples/strategies you'll see some not-so-clean code (that works, in any case). For high-frequency applications Cvxportfolio should work no problem, down to say a few seconds. I wouldn't recommend Cvxportfolio for super-high frequency trading, meaning sub-second, you'd probably want to use some custom C++ code for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants