Algorithmic Trading - Machine Learning & Quant Strategies Course with Python

  Рет қаралды 529,796

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

In this comprehensive course on algorithmic trading, you will learn about three cutting-edge trading strategies to enhance your financial toolkit. In the first module, you'll explore the Unsupervised Learning Trading Strategy, utilizing S&P 500 stocks data to master features, indicators, and portfolio optimization.
Next, you'll leverage the power of social media with the Twitter Sentiment Investing Strategy, ranking NASDAQ stocks based on engagement and evaluating performance against the QQQ return. Lastly, the Intraday Strategy will introduce you to the GARCH model, combining it with technical indicators to capture both daily and intraday signals for potential lucrative positions.
✏️ Course developed by @lachone_
💻 Code and course resources: github.com/Luchkata/Algorithm...
🔗 You can sign up for the data API used here: intelligence.financialmodelin...
🔗 Learn more about Lachezar and Quantitative Trading with Python here: www.quantfactory.ai/p/become-...
⭐️ Contents ⭐️
0:00:00 - Algorithmic Trading & Machine Learning Fundamentals
0:15:25 - Building An Unsupervised Learning Trading Strategy
2:05:08 - Building A Twitter Sentiment Investing Strategy
2:28:08 - Building An Intraday Strategy Using GARCH Model
🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Пікірлер: 230
@sanethehappypill
@sanethehappypill 3 ай бұрын
One thing I like about trading, everyone has an opinion n yet few are making money 💵
@nobodyknows3560
@nobodyknows3560 Ай бұрын
well there are some making money, else there won't be big hedge funds
@bokoaruka9819
@bokoaruka9819 29 күн бұрын
@@nobodyknows3560 the big hedge funds won't share their opinions clearly though, only vaguely
@sweealamak628
@sweealamak628 6 ай бұрын
This has been a privilege. I worked in finance for a long time but never had the chance to see what goes on behind the scenes at fund management. I was only exposed to traditional portfolio managers who's strategies were thematic in nature and qualitatively driven. I'll probably never use any of these techniques or strategies for personal finance but it really gets you thinking of how things can be approached from a large portfolio perspective. GARCH model is daunting but this inspires me to finally understand what my boss was talking about all those years ago 😅
@sweealamak628
@sweealamak628 6 ай бұрын
Turns out I can't even get the arch package to work. After pip install arch, can't even import it in Jupyter NB. 🤷🏻‍♂️
@eoinmcnulty5363
@eoinmcnulty5363 5 ай бұрын
GARCH is only daunting if you don't understand it.
@natel.1059
@natel.1059 5 ай бұрын
Thanks for sharing! For the 1st project, I wonder how the clustering is different from selecting top RSI stocks in each month given RSI is not normalized? Or is it just for demoing the possibility of using the clustering algo?
@femifasusi453
@femifasusi453 6 ай бұрын
Awesome 😎. I have been looking and waiting for this topic. Good job 👌❤️
@YouTuberTV-mc7wm
@YouTuberTV-mc7wm 3 ай бұрын
I love your analysis, always on the point. And yes, Xeventy is a game changer. Great project!
@Tiger-ep6hc
@Tiger-ep6hc 4 ай бұрын
the .loc doesn't fix the error encountered at 51:30 with values starting from 2020. It is actually the rolling average calc parameter min_periods=12 that you set that fixes the issue...
@ShadowMind312
@ShadowMind312 6 ай бұрын
A fellow Bulgarian! Congratulations on your success, Lachezar!!
@lachone_
@lachone_ 6 ай бұрын
Thank you mate, cheers!
@jaimem1325
@jaimem1325 6 ай бұрын
Bulgarians don't play around, you know you stopped caring what people think when you don't code in dark mode.
@munivoltarc
@munivoltarc 6 ай бұрын
I am amazed to see algo videos rarely on KZbin. I appreciate your work. Could you please make a similar kind of video on price action algo trading with Wyckoff multi-timeframe analysis, without using any indicators, and generate trades live through your machine learning or AI models? Many people are eagerly waiting to see these kinds of videos, but no one has ever made any price action trading videos. I request you to do so at the earliest. Thank you, Muni Babu
@flexorx
@flexorx 6 ай бұрын
Are you sure successful quant funds really trade Wyckoff, or what's worth - Fibonacci retracements? 😅
@munivoltarc
@munivoltarc 6 ай бұрын
@@flexorx what ever they do, price action plays right, that enough for us...😏
@sophiophile
@sophiophile 6 ай бұрын
If you are concerned about stocks that fall out of tne S&P500 (survivorship bias), you could have just checked the top 150 against those that were always present in the S&P500 and then dropped those that werent from your dataset. (Or set some cut-off where it had to be present at least x% of the time)
@hammam92
@hammam92 28 күн бұрын
Can you explain more about this?
@albertohernandezaldamiz-ec2020
@albertohernandezaldamiz-ec2020 3 ай бұрын
Really interesting video. Thanks there are still people with the goal to teach. While I continue with my learning I have bought two bots for ES and NQ just to see how they work and they are giving me nice extra money for the last months. This also gives me the conviction that the authomated strategies could really work fine.
@classicmedia001
@classicmedia001 5 ай бұрын
Can you clarify whether survivorship bias occurs when including data from a company that has gone bankrupt, or when excluding data from a company that has faced bankruptcy?
@franciscogamarra10
@franciscogamarra10 6 ай бұрын
Hi, very good video and good job! But the daily signal volatility definition needs to be more conservative i.e. 1 std and not 1.5 std, due to the high CV of the signal ( to improve the results)
@Ivelin
@Ivelin 5 ай бұрын
Excellent video. Thank you!
@argu2026
@argu2026 6 ай бұрын
Thank you! Exactly what I've been looking for :3
@lukhanyovictor
@lukhanyovictor 4 ай бұрын
Are u a computer scientist?
@johnsmith-qc8ud
@johnsmith-qc8ud 5 ай бұрын
Great video! Unfortunately normalization procedure in it introduces lookahead bias. You can't use the full range of values to calculate mean and stdev, you can only use the data from earlier dates at any given point of time.
@loganbishop4619
@loganbishop4619 4 ай бұрын
He collapses it to the end of the month. The number your swing consist of days before
@Zlatanov688
@Zlatanov688 6 ай бұрын
Thank you for this treasure! Just bought your other course. Can’t wait to finish it🎉
@richardsifeanyi6766
@richardsifeanyi6766 6 ай бұрын
Thanks for this. I've been looking forward to it. 🙏
@lukhanyovictor
@lukhanyovictor 4 ай бұрын
Are u a computer scientist?
@Techify09
@Techify09 6 ай бұрын
Really good video iam curious can we apply this algoritmic trading to Forex markets?
@xyzplusxyzis2xyz
@xyzplusxyzis2xyz 6 ай бұрын
Your KMeans clustering is totally useless when you're not normalizing the RSI values. In essence all the other features are just small noise in the clustering and you end up making the wrong conclusion that RSI is the main feature driving the clustering in your data.
@vzinko
@vzinko 5 ай бұрын
this is correct. upvoted
@Artificial_Eagle
@Artificial_Eagle 3 ай бұрын
Yep, the clustering part was only to make the "algo" more appealing. I thought he would have actually analyze each cluster trying to find useful features...
@TyTy-gm8yb
@TyTy-gm8yb 2 ай бұрын
This example is for intra-day and day-trading as specified at the beginning of the video. After a quick research the best indicator for this kind of trading is the RSi. Due to this the main feature chosen by him is the RSI because it is the best indicator for this kind of trading strategies.
@bobthebuilder9416
@bobthebuilder9416 2 ай бұрын
Based comment
@nilomartinezjr4108
@nilomartinezjr4108 Ай бұрын
@@TyTy-gm8yb RSI is not the best indicator. It shows basically what has already happened in the past. It is by no means usable in a forecast model. Should you want to have useful data you could try using Money Flow, or simple price action with Volume. Or if possible, you can create a model using real time agression.
@classicmedia001
@classicmedia001 5 ай бұрын
Please could you recommend books on algorithmic trading with python or machine learning???
@classicmedia001
@classicmedia001 5 ай бұрын
does yfinance has survivorship -bias free data?
@dirty_haute
@dirty_haute 6 ай бұрын
It's not about beating the market, its about having an unsolvable problem that you can always use to learn against.
@over1498
@over1498 4 ай бұрын
Lol. It's about beating the market.
@leander79416
@leander79416 27 күн бұрын
spectacular free content - thank you SO much
@DesignMitho
@DesignMitho 6 ай бұрын
Thank you, I was looking for it!
@lukhanyovictor
@lukhanyovictor 4 ай бұрын
Good day , I would like to work with you on FOREX trading strategies
@tabotcharlesbessong3756
@tabotcharlesbessong3756 4 ай бұрын
Thank you so much for this Free Code Camp
@tabotcharlesbessong3756
@tabotcharlesbessong3756 4 ай бұрын
Please 🙏 🥺 do same for real estate
@natel.1059
@natel.1059 4 ай бұрын
Thanks for sharing the video. Can anyone help me understand the daily signal part in the GARCH modeling? Is the belief that the higher predicted return volatility leads to a higher projected return? Doesn't higher volatility mean higher risk?
@natel.1059
@natel.1059 4 ай бұрын
NVM, the logic is reversed in the later code
@user-ey2qe2qv4s
@user-ey2qe2qv4s 2 ай бұрын
How to get the current twitter sentiment data for real time trading?
@PATRADER555
@PATRADER555 3 ай бұрын
Is quant for only stocks ? I haven't come across the major currencies.
@joemaruhhh
@joemaruhhh 9 күн бұрын
Very valuable information, thanks for your work!
@sabernajar5401
@sabernajar5401 2 ай бұрын
Hello thanks a lot for this tutorial, is there any way to download the code please ?
@TheAsselmeier
@TheAsselmeier 5 ай бұрын
A good future use case might be the production, storage, use and trade of electricity in a household. Solar panels are so cheap, electricity is quite expensive/ volatile due to renewables at times. Electrification/ automatisation of households, variable prizes from providers, self production (photovoltaic cells), storage (e-cars, warm water, iot, refurbished battery cells,...), weather forecast,...
@lucassanchez5939
@lucassanchez5939 2 ай бұрын
MIL GRACIAS POR LOS SUBTÍTULOS EN ESPAÑOL❤❤❤❤❤
@scarbz
@scarbz 6 ай бұрын
Perfect for my Quant journey
@brianoconner8405
@brianoconner8405 4 ай бұрын
Are you following quant?
@rantg
@rantg 3 ай бұрын
your quant journy will end soon when you realize it is just not possible, at all, you live in a dream if you think it is. There are just a small number of large organizations who can do this efficiently, it requires much more than a laptop.
@jameswhand
@jameswhand 6 ай бұрын
Pretty cool! Thanks a lot!😁
@coldbrewed8308
@coldbrewed8308 4 ай бұрын
How do we generate the twitter sentiment dataset by ourself?
@user-hn4dw8qt6c
@user-hn4dw8qt6c 2 ай бұрын
Tested with data until today (feb-22-2024) and a 1:18:00 there were different clusters 3, on dec-31 there was a cluster with rsi = 80 and other where the top rsi was around 60
@yawvoon2941
@yawvoon2941 6 ай бұрын
Thanks!
@ashutoshshukla2325
@ashutoshshukla2325 5 ай бұрын
I think that you will win " The Python One Liner Award" !
@parththakkar2067
@parththakkar2067 6 ай бұрын
Can you make for nse(india) trading. Because there is lot of freelancing job opportunity, but I can't find any good material or course to learn the algorithmic trading specifically for nse.
@manjeshsumukh2844
@manjeshsumukh2844 6 ай бұрын
Is there trading based freelancing in India?
@ashutoshshukla2325
@ashutoshshukla2325 6 ай бұрын
I think he means portfolio management.
@tushartiwari7929
@tushartiwari7929 4 ай бұрын
Don't bother with Indian clients on freelancing website for trading. They suck your time and not worth it. And trading on nse is no different than any other market if you get the fundamentals right.
@leJ226
@leJ226 6 ай бұрын
Thanks 🎉
@juergenx298
@juergenx298 5 ай бұрын
Very good content!
@sportingmeme3606
@sportingmeme3606 6 ай бұрын
This algorithmic trading can be applied to any liquid traded financial market like forex,stocks,and crypto , right?
@WolfAssassin75
@WolfAssassin75 5 ай бұрын
yes
@lukhanyovictor
@lukhanyovictor 4 ай бұрын
Good day , I would like to work with you on FOREX trading strategies
@darkstorm2653
@darkstorm2653 3 ай бұрын
Do you build trading bots for fee?
@NoDepositBonusForexToday
@NoDepositBonusForexToday Ай бұрын
Thank you!
@sahoodsd
@sahoodsd 2 ай бұрын
does anyone else having error in the part where calculating rolling five year average of dollar_volumn and reassigning to the dollar_volumn column which converts every values to Nan code:- data['dollar_volume'] = data['dollar_volume'].unstack('Ticker').rolling(5*12).mean().stack()
@ahmedalsaedi3849
@ahmedalsaedi3849 2 ай бұрын
one critic use dark mode, it better at contract and healthier for you eyes
@VinayakGNair
@VinayakGNair 29 күн бұрын
Is there any tutorial available which can reach how to get real-time data offered by brokers and place trade using api provided by broker. All these are in jupyter notebooks. I'm looking for something in real code which can run continuously
@user-oz5dc7xw4v
@user-oz5dc7xw4v 6 ай бұрын
Great tutorial. Stuck on macd function though. Doesn't seem to work as is.def compute_macd(close): macd = pandas_ta.macd(close=close, length=20).iloc[:,0] return macd.sub(macd.mean()).div(macd.std())
@lukhanyovictor
@lukhanyovictor 4 ай бұрын
Good day , I would like to work with you on FOREX trading strategies
@DiegoAbal
@DiegoAbal Ай бұрын
same error
@gibran.a.d
@gibran.a.d 6 ай бұрын
supperrrbzz...amazing..
@sajadghamari4748
@sajadghamari4748 4 ай бұрын
23:50 I guess ln is different from log in math which you used it in place of it.
@justchris846
@justchris846 6 ай бұрын
I’m so glad I have a day job!
@suraj.panddey
@suraj.panddey 3 ай бұрын
The api 'Sandbox api' you used in your previous video has stopped working.Any fix for this ?
@gawincheung317
@gawincheung317 Ай бұрын
got an error on Calculate Rolling Factor Betas (58:04) . error message indicate : min_nobs must be larger than the number of regressors in the model and less than window. May i ask how can i resolve it ?
@thetatso9462
@thetatso9462 3 ай бұрын
thanks mate you are a champ
@namanmadan5994
@namanmadan5994 4 ай бұрын
little confused if you took stocks with RSI around 70 of the previous month what was the logic to use a lot of features
@ennuiofpolicy
@ennuiofpolicy 2 ай бұрын
I am on the same page with you. Have you got any response regarding that?
@kundansonawane849
@kundansonawane849 6 ай бұрын
Thanks ❤
@yzqq748
@yzqq748 5 ай бұрын
For number 2, an error says "AttributeError: 'NoneType' object has no attribute 'iloc'". What shoud I do with this?
@Dcborge
@Dcborge 25 күн бұрын
I am getting the same error and cannot find a workaround.
@VictorsTravelvLog
@VictorsTravelvLog 4 күн бұрын
i am confused. so you use kmeans clustering to select stocks. then you use 1 year of stock prices and efficient frontier to calculate weight of component stocks. you use 18 features to fit a regression model to get the beta coefficients, which basically tells you the weights of the features on each stock. however, you never use the regression model to make predictions. you only use the betas for clustering? so your 'model' does not have forecasting ability? or does it? and where is the bollinger bands and macd used?
@sophiophile
@sophiophile 6 ай бұрын
1:34:23 Why do you take the log of the returns?
@christianc8265
@christianc8265 3 ай бұрын
usually the log returns supposed to follow a normal distribution more closely. well it still doesn't. you would need tick data and use volume instead of time to get really close to a normal distribution.
@FX-Avatar
@FX-Avatar 18 күн бұрын
How much Profit did You do with this ? Thanks for the Info!
@alpserbetli6219
@alpserbetli6219 11 күн бұрын
how did you obtain the sentiment data sir ?
@anatolyalekseev101
@anatolyalekseev101 2 ай бұрын
Doesn't it bother anyone that clustering is done on the ENTIRE dataset? and further asset selection is done month by month using cluster label that was computed using future data?
@MrAless77m
@MrAless77m 3 ай бұрын
In the Project 1 in the point 6 when clustering, there is an error alert saying that: KeyError: "['cluster'] not found in axis" - Any advice? thanks
@philipp2117
@philipp2117 3 ай бұрын
I had the same , think the variable is not set and you need to drop it as its set only later if "cluster" in data.columns: data = data.drop('cluster', axis=1)
@MrAless77m
@MrAless77m 3 ай бұрын
@@philipp2117 Here you go: from sklearn.cluster import KMeans if 'cluster' in data.columns: data = data.drop('cluster', axis=1) def get_clusters(df): df['cluster'] = KMeans(n_clusters=4, random_state=42, init=initial_centroids).fit(df).labels_ return df data = data.dropna().groupby('date', group_keys=False).apply(get_clusters) data
@mickolesmana5899
@mickolesmana5899 4 ай бұрын
thanks, now i can buy item in Jita
@WUNNA3500
@WUNNA3500 3 ай бұрын
underrated
@mohamedaityoussef9965
@mohamedaityoussef9965 6 ай бұрын
Youve went from coding to trading lol, tganks for everything
@jagjeetchauhan9456
@jagjeetchauhan9456 6 ай бұрын
I am getting error in this line df.unstack('ticker')['dollar_volume'].resample('M') can anyone tell me how to solve this error?
@davidvandenbussche7361
@davidvandenbussche7361 6 ай бұрын
same here, how did you solve it?
@Elnur.Zarabi
@Elnur.Zarabi 5 ай бұрын
last_cols = [c for c in df.columns.unique(0) if c not in ['dollar_volume', 'volume', 'open', 'high', 'low', 'close']] # data = (pd.concat([df.unstack('ticker')['dollar_volume'].resample('M').mean().stack('ticker').to_frame('dollar_volume'), # df.unstack()[last_cols].resample('M').last().stack('ticker')], # axis=1)).dropna() #df.unstack(['ticker','date'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean() data = (pd.concat([df.unstack(['ticker'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean().stack('ticker').to_frame('dollar_volume'), df.unstack()[last_cols].reset_index('date').set_index('date').resample('M').last().stack('ticker')], axis=1)).dropna() data
@noneofyourbusiness8625
@noneofyourbusiness8625 6 ай бұрын
I love this so much ahahaha lets go!!!
@wrawlings146
@wrawlings146 2 ай бұрын
Is any one else getting "None of ['index'] are in the columns" error about 1:57:00 when calculating wights?
@hammam92
@hammam92 20 күн бұрын
change 'index' to "Ticker".
@pranavsingh1947
@pranavsingh1947 16 күн бұрын
@@hammam92 pls tell where
@hammam92
@hammam92 16 күн бұрын
@@pranavsingh1947 bro give me the code that gives the error.
@Maximus18.6
@Maximus18.6 Ай бұрын
Such an amazing video an content. You are magic, this content opens the door to explore different quantum trading strategies assited with artificial intelligence. For those who put destructive opinions , please fck yourselves and criticised when you contribute something. This is an awesome approach for beginners in the algorithm trading and machine learning field. This is the main stone for my project to develop an algorithmic trading strategy using quantitative methods, machine learning and artificial intelligence to create profitable long ansd short entry positions
@chaitanyasharma2385
@chaitanyasharma2385 6 ай бұрын
Is anyone else having trouble with the following line of code: df['bb_low'] = df.groupby(level=1)['adj close'].transform(lambda x: pandas_ta.bbands(close=np.log1p(x), length=20).iloc[:,0]) Apparently, pandas.tt_bands() returns none, but that doesn't seem to be the case in the video
@oneouthere
@oneouthere 6 ай бұрын
If you are pulling current price data, VLTO does not have enough price history. Try removing it from the symbols_list and see if that fixes the issue.
@alfredozuloaga8326
@alfredozuloaga8326 6 ай бұрын
I have same issue, complety stop.
@ohsd186
@ohsd186 6 ай бұрын
same issue!
@ohsd186
@ohsd186 6 ай бұрын
I changed 'length 20' to 'length 10'. Like this: df['bb_low'] = df.groupby(level=1)['adj close'].transform(lambda x: pandas_ta.bbands(close=np.log1p(x), length=10).iloc[:,0]). It worked, but I don't know why.
@AlanJereb
@AlanJereb 6 ай бұрын
@@oneouthere this is the correct answer.
@ml11566
@ml11566 2 ай бұрын
8:08 Workflow Process: 1. Collect and prepare the data, 2. Develop a hypothesis for a strategy, 3. Coding the model, 4. Backtest the strategy 9:19 Unsupervised Learning Project- uses ML strats without a labeled or predefined target variable. Unlike supervised learning because the model is not trained to make predictions, but to extract insights from data 12:45 Sentiment Investing Project - how people feel about stocks can impact stock prices/industries/overall market 14:04 Intraday Strategy Project- intraday approach means to buy/sell financial assets in same trady day to profit from short term price movements. Traders use real time data and risk management to make quick decisions and capitalize on market volatility 2:10:51
@MGh-fb4bt
@MGh-fb4bt 6 ай бұрын
I got an error in the following line of code: Code: df.unstack()[last_cols].resample('M').last().stack('ticker') Error: KeyError: 'Level ticker not found' Anybody can help?
@Elnur.Zarabi
@Elnur.Zarabi 5 ай бұрын
this is what I could make of it: last_cols = [c for c in df.columns.unique(0) if c not in ['dollar_volume', 'volume', 'open', 'high', 'low', 'close']] # data = (pd.concat([df.unstack('ticker')['dollar_volume'].resample('M').mean().stack('ticker').to_frame('dollar_volume'), # df.unstack()[last_cols].resample('M').last().stack('ticker')], # axis=1)).dropna() #df.unstack(['ticker','date'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean() data = (pd.concat([df.unstack(['ticker'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean().stack('ticker').to_frame('dollar_volume'), df.unstack()[last_cols].reset_index('date').set_index('date').resample('M').last().stack('ticker')], axis=1)).dropna() data
@DalazG
@DalazG 3 ай бұрын
Is this transferable to forex trading?
@TheAISmarthub
@TheAISmarthub 6 ай бұрын
I have trading model that’s proven and I’ve broken down. Would there be anyone with quant experience willing to take my parameters and incorporate into a systematic trading algorithm?
@mohngumba3079
@mohngumba3079 3 ай бұрын
Could somebody please help out i have an issue with the chapter 3 starting from timestamp 34:02 saying a TypeError and after that the whole chapter doesn't work its affected the other chapters also
@mohngumba3079
@mohngumba3079 3 ай бұрын
TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index' this is what i get i even copied the code from the github but still gives me this problem. Could i get some help
@user-el3lk1jj4j
@user-el3lk1jj4j 25 күн бұрын
how do i install the anaconda prompt? i have python and vscode on my computer. thank you
@Experimento0001
@Experimento0001 6 ай бұрын
I'm getting this error in the concatenation part: last_cols = [c for c in df.columns.unique(0) if c not in ['dollar_volume', 'volume', 'open', 'high', 'low', 'close']] data = (pd.concat([df.unstack('ticker')['dollar_volume'].resample('M').mean().stack('ticker').to_frame('dollar_volume'), df.unstack()[last_cols].resample('M').last().stack('ticker')], axis=1)).dropna() data TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'
@davidvandenbussche7361
@davidvandenbussche7361 6 ай бұрын
same here, have you solved it?
@madhurshinde4988
@madhurshinde4988 6 ай бұрын
same error, did you get the solution?
@davidvandenbussche7361
@davidvandenbussche7361 6 ай бұрын
@@madhurshinde4988 So far I did the following: last_cols = [c for c in df.columns.unique(0) if c not in ['dollar_volume', 'volume', 'open', 'high', 'low', 'close']] test = df.unstack('ticker')['dollar_volume'] test.index = pd.to_datetime(test.index) test2 = df.unstack()[last_cols] test2.index = pd.to_datetime(test2.index) data = (pd.concat([test.resample('M').mean().stack('ticker').to_frame('dollar_volume'), test2.resample('M').last().stack('ticker')], axis=1)).dropna() data be aware however that this method drops certain stocks in my case thus I have an empty dataframe after a few transformations and can't continue, I believe it's because if any of the tickers don't have data for the entire period of time covered by the DataFrame, they will be dropped during the resampling process.
@Elnur.Zarabi
@Elnur.Zarabi 5 ай бұрын
same problem
@Elnur.Zarabi
@Elnur.Zarabi 5 ай бұрын
last_cols = [c for c in df.columns.unique(0) if c not in ['dollar_volume', 'volume', 'open', 'high', 'low', 'close']] # data = (pd.concat([df.unstack('ticker')['dollar_volume'].resample('M').mean().stack('ticker').to_frame('dollar_volume'), # df.unstack()[last_cols].resample('M').last().stack('ticker')], # axis=1)).dropna() #df.unstack(['ticker','date'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean() data = (pd.concat([df.unstack(['ticker'])['dollar_volume'].reset_index('date').set_index('date').resample('M').mean().stack('ticker').to_frame('dollar_volume'), df.unstack()[last_cols].reset_index('date').set_index('date').resample('M').last().stack('ticker')], axis=1)).dropna() data
@KV45355
@KV45355 29 күн бұрын
how do you present something like this in a portfolio?
@kumkan3588
@kumkan3588 5 ай бұрын
More Algo videos please
@YaraYara-fw7vh
@YaraYara-fw7vh Ай бұрын
thanks
@JuanYoga
@JuanYoga 18 күн бұрын
01:04:25 "From this point on things can get really complicated." So, the previous hour was just the warm-up? *gulps nervously*
@epo295
@epo295 6 ай бұрын
this thing is for students of python code. Not traders. But good video non the less
@tejasgala5092
@tejasgala5092 17 күн бұрын
I'm getting an "'NoneType' object has no attribute 'iloc'" error here @27:02 for bollinger bands and cant seem to find the solution: df['bb_low'] = df.groupby(level=1)['adj close'].transform(lambda x: pandas_ta.bbands(close=np.log1p(x), length=20).iloc[:,0]) can someone please help?
@VictorsTravelvLog
@VictorsTravelvLog 4 күн бұрын
your ta.bbands did not return a dataframe. nontype means it's not a dataframe. do ta.bbands on df.xs('AAPL',level=1)['adj close' ] to see if you get a dataframe. maybe you stack it the wrong way?
@sophiophile
@sophiophile 6 ай бұрын
2:27:59 LOL, the twitter sentiment trading strategy was killing it right up until Elon Musk bought twitter. Hahah
@vintage2069
@vintage2069 6 ай бұрын
Anyone else running into issues trying to install the pip packages or is it just me? Any solutions?
@epictetus__
@epictetus__ 6 ай бұрын
Bookmark: 15:00
@pedrokotii2417
@pedrokotii2417 6 ай бұрын
Nice!
@janoskovacs3237
@janoskovacs3237 4 ай бұрын
First 2 hours was ok, mainly about getting some basics about panda, and some clustering idea, though what I miss that if I understand correctly re-balancing/weigthing happens on montly basis, which at 150 security (worst case) it takes big amount of money as most of trading platform has minimum fees, as a consequences probably your extra strategy profit would be eaten by cost. It was fun, but I have doubts that's the way to get rich :)
@alpserbetli6219
@alpserbetli6219 8 күн бұрын
## 6. Calculate Portfolio Returns with monthly rebalancing portfolio_df gives empty return:( I am npt be able to fix that issue. please help me pn this if you have find some time sir
@alpserbetli6219
@alpserbetli6219 8 күн бұрын
interestingly returns_df .dropna() erase all dataframe:(
@passaroquetemasanaovoa
@passaroquetemasanaovoa 6 ай бұрын
Nobody knows what's going to happen in the stock market. The tech stack is interesting though.
@kitchiu4743
@kitchiu4743 Ай бұрын
Now the code doesn't work!!!
@pianoguyswe
@pianoguyswe 6 ай бұрын
Well, good luck making this profitable.... 😄There are exactly zero profitable strategies out in the open like this, for the simple reason that everyone who actually comes up with something profitable will keep is to themselves so as not to lose their edge on the market.
@ThayHa-wg9si
@ThayHa-wg9si 3 ай бұрын
Don't miss the chance to be part of the Xeventy presale guys! Easy 50x till the end of the year, and I´m a very conservative
@natnaelabayneh7664
@natnaelabayneh7664 6 ай бұрын
4 hours into the course already, such a great mentor and way of teaching
@harikrishan2641
@harikrishan2641 6 ай бұрын
But the Total Video length as shown above is 2:59 hrs only
@reho5081
@reho5081 6 ай бұрын
Where is the additional hours from?
@weddou100
@weddou100 6 ай бұрын
bro is lying
@thamsanqamafuna2398
@thamsanqamafuna2398 6 ай бұрын
Very Funny.
@DuyNamTruong
@DuyNamTruong 3 ай бұрын
I think Xeventy´s XVT will be one of the top performers in bullrun 2024/2025.
@user-gl9tr6eq7e
@user-gl9tr6eq7e 6 ай бұрын
I'm a former quant. Back in my days we used to write all the algorithms ourselves on c++, including the Greeks to price options, multidimensional volatility surface(48) calculations per trad, etc.. Now days being a "data scientist" and a "quant" its about being just popular on social media.
@thenoblegod
@thenoblegod 5 ай бұрын
Hey,since you are a former quant ,I found it really intriguing .I'm currently working on a script for currency analysis and since I'm relatively new to the quant world , I'd love to connect and chat about it .Maybe we could share some insights and experiences .Let me know if you're open to it. Cheers!
@GoodaJayz
@GoodaJayz 4 ай бұрын
@@thenoblegodplease let me know when he messages you
@LevelUpWay
@LevelUpWay 3 ай бұрын
👏👏👏
@samyiga4449
@samyiga4449 17 күн бұрын
do you make bot for trading forex please?
@user-vu9lh5zz5i
@user-vu9lh5zz5i Ай бұрын
дедок лучший!!!
Python Machine Learning Tutorial (Data Science)
49:43
Programming with Mosh
Рет қаралды 2,7 МЛН
Prompt Engineering Tutorial - Master ChatGPT and LLM Responses
41:36
freeCodeCamp.org
Рет қаралды 1,2 МЛН
MINHA IRMÃ MALVADA CONTRA O GADGET DE TREM DE DOMINÓ 😡 #ferramenta
00:40
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Рет қаралды 15 МЛН
船长被天使剪成光头了?#天使 #小丑 #超人不会飞
00:28
超人不会飞
Рет қаралды 26 МЛН
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 16 МЛН
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 597 М.
Why Independent Quants Don't Exist
10:14
Dimitri Bianco
Рет қаралды 44 М.
I Tried Day Trading w/ a Trading Bot Algorithm
14:01
Daniel Inskeep
Рет қаралды 846 М.
Jim Simons: How To Achieve a 66% Return Per Year (7 Strategies)
15:27
Cooper Academy
Рет қаралды 773 М.
OpenAI Assistants API - Course for Beginners
3:32:55
freeCodeCamp.org
Рет қаралды 159 М.
How Financial Firms Actually Make Money
22:40
QuantPy
Рет қаралды 318 М.