QuantStats: Portfolio Analytics with Python Tutorial

  Рет қаралды 28,880

Part Time Larry

Part Time Larry

Күн бұрын

Пікірлер: 59
@parttimelarry
@parttimelarry 3 жыл бұрын
If you like this video and want to support the channel: Buy Me a Drink: www.buymeacoffee.com/parttimelarry Also, I will be starting a spinoff channel on AI in music, art, and gaming in 2023. Subscribe at: youtube.com/@parttimeai Source Code: github.com/hackingthemarkets/quantstats-demo Buy Me a Coffee: buymeacoffee.com/parttimelarry Follow Me: twitter.com/parttimelarry
@brightosisiogu2626
@brightosisiogu2626 3 жыл бұрын
Wow! Larry! You are aging backwards! So much fresher and younger! Thanks for yet another amazingly educative content.
@Patiencelad
@Patiencelad 2 жыл бұрын
Great stuff! Thanks for putting this together. I actually needed to use this with a custom return stream, and although you didn't go into it, seeing you delve into the code helped me find what I needed.
@idevbrandon
@idevbrandon Ай бұрын
I love it and learnt so much from you. Thank you! Have a good day, bro :)
@Caminovic
@Caminovic 3 жыл бұрын
Hi Larry, nice to see you back!!
@PavelSumik
@PavelSumik 3 жыл бұрын
Larry is just a leader in programming, my incredible admiration, I send greetings
@FRANKWHITE1996
@FRANKWHITE1996 3 жыл бұрын
Thanks for sharing! 👍
@alihobballah
@alihobballah Жыл бұрын
This is amazing content !!! quality presentation ! Thank you for making this video.. It's so useful !!!!
@javadvahedi6278
@javadvahedi6278 3 жыл бұрын
Many thanks for your great channel. The video on quantstat was great. A suggestion for next video, would you please have a video about amix strategy based on two indicators, SSL and QQE.
@richardchu1593
@richardchu1593 3 жыл бұрын
Hi Larry, unrelated to this video, but I would like to suggest some potential ideas for future video series/topic: (1) News to Penny Stock Day-Trading: A SQLite database to fetch and store a list of penny stock news for the day during pre-market from TD Ameritrade, than maybe quickly run a NLP against the news articles to return 1 to trade, 0 to pass. Same concept can be applied to Crypto/Binance?
@DevAtul
@DevAtul 2 жыл бұрын
Hi Larry, Thank you for such a good content on Python and finance. I am binge watching your videos. I have a request. There is a paper by Jegadeesh and Titman where they are showing the efficacy of Price momentum and somewhat disproves "Efficient Market Hypothesis." Can you create that portfolio and backtest using Python? Thanks.
@NoToBusinessCasual
@NoToBusinessCasual 3 жыл бұрын
Great topic.
@rithirongk
@rithirongk 2 жыл бұрын
very informative, thx.
@Ro1andDesign
@Ro1andDesign 3 жыл бұрын
Hi Larry, interesting video yet again! Can this library also plot dynamic portfolios and strategies, so non buy-and-hold? E.g. combine this with the ARK invest etfs, but through time based on changing holdings within the etf/portfolio Would love to see it!
@revenge9431
@revenge9431 3 жыл бұрын
Special thanks to Ran Aroussi and PTL as well!
@thomas2004ch
@thomas2004ch 3 жыл бұрын
Interesting! But it seems the portfolio is simply buy and hold. How about if I simply use the SMA cross over strategy? It would be very nice if you could give such an example.
@franky12
@franky12 2 жыл бұрын
Great tutorial. I would be interested to know if and how quantstats can also be used for dynamic portfolios, e.g. to analyze trading strategies in backtesting.
@vdzneladze1
@vdzneladze1 3 жыл бұрын
Larry thank you for great tutorial. I began to worry about 3 weeks pause.
@theodorelee4383
@theodorelee4383 3 жыл бұрын
I was getting this error "Expecting value: line 1 column 1 (char 0)" when running the FB returns query. This is due to having an antiquated version of yfinance, if you're getting the same error just update yfinance using "pip install yfinance --upgrade" love the channel!
@samueltamayogaviria3377
@samueltamayogaviria3377 2 жыл бұрын
hello, is there any way to import a csv with the returns of a personal trading strategy?
@insected83
@insected83 3 жыл бұрын
hot off the press!
@XeitoX506
@XeitoX506 3 жыл бұрын
Hi Larry, could you please explain how to configure a strategy with technical analysis indicator combine with this tool? Great video 👍🏻
@franky12
@franky12 2 жыл бұрын
Do you know the *PyPortfolioOpt* python library that implements portfolio optimization methods?
@illsdom6055
@illsdom6055 2 жыл бұрын
Is it possible to do a portfolio backtest on the asset allocation of the stocks?
@rafaelg8238
@rafaelg8238 2 жыл бұрын
Great a video. Normally you share the code in anywhere? Or another doubt, is possible to show in chart the lines each tickers separated?
@AlexeyZubkov
@AlexeyZubkov 3 жыл бұрын
can you pull data of standard % move prior earnings of company?
@NoToBusinessCasual
@NoToBusinessCasual 3 жыл бұрын
Are we bound to get price history from QS? Can we loop through our own set of Ticker files?
@saviocoelho6229
@saviocoelho6229 6 ай бұрын
Is your portfolio analysis code still running? I tried to make one, but the .utils.make_index function is giving the TypeError: unsupported operand type(s) for +: 'float' and 'str'. This is my code that caused the error: import quantstats as qs qs.extend_pandas() IAC = {"SPY": 1.3, "AGG": -.3} portfolio = qs.utils.make_index(IAC) I even tested with other ticker combinations and directly entering the ticker and weights in make_index and the error repeats in the same way. I also tested in previous versions and the error repeats again. Does anyone know if there is an error in the package or is it my code?
@darshitsarda9632
@darshitsarda9632 5 ай бұрын
same error
@davidreeves8382
@davidreeves8382 Ай бұрын
@@darshitsarda9632 - i reproduced the same error
@kuatroka
@kuatroka Жыл бұрын
Hi, Thanks for the video. A slightly tangential question, but I’m asking since you’re very versed in the Python trading topic. Can you recommend a Python module that analyses the actual transactions? Not the forecasted portfolio earnings based on the past stock price, but something like where I can give it a parquet/csv file with a list of transactions( ticker, entry date, entry quantity, entry price, exit date, exit price) and the Python module would analyse and spit out the profit / loss data. Even for cases where I’m adding or reducing a position with the same ticker or enter and exit the same ticket multiple times for different time periods ( month, quarter, year) So I could see what was my best, worst transaction, etc. Thanks
@parttimelarry
@parttimelarry Жыл бұрын
I'm planning to do a trading journal project where we build something like this, but am working on the machine learning content now. I'm not sure about existing modules for this, I would just write some Python that loads your CSV into a pandas dataframe and do calculations on it there. Or if you don't want to code it yourself there are some existing journal SaaS apps that are free if you make your trades public.
@kuatroka
@kuatroka Жыл бұрын
@@parttimelarry Thanks Larry. It's surprising though that there aren't any big name module for this. Tracking transactions seems like a pretty typical and extremely important investment/trading activity. I think I just need to scout github more conscientiously. Thanks
@nima8830
@nima8830 3 жыл бұрын
Well done Larry. Are these concepts applicable to intraday algorithmic strategies?
@parttimelarry
@parttimelarry 3 жыл бұрын
This is a long term portfolio analysis library, so not for short term trading
@karthickb1973
@karthickb1973 Жыл бұрын
i am trying to workaround simply by cumulating intraday returns to daily returns
@jessojohn9226
@jessojohn9226 2 жыл бұрын
can you do a video on integrating backtrader with quant stats to produce performance report?
@davidreeves8382
@davidreeves8382 Ай бұрын
i tried the index - using META instead of FB and I get the error message: TypeError: unsupported operand type(s) for +: 'float' and 'str'. Any ideas?
@emskiphoto
@emskiphoto 3 жыл бұрын
Thanks to Larry and Ran Aroussi
@safishajjouz166
@safishajjouz166 2 жыл бұрын
There is a caveat. The library does not download adjusted close prices. So, you should be careful of what returns we are talking about.
@thomasforsythe9951
@thomasforsythe9951 3 жыл бұрын
How do I use a specific date for benchmarking?
@moeunit676767
@moeunit676767 Жыл бұрын
What did you do at 8:31 to highlight and change everything green. Sorry I am a novice. Thank you
@parttimelarry
@parttimelarry Жыл бұрын
I commented out all the selected lines by pressing command and /
@moeunit676767
@moeunit676767 Жыл бұрын
@@parttimelarry thank you so much for answering. Subscribed and cant wait to watch more content. I am going to do a little more walking before i run after this but I want to complete it so I apologize for another question. I copy and pasted your code for charting GLD and got this error " File "C:\Users\willi\AppData\Local\Programs\Python\Python311\Lib\site-packages\pandas\core\ops\invalid.py", line 36, in invalid_comparison raise TypeError(f"Invalid comparison between dtype={left.dtype} and {typ}") TypeError: Invalid comparison between dtype=datetime64[ns, America/New_York] and datetime"
@patite3103
@patite3103 2 жыл бұрын
Thank you for the video! For the code "fmaga = portfolio = qs.utils.make_index(tickers)" I get an error: module 'quantstats.utils' has no attribute 'make_index' Could someone solve this problem? Thanks
@danielrv1325
@danielrv1325 3 жыл бұрын
How do you change the date to download the data? I tried to change period to a data and it is not working
@alexanderfiner7552
@alexanderfiner7552 3 жыл бұрын
Awesome work Larry - the only thing is I don't see the code on github :(
@parttimelarry
@parttimelarry 3 жыл бұрын
Hey thanks! Oops, just pushed it: github.com/hackingthemarkets/quantstats-demo
@alexanderfiner7552
@alexanderfiner7552 3 жыл бұрын
@@parttimelarry Thanks man very much appreciate it. I work as an assistant investment analyst, I love the bit about even managers can understand the code, it's actually a very accurate statement haha. These tear sheets or known as factsheets, are valued by highly clients, but often it's necessary to explain each aspect of the metrics used etc. I've run the code you've uploaded, the only error I get is ---- FileNotFoundError: [Errno 2] No such file or directory: 'output/gld.html' / No such file or directory: 'output/fb_earnings.png' - maybe I need to change a directory somewhere?
@parttimelarry
@parttimelarry 3 жыл бұрын
​@@alexanderfiner7552 hey, if you copied down individual scripts, I would create a directory called "output" in the same directory where you are running the script. or you can remove the "output/" part of the path and it will write the files to the same directory.
@alexanderfiner7552
@alexanderfiner7552 3 жыл бұрын
@@parttimelarry Thanks soo much mate
@corteman
@corteman 3 жыл бұрын
I wonder if it works with futures/micro futures...
@mr.gk5
@mr.gk5 2 жыл бұрын
Does this work with foreign stocks?
@xxmrfreexx
@xxmrfreexx 3 жыл бұрын
Is there anyway to accept work as lancer ?
@AirForceA7x
@AirForceA7x 3 жыл бұрын
What Reddit chat did you find this package?
@rancholaflorida1168
@rancholaflorida1168 3 жыл бұрын
Your fundamental analysis it's sucks , but your code it's clean and powerful
@Sam-lx1lu
@Sam-lx1lu Жыл бұрын
Getting this error for some of the code snippets: from : qs.reports.html(stock, title='Test', output='output/TSLA.html') Exception has occurred: TypeError DataFrame.pivot() takes 1 positional argument but 4 were given File "C:\Users\Samue\Desktop\Python\PY.py", line 10, in qs.reports.html(stock, title='Test', output='output/TSLA.html') TypeError: DataFrame.pivot() takes 1 positional argument but 4 were given
Walk Forward Optimization with VectorBT and Alpaca
36:06
Part Time Larry
Рет қаралды 19 М.
Historical Fear and Greed Index Data, Jupyter Notebooks
20:09
Part Time Larry
Рет қаралды 19 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 15 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
HOOOTDOGS
Рет қаралды 2,8 МЛН
8. OpenAI Financial Advisor Q&A Embeddings - Python Tutorial
28:53
Part Time Larry
Рет қаралды 29 М.
3. OpenAI API Python - Earnings Call Summarization
20:54
Part Time Larry
Рет қаралды 37 М.
Pandas TA Tutorial
27:00
Part Time Larry
Рет қаралды 46 М.
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 705 М.
QuantConnect LEAN Algorithmic Trading Engine - Getting Started
46:08
Part Time Larry
Рет қаралды 63 М.
Tech I'm Learning in 2023, Free Courses and Books
23:33
Part Time Larry
Рет қаралды 18 М.
Finding Breakout Candidates with Python and Pandas
29:33
Part Time Larry
Рет қаралды 70 М.
Prediction Markets with the Kalshi API (Python Tutorial)
17:52
Part Time Larry
Рет қаралды 7 М.
Technical Analysis Library in Python Tutorial
22:24
Part Time Larry
Рет қаралды 51 М.
Когда отец одевает ребёнка @JaySharon
00:16
История одного вокалиста
Рет қаралды 15 МЛН