Пікірлер
@theoretical-b1h
@theoretical-b1h 18 сағат бұрын
Thank the KZbin algorithm for finding you, and thank you for giving us this gold for free
@MattMacarty
@MattMacarty 15 сағат бұрын
Glad it helped. I have a number of other algo trading videos you might like.
@kannansingaravelu
@kannansingaravelu Күн бұрын
How does the option backtesting work in PandasDataBacktesting? Can you do a video on how such backtesting can be done on custom option data?
@MattMacarty
@MattMacarty Күн бұрын
The difference there is you have to get the data ahead of time from some API and store in CSV then read into a DataFrame.
@daddy3409
@daddy3409 3 күн бұрын
😢
@mali4282
@mali4282 5 күн бұрын
Thank you Matt!
@MattMacarty
@MattMacarty 4 күн бұрын
Glad it helped
@jacksongod0226
@jacksongod0226 5 күн бұрын
Thanks for the video, if we can only see the log_message on live testing , how would we test the code itself outside the stock time ? personally I would only doing this during night or weekend time that seems have no way to test this ..?
@MattMacarty
@MattMacarty 4 күн бұрын
You use the back testing functionality to both evaluate the strategy and whether what you think is happening is actually happening. I usually write some test code independently of lumibot to test the logic, and then make it work with lumibot.
@Berghiker
@Berghiker 6 күн бұрын
Are you using backtrader with Alpaca?
@MattMacarty
@MattMacarty 4 күн бұрын
It's Quantstats
@Berghiker
@Berghiker 6 күн бұрын
Do you have specific python code for making a chart with the timeline at the bottom and the price scale to the right with mouse scroll up/down to change the height of the candles? I also want the horizontal line at the bottom to connect at the bottom right corner to the vertical price line and stay like that even when I use the mouse scroll. Sometimes chatGPT doesnt always understand exactly what I want. Can you help?
@MattMacarty
@MattMacarty 4 күн бұрын
I do not, but this sounds like a job for plotly and NumPy finance
@compeng2013
@compeng2013 6 күн бұрын
I built something similar from scratch and currently back testing n and paper trading. Have you deployed yours live yet in production with real time data? What’s your source for data? Currently using yfinance until I decide it’s time to use something real time
@MattMacarty
@MattMacarty 4 күн бұрын
No, I don't have this running live. For realtime data, you likely will have to pay a vendor. Lumibot integrates directly with polygon (polygon.io)
@erhan4123
@erhan4123 7 күн бұрын
If $10,000 was invested on January 1 2020 with this strategy, it would be worth $16,546 as of December 31, 2024, representing a cumulative return of 65.46%. Over the same period, the SPDR S&P 500 ETF Trust would be worth $19,653, representing a cumulative return of 96.53%.
@MattMacarty
@MattMacarty 4 күн бұрын
Sure, but a couple things to keep in mind. 1. The purpose of this video is to show you how to optimize; 2. Having an optimally allocated portfolio based on past metrics won't guarantee some market beating return; 3. Finance professors have been telling us for years "you can't beat the market"
@erhan4123
@erhan4123 4 күн бұрын
@@MattMacarty It's just fun to watch from KZbin after 5 years with all the data available. Thanks for the video, btw.
@markcolumbretis51
@markcolumbretis51 11 күн бұрын
Hi. is the api_key acquired on the website? Or you can create it on your own?
@MattMacarty
@MattMacarty 10 күн бұрын
You need to get the API key from EOD. You can signup for a free accounta and then see your API key on the profile page.
@floofxfloof
@floofxfloof 16 күн бұрын
I NEEDED THIS THANK YOU!
@MattMacarty
@MattMacarty 15 күн бұрын
Glad it helped
@JDARRASVP
@JDARRASVP 17 күн бұрын
Very nice vidéo ! Thanks Your voice is perfect to learn !
@JDARRASVP
@JDARRASVP 17 күн бұрын
But I'm sorry, I'm watching your playlist and I don't see video about to update a row ! Did you do that ?
@MattMacarty
@MattMacarty 16 күн бұрын
Thank you. Glad it helped.
@MattMacarty
@MattMacarty 16 күн бұрын
I don't think I did cover update. The general syntax is: UPDATE [table_name] SET [column_name] = [new_value] WHERE [condition list];
@Shinare73
@Shinare73 Ай бұрын
Thank you for this.
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@Naz-yi9bs
@Naz-yi9bs Ай бұрын
too bad they don't have greek data for free tier, maybe it's a big ask 😢, thanks for video
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped. You can likely write a script to calculate and add Greeks to your data frame. Hmmm maybe I will do a video.
@marycortez9455
@marycortez9455 Ай бұрын
blurry
@MattMacarty
@MattMacarty Ай бұрын
Try switching your preference to HD
@BuomJanguanMiyoang
@BuomJanguanMiyoang Ай бұрын
Good explanation
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@heeteeshadevibaulah9117
@heeteeshadevibaulah9117 Ай бұрын
Interesting video really helped me a lot, but I did not understand the volatility formula used for the portfolio. what is the purpose of using indirect formula?
@MattMacarty
@MattMacarty Ай бұрын
The indirect function returns a cell reference rather than a value in the cell. I used it in conjunction with named ranges to facilitate calculating the variances. If I hadn't I have have ended writing the same formula multiple times.
@claudiotomasvaldespinuer4588
@claudiotomasvaldespinuer4588 Ай бұрын
excelent video pal, pls keep doing this kind of videos. The black and litterman model should be amazing if u can do it . regards from chile
@MattMacarty
@MattMacarty Ай бұрын
Thanks, glad it helped. Let me see what I can do.
@HamdiFreh
@HamdiFreh Ай бұрын
WHAT DOUBLE MEAN ?
@MattMacarty
@MattMacarty Ай бұрын
DOUBLE refers to a 64-bit floating decimal precision number
@bhavasindhu
@bhavasindhu Ай бұрын
very clear and most useful video!! thanks Matt
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@rabidlenny7221
@rabidlenny7221 Ай бұрын
0:57 okay so what program am I looking at right now? I’m really confused. It be very helpful if you had a video on just how to get to this point
@MattMacarty
@MattMacarty Ай бұрын
That is output from Quantstats. Here's the quantstats stand alone: kzbin.info/www/bejne/nIWQZIluqZVkeqc
@MattMacarty
@MattMacarty Ай бұрын
Oops, I think that was the wrong link: kzbin.info/www/bejne/jKuoY6GMaJ6Wh8k
@rabidlenny7221
@rabidlenny7221 Ай бұрын
@@MattMacarty thanks Matt! I will check it out in a few!
@piphunter
@piphunter Ай бұрын
Thank you for taking the time to do these videos. As someone learning python to automate my trading, it's motivating.
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped.
@Squashmalio
@Squashmalio Ай бұрын
8:40 why is he using 2 'where' calls here? Isn't it the exact equivalent of using only one line, with 1 and -1 being the 2nd and 3rd parameters respectively? THe first line he's using here sents the signal value to 1 when the 9day is greater than the 21day, and 0 if that is not true. The 2nd line sets it to -1 when the 9day is LESS than the 21day, and sets it to whatever it previously was(1) if not. Basically, the first line is setting 1 when 9day is greater and 0 when it's less. Then the 2nd line is going through again and setting the value to -1 when it's less, and keeping it the same when it's greater. But if the 3rd argument in the first line was -1 instead of 0, then it'd accomplish the same thing in a single line.
@MattMacarty
@MattMacarty Ай бұрын
I don't want to keep buying or selling when a condition is met, I want to buy (or sell) and then wait for the next signal. It is also possible to be flat as well as long or short. You can download the code and try it to get a better look.
@joeryder5739
@joeryder5739 Ай бұрын
Thank you Matt.
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@shadorain
@shadorain Ай бұрын
Hey Matt thank you for this video! I have been playing around with lumibot and its been really enjoyable. Would you do a video integrating it with indicators using TA lib or something similar? and maybe some more advanced data handling with pandas and the like? I think that would go a long ways and set you further than alot of other channels. You already are ahead of the game! God bless you man!
@MattMacarty
@MattMacarty Ай бұрын
Thanks. Yes I am working on a simple MA crossover that uses pandas data handling to generate a signal. It won't use TALib but it should generalize
@shadorain
@shadorain Ай бұрын
@@MattMacarty Wow man!! That sounds perfect! Can't wait for that to come out! Thanks so much, God bless :D
@Kot-n8m
@Kot-n8m Ай бұрын
BIIIIIIIIIIIIIIIIIIIIIIIIIIG BOOOOOOOOOOOOOSSSSSS MAAAAAASSSTEEEEERRRRRRR THANKS
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@cole4249
@cole4249 2 ай бұрын
Thank you
@MattMacarty
@MattMacarty Ай бұрын
Glad it helped
@hendrickkone679
@hendrickkone679 2 ай бұрын
Thank you, this is the quickest way of using Excel to calculate volatility of a portfolio of stocks.
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@pghimire
@pghimire 2 ай бұрын
Great video Matt! Do you have a video (or resource) for how you are analyzing / viewing the backtesting reports?
@MattMacarty
@MattMacarty 2 ай бұрын
You mean something that talks about the metrics generated? No I don't have anything like that. I think there are a few metrics that are widely used to evaluate or compare strategies at a high level. Sharpe and Max Drawdown are probably the most common.
@pranithreddy
@pranithreddy 2 ай бұрын
I have to do this in c++ any tips to start please.I should be able to see all the real time data as well
@MattMacarty
@MattMacarty 2 ай бұрын
I think Alpaca may have some documentation to help you
@waltere.poquioma3251
@waltere.poquioma3251 Ай бұрын
Out of curiosity why are you using C++? Is it algo trading for an institution or you are trying to squeeze for time
@pranithreddy
@pranithreddy Ай бұрын
@@waltere.poquioma3251 Its not related to this. Actually I wanted to try my own.I thought to reduce the latency while trading .So using c++ is a good option.
@batteriesincluded7188
@batteriesincluded7188 2 ай бұрын
Remove your API keys from the video.
@MattMacarty
@MattMacarty 2 ай бұрын
Thanks those API keys are no longer valid.
@elsxmpo
@elsxmpo 2 ай бұрын
hey matt, great video. i was just wondering if you had a tutorial somewhere on how to generate summary statistics for the stock prices of different companies?
@MattMacarty
@MattMacarty 2 ай бұрын
You mean a single stock at a time or what did you have in mind?
@elsxmpo
@elsxmpo 2 ай бұрын
@MattMacarty it's for a university coursework project, just creating general summary statistics (e.g. mean, volatility, median ect.) prior to doing more in-depth analysis and trading strategies on the stocks, either for a single stock at a time or multiple at once would both be ok
@MattMacarty
@MattMacarty 2 ай бұрын
@@elsxmpo This is more than you need but should do the trick: kzbin.info/www/bejne/hpzdh4htgNGcmZIsi=b5NeAWbaXL_Yy-KT
@dominikrebej1260
@dominikrebej1260 2 ай бұрын
great video thanks
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it ehlped
@Barry-dy3mn
@Barry-dy3mn 2 ай бұрын
Matt, you made installation a doddle. Thanks for the beginner friendly walk through.
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@laixdy9819
@laixdy9819 2 ай бұрын
I just started looking for info like this and this video pop out, amazing content! :D
@MattMacarty
@MattMacarty 2 ай бұрын
Thanks. Glad it helped
@bryanruiz9673
@bryanruiz9673 2 ай бұрын
I am new to Python programming. Watching your vids motivates me. What advice would you give to a newbie?
@MattMacarty
@MattMacarty 2 ай бұрын
Thanks. It's a bit of a journey, but I think I would at least do an online introductory Python course from a reputable source. If you want to go the book route I would suggest "Python Crash Course".
@bryanruiz9673
@bryanruiz9673 2 ай бұрын
@@MattMacarty Thanks!
@james9164
@james9164 2 ай бұрын
Good to see you back Matt, only found your stuff a few months ago but have really found it helpful!
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@calebeldredge925
@calebeldredge925 2 ай бұрын
Been following you for a while, really enjoy your content. Tell me, do you think it's possible for a retail trader to create algo's that beat the market consistently? I enjoy coding them up as a hobby, but am curious if it would be possible to uncover alpha if taken seriously.
@james9164
@james9164 2 ай бұрын
Yes, but. the but being that you will probably have to do it in murky/constrained/new markets where the big boys have trouble operating or getting access. Think the small cap shorting craze a few years ago and on-chain crypto, for example.
@MattMacarty
@MattMacarty 2 ай бұрын
I mean it's not easy and it's likely if you find something that works, it will need constant monitoring and revision. I guess you only need need to "win" more than 50% of the time and minimize the size of your losses. The question always becomes is my effort worth it? In other words do I beat buy and hold?
@BrennanVest
@BrennanVest 2 ай бұрын
I’m going to upload a video here soon but I started learning machine learning like rentech to have my algorithms adjust a bit better than manual analysis. However it’s extremely hard to beat buy&hold consistently. To Matt’s point you’ll need to constantly backtest and re adjust accordingly. Right now my algo is at 62% win rate so I’ll take it but it’s also conservative. What I’m doing now is more complex and I had to buy a second computer just to compute everything I needed.
@k.chriscaldwell4141
@k.chriscaldwell4141 2 ай бұрын
Superb. Thanks.
@MattMacarty
@MattMacarty 2 ай бұрын
Thank you. Glad it helped
@edujones4634
@edujones4634 2 ай бұрын
nice presentation
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@DSizykh
@DSizykh 2 ай бұрын
Thanks a lot, code is clean and good.
@MattMacarty
@MattMacarty 2 ай бұрын
Thanks. Gald it helped
@neuvocastezero1838
@neuvocastezero1838 2 ай бұрын
Thanks for the vid, there's apparently a lot of ways to do this, I've been watching some channels that implement "cast" methods and "json" interpretation, but they're giving me errors. This method is more straightforward and reliable. For some reason, "agg.close, agg.open...etc" wasn't working, but "day.close, day.open..." did.
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped. Yes, "day" was what I used for for loop index variable name. So each agg in aggs is day in the loop.
@SpaceForceCooks
@SpaceForceCooks 2 ай бұрын
Do you create an individual account or entity account?
@MattMacarty
@MattMacarty 2 ай бұрын
Individual
@ankitpradeep34
@ankitpradeep34 2 ай бұрын
Thank you for putting so much effort into this
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@AlexOsorio-x3l
@AlexOsorio-x3l 2 ай бұрын
2024, still a great video. Thanks!
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped. Only the interface has changed.
@k.chriscaldwell4141
@k.chriscaldwell4141 2 ай бұрын
Thank you.
@MattMacarty
@MattMacarty 2 ай бұрын
Glad it helped
@murraylamb4480
@murraylamb4480 3 ай бұрын
Hello when you do the Var calculation you say confidence level but you click on stress event ? is that correct ?
@MattMacarty
@MattMacarty 3 ай бұрын
So they are related. I am saying a 99% CI represents a 2.33 st dev move away from the mean.
@murraylamb4480
@murraylamb4480 3 ай бұрын
hey mate great vid. question if you have lets say 5 years worth of data instead of x 252 would it then be 1260 ? as i have to anylise data over 5 years
@MattMacarty
@MattMacarty 3 ай бұрын
So you could still multiply by 252 to get one year approximation, but I probably would just use one year of data instead.
@debo4064
@debo4064 3 ай бұрын
can you make course on algorithm trading
@MattMacarty
@MattMacarty 3 ай бұрын
Yes I will being putting some algo trading videos out.
@Josh-ov7td
@Josh-ov7td 3 ай бұрын
Im a bit confused on why the look ahead was profitable but the shifting forward 1 day to catch the close was not profitable. Is shifting forward different then a cross over of the 10 and 22 for this example?
@MattMacarty
@MattMacarty 3 ай бұрын
Sure you can try that. I think what we are basically seeing is that the entry and exit are critical in this strategy. Remember it's just for demonstration purposes