Code Monkey home page Code Monkey logo

Comments (31)

akaniklaus avatar akaniklaus commented on June 23, 2024 1

If anybody is interested to implement TOC method also Universal Portfolios, please contact me so that I can send MATLAB implementation of the technique, which its authors kindly shared with me.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024 1

@Marigold This paper is very interesting:
"Algorithmic trading in limit order books for online portfolio selection"
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2952371

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024 1

Hm, from top of my head I can think of these metrics to quantify mean-reversion behavior:

  1. fit ARCH-like model to time series and look at its coefficients
  2. calculate Hurst exponent
  3. backtest mean-reversion strategy on assets and pick these that performed well (you can do some kind of bootstrap to reduce variance of the estimate)

Probably not the answer you were looking for :) I'd recommend you to check out some papers on mean-reversion, there's plenty of papers around

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

"Passive Aggressive Algorithm for Online Portfolio Selection with Piecewise Loss Function" In this paper, they also claim to improve over PAMR, maybe this technique can be utilized to improve PAMR and WMAMR algorithms that are implemented in the current framework. Please, check.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

"Online Learning of Commission Avoidant Portfolio Ensembles" This paper also seems to propose a notable method for using an ensemble of OLPS algorithms, in a commission avoidant manner.
https://arxiv.org/pdf/1605.00788.pdf

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

Hey @akaniklaus, sorry but I'm a bit busy these days and don't really have time for implementing all new research. There haven't been any major ideas recently anyway.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

@Marigold Hello, not problem at all. I should first thank you for providing this great library. If you still want to receive TOC method's MATLAB codes, please let me know ([email protected]). P.S. TOC paper is from the team (Bin Li & Steven Hoi) who developed OLPS toolbox.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

@Marigold Do you know any interesting work that is using an ensemble of these algorithms btw?

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

Can't remember any right now, but I've seen plenty doing this using OLMR(OLMR(OLMR)) and so on. Haven't found much use in it, it's just pure overfitting.

The problem with these papers is that they have survivorship bias (which is a huge deal if your strategy is mean-reverting) and they tune it to specific datasets (NYSE, TSE, ...). To be honest, I'm not using any of these OLMAR-type strategies, but I use for instance MPT (Markowitz) for managing my personal portfolio.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

Thank you for your feedback! I also started experimenting with them after your notice but it is hard to decide for a training and waiting period (by the way, I am trying to work with cryptocurrencies).

As I am a bit skeptical about the behaviour of simplex projection that often bets into only one asset (especially in such a volatile space as crypto-currencies), I rather used following transformation:

weight = np.log(1.0 + np.exp(weight))
weight = weight / weight.sum()

However, surprisingly (at least for me), it resulted in a worse performance. Any ideas about this?

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

rmr- with simplex projection

I guess that they are as I was able to obtain good results with RMR during backtesting, at least for some periods. I am now running it for live-trading with couple of improvements that I have made, such as intra-day trading with a sliding window, etc. It would also match better my case, as I am trading in smaller and more easily executable orders, to not just buy but also sell according to the weights. I am also using a weighted average price that is calculated from orders, rather than close prices. I also converted Matlab codes of TCO1 in the paper to Python as follows, but they didn't work well (I might have made a mistake while converting them into Python). Note: lda is commission 0.0025 multiplied with a variable that is found 10 as optimal in the paper, along with eta variable.

def tcp_trunc(x, eta_lambda):
return np.sign(x) * np.max(abs(x)-eta_lambda, 0)

def tco1Step(X, last_b, eta=10, lda=0.025):
mr_x = 1 / X
trunc_x = eta * (mr_x - np.mean(mr_x)) / np.dot(last_b, mr_x)
weight = last_b + tcp_trunc(trunc_x, lda*eta)
return simplex_proj(weight)

I have also applied Markowitz portfolio as per your suggestion but didn't perform a backtesting yet as I was unsure what would be the best length for a past window using which MPT is calculated. What disturbs me about Simplex projection as that for example there is an asset with weight 19 and another with 20, the algorithm sometimes sells the one with 19 to buy the one with 20 (as simplex often bets into one). I am planning to change the algorithm so that it also considers calculated weights (from RMR) while selling assets, rather than threatening all of the ones to be sold equally.

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

I have also applied Markowitz portfolio as per your suggestion but didn't perform a backtesting yet

Markowitz is for passive investing (basically how to best diversify your portfolio). If you look for trading algorithms, then RMR and others are more suited for that.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

FYI, I've read a thesis that suggests three weeks of back window and two weeks of holding time for a Markowitz portfolio in cryptocurrency domain. I guess that I might try something like that as well.

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

Would you mind providing a link? Sounds like overfitting at its best :).

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

It doesn't seem the best thesis but :)
https://thesis.eur.nl/pub/39587/Stoffels-J-450577-MA-thesis.pdf

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

Here it says that they're using FTSE Russel’s capping methodology:
https://static.crypto20.com/pdf/c20-whitepaper.pdf

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

These are also some other interesting ensemble OLPS applications:
https://akraichand.github.io/KSE966.pdf
https://ciir-publications.cs.umass.edu/pub/web/getpdf.php?id=1257

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

Well, that's how generally Academia is :) Still, worth to take a look and try improving. The biggest problem that I am facing at the moment with RMR on crypto currency space is that it takes serious damages by buying recently pumped assets that are being dumped, apart from that it seems to be making profits. Overall, I can say that it managed so far to not lose any significant portfolio value.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

I would also like to let you know that, high-interest lending is also possible in cryptocurrency field. Since that you're interested with longer-term portfolio rebalancing methods such as Markowitz, I believe that a lending bot could make a great sense to use in conjunction with such methods:
https://github.com/BitBotFactory/poloniexlendingbot

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

Annualized compound interest rate is much higher. Please, check here for historical lending rates: https://www.coinlend.org/#!History

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

Wouldn't be better to use Markowitz Portfolio with "Sortino Ratio" or "Calmar Ratio with Expected Maximum Drawdown" as in the following paper? http://alumnus.caltech.edu/~amir/mdd-risk.pdf

Did you ever check this implementation that is also nice? https://github.com/czielinski/portfolioopt

from universal-portfolios.

Marigold avatar Marigold commented on June 23, 2024

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

About Sortino Ratio:
https://www.sunrisecapital.com/wp-content/uploads/2013/02/Futures_Mag_Sortino_0213.pdf
They also mention about Omega Ratio at the end of the document.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

@Marigold Do you have any idea on how to preselect a limited set of best assets for mean-reversion algos? I don't prefer using Markowitz to do that because in crypto market correlations shouldn't be as important as in stocks.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

@Marigold Plenty of papers but unfortunately not when it comes to real problems and their solutions.

from universal-portfolios.

Auxiliumdesign avatar Auxiliumdesign commented on June 23, 2024

@akaniklaus I and a friend of mine has been working on similar algos for cryptotrading for about a year now. It is a very interesting field! Would be nice to have a chat if you are interested in some cryptotalk.

from universal-portfolios.

akaniklaus avatar akaniklaus commented on June 23, 2024

@Auxiliumdesign You can reach me via Skype ID 'akaniklaus'

from universal-portfolios.

Auxiliumdesign avatar Auxiliumdesign commented on June 23, 2024

I've sent you a message!

from universal-portfolios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.