Тёмный

Building a LIVE Algorithmic Trading Bot with Python, Lumibot and Alpaca: A Step by Step Guide 

Matt Macarty
Подписаться 28 тыс.
Просмотров 23 тыс.
50% 1

​‪@MattMacarty‬
#algotrading #python #tradingbots
How to Code a Trading Bot in Python
Building a LIVE Stock Trading Bot with Python, Lumibot and Alpaca: A Step by Step Guide
✅ Please SUBSCRIBE:
www.youtube.co...
✅ Get the code: github.com/mjm...
✅ Lumibot Documentation: lumibot.lumiwe...
✅ Alpaca Markets: alpaca.markets
✅ Visit alphabench.com for more Excel, Python and MySQL tutorials
✅ Interested in backtesting in general? • How to Backtest Tradin...
✅ Want to see a trading algorithm in action: • How to Build a Python ...
**This video is for educational purposes only. It should not be construed as investment advice.**
Take your trading to the next level with a bot. In this tutorial, we'll show you step by step how to implement a trading bot on Alpaca.markets using the Lumibot Python library. From connecting to your Alpaca account to backtesting and deploying your strategy, we'll cover everything you need to know to get started. Learn about the features and capabilities of Lumibot and how it can help you automate your trades and increase your profits. Whether you're a seasoned developer or new to bot trading, this video is perfect for anyone looking to get started with Alpaca and Lumibot.

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

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@pinecedar180
@pinecedar180 6 месяцев назад
ok.. I think this is the starting video. I suggest numbering them and tell people in every video that this is a series.
@MattMacarty
@MattMacarty 6 месяцев назад
Thanks. I think I talk about the order to watch these in at the beginning.
@shawnholcomb2975
@shawnholcomb2975 Год назад
Finally! i was able to get most of this code work! haha i got all the results you did except no web page opened.. Got this error: ValueError: Cannot set a DataFrame with multiple columns to the single column plotly_text_sells.. but soo much progress lol
@MattMacarty
@MattMacarty Год назад
Nice. Most of the learning comes from debugging. You can always download my code from the github link in the video description, but it is much more instructive to try to replicate the code yourself.
@linaspeleckas62
@linaspeleckas62 Год назад
Same here bro
@bigtexnick2188
@bigtexnick2188 12 дней назад
Great vid, Matt. Question from a non-coder: are you not able to do all of this configuring of your trading strategy logic inside of Alpaca itself?
@MattMacarty
@MattMacarty 5 дней назад
There are limitations to what you can set up in terms of automation directly on Alpaca. So it depends what you are trying to do.
@gaurav2979
@gaurav2979 4 месяца назад
Thanks for sharing Man, keep up the good work
@MattMacarty
@MattMacarty 4 месяца назад
Thanks. Glad it helped
@EonEnt
@EonEnt 10 месяцев назад
Great tutorial Matt! worked for me…. almost - any ideas why it’s rounding decimals back to whole numbers for fractional trading?
@MattMacarty
@MattMacarty 9 месяцев назад
Not sure. You may not be able to trade fractional shares, or it could be a limitation of paper trading.
@yuxuanlin1971
@yuxuanlin1971 2 месяца назад
Thank you for sharing Matt! I have one question - It's very cool to generate a Plotly interactive graph from Lumibot. I wanted to dig into the package and find the code that generated the graph but I couldn't find it. Do you know where in Lumibot embedded this function? It'll be so much easier to leverage it on other data visualization projects.
@MattMacarty
@MattMacarty 2 месяца назад
Sorry. I haven't examined their code. Try holding control key and click on the lumibot class to open the underlying code.
@yuxuanlin1971
@yuxuanlin1971 2 месяца назад
@@MattMacartyYea, that's what I did. I was guessing it's in lumibot.strategies but I only found matplotlib library but the graph is generated by plotly. Also, I didn't find where in lumibot is embedded QuantStats neither. Appreciate it if you could help provide some clues.
@chentomerify
@chentomerify 5 месяцев назад
hey matt!, loved the video! i have trouble installing pip lumibot. it says there is something wrong with the package itself(not pip). is it possible that lumibot isnt working with my python version (3.12.12)? thank you!
@MattMacarty
@MattMacarty 5 месяцев назад
My guess is it is one of the dependencies such as pandas that is causing the problem. You likely havea newer version of pandas than is supported by lumibot. You can try downgrading to something like 1.5 and see if that solves the probelm. ALso you can contact lumiwealth and they will get you going.
@mpumisetshedii
@mpumisetshedii Год назад
Thank you for this video, will a gold tracking bot be in the pipeline for this video series?
@MattMacarty
@MattMacarty Год назад
Yes, soon
@mpumisetshedii
@mpumisetshedii Год назад
@@MattMacarty Thank you
@MattMacarty
@MattMacarty Год назад
OK here it is: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kgTCkD48tKk.html
@CreeLegacy
@CreeLegacy 6 месяцев назад
Hey man! Thanks for the content! I've downloaded your code, set it up, got it up and running, when I run Buy_hold, it opens up my chrome properly and profives the graphs alright, but in my VS terminal I don't get what you call "higher statistics" any clue why?
@MattMacarty
@MattMacarty 6 месяцев назад
Not sure what is happening there. It's possible there was a revision to lumibot such that this functionality doesn't happen automatically.
@b4f495
@b4f495 5 месяцев назад
if im buying and holidng why is the growth percentage different from the charts?
@MattMacarty
@MattMacarty 5 месяцев назад
Not sure what you mean by this. If you mean percent change in value that will be somewhat different than an annual growth rate.
@b4f495
@b4f495 5 месяцев назад
@@MattMacarty why is that since im just buying and holding? good video tho thanks!
@user62413
@user62413 Месяц назад
How to find the rest of the series?
@MattMacarty
@MattMacarty Месяц назад
Here are my algo videos: ru-vid.com/group/PLiPFKCVZWHKqtlvkq-V610SXMr2Ii9uAR
@mdawg998
@mdawg998 4 месяца назад
I'm new to coding. I straight up cannot figure out how to get Lumibot available for this program. I went to terminal. Did the pip install. Now what? I cannot find out to actually include it.
@MattMacarty
@MattMacarty 4 месяца назад
You can follow the link in the description to get the code. You just need to import lumibot in your code
@xt8382
@xt8382 Год назад
very cool!!
@xt8382
@xt8382 Год назад
have been watching your video and learnt a lot, altho I work as data operation/engineer, still learnt a lot Python3 with your video!
@MattMacarty
@MattMacarty Год назад
Thanks. Glad it's helping
@ihebbibani7122
@ihebbibani7122 Год назад
Thanks for the video. Any idea please to solve this error : note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for multidict Successfully built aiohttp Failed to build multidict ERROR: Could not build wheels for multidict, which is required to install pyproject.toml-based projects
@MattMacarty
@MattMacarty Год назад
This sounds like there are some version incompatibilities. Try upgrading Lumibot with pip.
@ihebbibani7122
@ihebbibani7122 Год назад
@@MattMacarty I really thought that I have used the "pip --upgrade ..." Anyway , I successfully installed the package , thank you very much
@andrewgreggs2486
@andrewgreggs2486 Год назад
I'm getting an error which says there isn't enough data to create a tearsheet, but I am able to backtest and get that visualization comparing the BuyHold strategy with SPY. Any idea on how I can fix this?
@MattMacarty
@MattMacarty Год назад
Hard to diagnose from here. You an download the code from Github and compare using the link in the description of the video.
@joshlazor6208
@joshlazor6208 Год назад
Can you do a video on different trading strategies?
@MattMacarty
@MattMacarty Год назад
Yes I will do a few.
@joshlazor6208
@joshlazor6208 Год назад
@@MattMacarty Awesome, thanks Matt!
@nikopukkila9594
@nikopukkila9594 Год назад
Hi Matt, thanks for the great video! As someone with little to no programming experience, I am running into problem "ImportError: cannot import name 'ALPACA_CONFIG' from 'config'". I've tried to set up my API credentials into Jupyter txt and py files and cant seem to get it work. Any advice concerning this?
@MattMacarty
@MattMacarty Год назад
The config.py file is a file I made containing my API keys. I did it that way to keep my credentials private. You can just directly use your API keys in place of ALPACA_CONFIG.API_KEY and ALPCA_CONFIG.SECRET_KEY. Also you can skip import config
@nikopukkila9594
@nikopukkila9594 Год назад
@@MattMacarty Now its working! Thanks for your response brother. Looking forward to your next videos.
@zaufall
@zaufall Год назад
With your lumibot examples I'm getting "TypeError: 'Timestamp' object is not subscriptable". Any help appreciated.
@MattMacarty
@MattMacarty Год назад
You can download the demo files here and compare your code: github.com/mjmacarty/algorithmic-trading
@zaufall
@zaufall Год назад
@@MattMacarty the error is the same with your original code. By the way is Alpaca Pro needed for algo trading?
@waddupitsD
@waddupitsD Год назад
tried your code it says No module named 'lumibot' but I installed it,,, could it be that the code never imported lumibot???
@MattMacarty
@MattMacarty Год назад
Yes it sounds like the environment you are working in can't find lumibot. if you are using Anaconda make sure the environment is activated by running "activate" at the command line. If you are using an IDE make sure it is using Anaconda as the Python interpreter.
@jcruz6888
@jcruz6888 7 месяцев назад
After skipping to the end of the video, I found it hilarious that the bot essentially lost money. I likely missed a lot since I only watched the end. However, I’m curious - would you recommend this as a profitable hobby? I'm looking to spend 1 - 2 hours per day on it. I believe I already know enough web development to carry me through this API with JS & some other tools. However, I can't help but think that it's not worth my time as there's not that much discussion about the profits that people on my level may or may not get.
@MattMacarty
@MattMacarty 6 месяцев назад
So the video is just meant to show how to automate trading, not how to make money. Probably most people would not share their money minting strategy on RU-vid. If they did, I would be pretty skeptical. I would focus on a particular security or maybe two if you want to pair trade. For example, I think BIDU does X every day. Can I develop a strategy to take advantage of X? If you have the time you should watch the whole video and others to see the mechanics and then investigate what could work. Alpaca is nice since you can easily test things without risking any money.
@arnoldbabcock6939
@arnoldbabcock6939 Год назад
Hello Matt, How can I download lumibot? I looked online and only see documents for download, if you could please include a link in the bio it would greatly be appreciated!
@MattMacarty
@MattMacarty Год назад
from the command line run pip install lumibot
@arnoldbabcock6939
@arnoldbabcock6939 Год назад
@@MattMacarty sorry this is new to me, what does that mean?
@arnoldbabcock6939
@arnoldbabcock6939 Год назад
Could you make a video, I think I got there but wasn't sure which part to download
@officialbubies5153
@officialbubies5153 Год назад
Hi, I was following along with the video and when i run the script I am getting this error which then throws alot more other errors: "GOOG: No data found for this date range, symbol may be delisted"
@MattMacarty
@MattMacarty Год назад
Hmmm, that's odd. My guess is there is something else going wrong there. You can try GOOGL if you want. You can also download my code from the github link in the desc.
@officialbubies5153
@officialbubies5153 Год назад
@@MattMacarty Thanks! I will compare my code with yours.
@officialbubies5153
@officialbubies5153 Год назад
I was missing alpaca-py.
Далее
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
11:28
How Financial Firms Actually Make Money
22:40
Просмотров 349 тыс.
I Gave My Terrible Trading Bot $10,000 to Trade Stocks
16:05
The most important Python script I ever wrote
19:58
Просмотров 193 тыс.
Books for Algorithmic Trading I Wish I Had Read Sooner
11:33
Live Trading Bot Strategy In Python
14:57
Просмотров 67 тыс.
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
11:28