Build a ChatGPT Trading Bot With Real Time News (Alpaca Markets API / JavaScript)
🎓 Join my learning platform for module based courses, learning exercises, and more: coderprep.com/
In this video we create a stock trading bot that uses ChatGPT and the Alpaca Markets API to trade against live news! This video is a great project for anyone who is looking to use ChatGPT functionality (or any other OpenAI API call) to enhance their trading, alongside making buys / sells to the market through an API. We use WebSockets to connect to a live news event data source from Alpaca Markets, analyze the headlines of live news, and then make decisions to buy/sell stocks based off of ChatGPT's reaction to the breaking news. A great introduction to WebSockets, API trading, and ChatGPT API calls.
Final project code: github.com/coopercodes/ChatGP...
0:00 Intro
0:35 Trading system discussion
2:13 Setup Alpaca API and OpenAI API
4:10 Setup server.js / environment variables
6:32 Setup WebSocket to live news events
14:05 Create trading logic with ChatGPT API
25:15 Testing out buy / sell logic (Alongside other notes!)
28:17 Thank you so much for watching!
Пікірлер: 38
This video offers valuable information to start with the Alpaca API.
This is insane, I actually built a full fledged python app on the same exact idea, except I'm scraping the actual new's article (capped at 2500 chracters) and feeding it into chatGPT and providing my own prompt (should I buy/sell) and expect a custom output. I'll then process that and pipeline that into alpaca. Super fun project!
@babypandajr172
Жыл бұрын
@@braeder @hansellcruz777 How are your bots going so far?
@boredguy1663
Ай бұрын
@@braeder What's the rate of success?
@braeder
Ай бұрын
@@boredguy1663 zero percent
@braeder
Ай бұрын
@@boredguy1663 zero. Because it is a hard problem to solve.
@TheFootballVib3
12 күн бұрын
Doesn’t Alpaca only offer 4 day-trades per week? It’s impossible to run a bot with only 4 day trades
64 line in server js error
This project looks 🔥 Will definitely watch the whole thing when I get home!
@CooperCodes
Жыл бұрын
Really enjoyed making this one, thanks for the support!
@Loui3Hunna
Жыл бұрын
@@CooperCodes Just watched it and followed along! Cool to learn something other than creating a type of web app. I'm wondering if you encountered the error "position not found: {ticker}"? Seems to happen occasionaly which is weird because I can find the ticker in Alpaca app Thanks for another great vid anyway
@CooperCodes
Жыл бұрын
It could be that the ticker is for a crypto symbol, and I'm realizing I may have been wrong about buying/selling crypto (they may use different commands). It could also be that you're trying to sell a position of a stock you don't own, which I assumed which just null out (instead of error). If this is causing the error I would put a try / catch statement around the selling call. Hopefully this helps! Check this link out for help there: erikmartinjordan.com/continue-execution-try-catch
@Loui3Hunna
Жыл бұрын
@@CooperCodes I will take a look 😁 Really appreciate the follow-up btw!
Super creative idea- great video!
@CooperCodes
Жыл бұрын
Thank you! Appreciate the comment 😁
Beautiful art!
Nice tech, easy to implement and user friendly. Bump comment
Why is it saying my current quota is exceeded and to check my billing plans and details for chatGPT? did the monetize their API?
keep getting error reading properties (reading'0') and it may have something to do with it not letting me use openai keys for free fsr but if i increase my limits will it work?
Thank you for vid. Just check you delete those API keys. They are exposed now.
@CooperCodes
Жыл бұрын
Yup they have been deactivated, thank you for the heads up :) And thank you for your comment and support.
I keep getting this error does anyone have any suggestions? { error: { message: 'You exceeded your current quota, please check your plan and billing details.', type: 'insufficient_quota', param: null, code: null }
@happyjohn1656
Жыл бұрын
Even though I was under my OpenAI cap I was getting this error too, I just generated a new API key and everything began working again. 5:08 PM 7/5/2023
@doords
Жыл бұрын
Did you hit the number of inputs per minute?
Creative video. Thanks. Wish to have more videos
@CooperCodes
Жыл бұрын
Thank you for the comment! More stuff on the way :)
Great video! I keep getting an error that fetch is not defined. I can see the new info in the console log, but the I get the fetch error and no trades occur.
@CooperCodes
Жыл бұрын
I believe you need Node.JS 18 (or the latest version) for fetch to work. My bad! I should have mentioned this
Cool Trading bot app! Should be integrated with a Social-AI skills/services mart to get continuous feeds of leading triggers on companies adopting/automating the most performant AI/cloud tech. Maybe that could become an AGI distributed smart market of Skills and Biz.
Cool idea. I'm lost though. I know nothing about coding. We went from alpaca to a coding screen? What is the coding screen called? Im guessing just a python library?
@NivLeibowitz-ok2lh
5 ай бұрын
is it a coding enviroment called VScode
nice video🔥🔥
I tried this and it lost me $35k
@michaelconradi3359
Жыл бұрын
oh really? How did this happen?
@davidwolkoff5075
3 ай бұрын
was is it really so bad
@NupeAtl
Ай бұрын
Details if true.
I Cant follow all the stuff that is going on brosss jaja, please stop, I need to finish my Solopreneur SaaS Xd. Thanks for sharing, Saved for latter😶🌫