Тёмный

Battle Of The Portfolio Optimization Methods 

CloseToAlgoTrading
Подписаться 2,4 тыс.
Просмотров 17 тыс.
50% 1

In this video we did a quick comparison of the portfolio optimization methods. In addition to classic methods such as Mean Variance, HRP and CLA, we also tested two exotic methods: the first is based on the idea of using LSTM model directly to optimize Sharpe value, and the second is a pretrained model that predicts future allocations. Also we created a simple strategy for dynamic rebalancing of the portfolio based on a given model and compared the results.
00:24 Theory and Methods
03:00 Comparison of Allocations
04:30 Testing
06:00 Results
If you want to support this channel:
commerce.coinb...
Code: github.com/Clo...
LSTM optimization methods: paperswithcode...
pyportfolioopt: pypi.org/proje...

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@hernanalzate1582
@hernanalzate1582 5 месяцев назад
Great video, thank you so much. I wonder why you say the risk-free rate does not play any role, and as a result, you just take into account the Portf Return / Std. Dev of the Portf in order to compute the Sharpe ratio.
@avinashmishra6783
@avinashmishra6783 5 месяцев назад
Thank you vary much for the video
@mikiallen7733
@mikiallen7733 2 года назад
thanks sir , but did you get materially different results when you run this battle of methods but with an additional constraint of short positions ? my interest lies in the max dd numbers your input is highly appreciated
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Hi Miki, not really... I didn't have suitable short strategis :(.
@vladk9152
@vladk9152 3 года назад
It's a bit of a bummer, not gonna lie. We've been taught about how good modern portfolio theory was but this test shows it might not be that far from random. I'm new to machine learning, but my approach would be to decompose the price's trend from seasonality, use an autoencoder to get the important patterns and use that for the covariance matrix. Would it work? No idea, i might try it tho.
@CloseToAlgoTrading
@CloseToAlgoTrading 3 года назад
Sounds intresting, deffenetly you should try it. Portfolio optimization methods... It is all about diversification. But if you choose a good assets, you can allocate them randomly and you will get a good profit :). We need to predict futere, but it is difficult :)
@molomono9481
@molomono9481 2 года назад
Anyone teaching you that without outlining how marginal these "modern improvements are" doesn't understand the nature of stock trading. It is very very hard to outperform random, and any slight reproduce-able improvement is already hugely significant. Your ML approach sounds very interesting though, i wish you much luck. I do believe that ML algorithms such as AE or LSTM-VAE or even different types of GANs can help identify patterns that experts would also use to base their investments on. So if you can learn to identify what successful brokers look at as important features and derive a adequate strategy you should be able to make a reliable profit. Assuming investors aren't making 100% of their profit off of market manipulation and inside trading. xD
@nicolerinai
@nicolerinai 3 года назад
Hey, where can one learn how to utilise and execute portfolio optimisation softwares similar to these ? Thank you !
@CloseToAlgoTrading
@CloseToAlgoTrading 3 года назад
Hi, hmm... normally most of the software have support documentation with examples..
@gbh9152
@gbh9152 2 года назад
Thanks for the great content! Let's say if I created my own benchmark instead of using 'SPY', How can I implement it inside the files? (bt_test.py and test_classic_model.ipynb) 😅
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Hi. :) one possible way is just to run it as additional strategy. What kind of benchmark you are going to use? I have some improved code (similar what I used in the video), I'm still using it for test some portfolio based investment idea.. P.s. :) maybe it can be a good material for the next video
@gbh9152
@gbh9152 2 года назад
@@CloseToAlgoTrading I am using it for crypto, but realize SPY as benchmark maybe doesn't make sense. Haha 🙊
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
@@gbh9152 ok.. but it should not be an issue, if I'm still right remember the code, you have two dataframe one for assets and another for benchmark.. It could be whatever you want. BTC for example. However this code is not very sutable if you are going to use something like equally weighted portfolio as benchmark. The simplest way might be run your benchmark and then store the result and compare it with your specific strategy. Or :)) not to use this code directly..
@gbh9152
@gbh9152 2 года назад
@@CloseToAlgoTrading I see, thanks for sharing. Awesome content! Keep it going. 🙏
@1234zztechman
@1234zztechman 2 года назад
Hi, which method is suitable for Natural Gas and Power utility companies?, especially on asset, hedging trades, etc.. Please let me know
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Hi.. Hm.. All of them...
@hl3641
@hl3641 2 года назад
Interesting…! Good job !
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Thanks
@dVidian1
@dVidian1 Год назад
hi. do you do consulting? I need someone to implement portfolio optimization and backtasting in python for my own private portfolio
@CloseToAlgoTrading
@CloseToAlgoTrading Год назад
Hi. Actually I do, but in a slightly different field. 😎 Send me an email with details and your offer...
@srivatsan804
@srivatsan804 Год назад
Why is the Sharpe Ratio so low for all the model's results? Does anybody has answers to this please? And how can we improve it with the given code if anyone has found out?
@CloseToAlgoTrading
@CloseToAlgoTrading Год назад
What will be a good Sharpe for you? It could be for example because of volatility. Momentum strategies are often volatile. This increased risk can lead to a lower Sharpe ratio if the additional returns do not compensate for the additional risk.
@crypticspixels
@crypticspixels 3 года назад
Will you share the csv files that you use in your codes?
@CloseToAlgoTrading
@CloseToAlgoTrading 3 года назад
All code and files in github. Please check the link in description. Or something is missing there?
@crypticspixels
@crypticspixels 3 года назад
Yes ofc, my bad, thanks for the fast reply
@malikarysbekova5310
@malikarysbekova5310 2 года назад
are there similar packages and functions in R?
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Hi, sorry, I don't know. :( I'm not using R.
@adarshmotwani7064
@adarshmotwani7064 2 года назад
Hey - I think the pre train code has an issue. Can't get past "Train Networ". For this line: path = "./saved_data" new_dataset = tf.data.experimental.load(path,element_spec=(tf.TensorSpec(shape=(None, None), dtype=tf.float32, name=None), tf.TensorSpec(shape=(None,), dtype=tf.float32, name=None))) I get an error: NotFoundError: Could not find metadata file. [Op:LoadDataset] Could you please help?
@CloseToAlgoTrading
@CloseToAlgoTrading 2 года назад
Hi.. Hmm.. It might be that you use newer version of tensorflow.. Maybe 2.1 or 2.3 will solve issue
@Shidee1t
@Shidee1t Год назад
I need code for portfolio optimisation using Omega ratio
@CloseToAlgoTrading
@CloseToAlgoTrading Год назад
ChatGPT ;) Sure, here's some sample code for portfolio optimization using Omega ratio in Python: import numpy as np from scipy.optimize import minimize def omega_ratio(weights, returns, target=0): """Calculate Omega Ratio for given portfolio weights""" portfolio_return = np.sum(returns * weights) downside_returns = np.minimum(target - returns, 0) downside_risk = np.sqrt(np.mean(np.square(downside_returns))) if downside_risk == 0: return np.inf omega = portfolio_return / downside_risk return omega def optimize_portfolio(returns, target=0): """Optimize portfolio using Omega ratio""" num_assets = returns.shape[1] initial_weights = np.repeat(1/num_assets, num_assets) bounds = [(0, 1) for i in range(num_assets)] constraints = ({'type': 'eq', 'fun': lambda x: np.sum(x) - 1}) result = minimize(lambda x: -omega_ratio(x, returns, target), initial_weights, method='SLSQP', bounds=bounds, constraints=constraints) return result.x # Example usage returns = np.random.normal(0, 0.05, size=(100, 3)) weights = optimize_portfolio(returns) print('Portfolio weights:', weights) print('Omega ratio:', omega_ratio(weights, returns)) In this code, the omega_ratio function calculates the Omega Ratio for a given portfolio using the formula: Omega = Portfolio Return / Downside Risk The optimize_portfolio function uses the minimize function from the scipy.optimize library to find the portfolio weights that maximize the Omega Ratio. The function takes in the historical returns of several assets and an optional target return value for downside returns. It returns an array of optimal portfolio weights for the given asset returns. You can use this code by calling the optimize_portfolio function with a 2D NumPy array of asset returns, where each row represents a different time period and each column represents a different asset. The function returns an array of portfolio weights that can be used to construct the optimal portfolio.
@tarasst6887
@tarasst6887 Год назад
Сразу слышно, что наш человек
@CloseToAlgoTrading
@CloseToAlgoTrading Год назад
Наших всегда слышно :)
Далее
Day 2 | IEM Rio 2024 | Playoffs | КРNВОЙ ЭФИР
6:11:51
这到底是怎么做到的 #路飞#海贼王
00:10
Просмотров 4,4 млн
Lambda Calculus - Computerphile
12:40
Просмотров 1 млн
Portfolio Optimisation with Higher Moments (Excel)
22:57
Microservices are Technical Debt
31:59
Просмотров 509 тыс.
Conditional Portfolio Optimization
42:09
Просмотров 1 тыс.