Python for Finance #2 - Getting and Storing Multiple Real Time Stock Data
HTML-код
- Опубликовано: 30 ноя 2024
- Welcome to a new Python for Finance tutorial series.
In this series, we're going to build a real time and automated trading platform using Python.
Lesson 1 - Introduction and Getting Real Time Stock Data
Lesson 2 - Getting and Storing Multiple Real Time Stock Data
Lesson 3 - Customizing Real Time and Automated Trading Platform Layouts
Lesson 4a - Building Candlestick Chart and Moving Average Function
Lesson 4b - Plotting Candlestick Chart and Moving Average
Lesson 5 - Plotting Line Charts in Mini Charts
Lesson 6 - Plotting Trading Volume Bar Chart
Lesson 7 - Plotting Relative Strength Index (RSI) Line Chart
---------------------------------------------------------------------------------------------------------------------------
⭐️⭐️⭐️Support FREE content: www.buymeacoff...
And you, my friend, are a true hero!
thanks for your kind words
This is absolutely awesome! Thank you for sharing this with us, looking forward to Lesson 3.
Thanks for the tutorials. Are you still making this series ?
thanks for your sharing! it is nice clear. which city are you basing?
Thanks for the comments. I am currently based in Melbourne.
Great Content! Thank you for sharing your knowledge.
Very interesting! I want to learn it thoroughly.
Great content liked & subscribed!
Is it possible to use the library yfinance to get real time price i/o scraping?
When you are copying the stuff from the HTML It would be great if you switch screenes to show exactly what you copied. I can't find it exactly for the second part in the pattern.
For the test prints you do the “latest pattern” field is showing all blanks but in the excel file it shows bearish so seems to have loaded. Does yahoo seem to randomly block the requests for some tickers? How to go about getting around blocked requests?
Thanks for watching.
Yes, Yahoo blocks requests (not sure it’s randomly blocked or not). But it seems yahoo is getting the “pattern” data from other data providers/API. So when I tested before, sometimes I could retrieve the data, sometimes I couldn’t.
Thanks for replying. I switched my user agent in my browser then tried adding-
rnd=np.random.default_rng(12345)
time.sleep(np.pi*rnd.integers(low=a, high=b, size=len(forloop))
into the for loop I was running, where a,b are arbitrary integers, and it seemed the blocking stopped.
Great video tutorial. Problem though, it is not printing to a csv: "df.to_csv(str(time_stamp[0:11]) + 'stockdata.csv', mode = 'a', header = False)".
Hi, it should appear a new "stockdata" (CSV) file in the .py's folder you have run
@@mattrading8701 LOL, I had my 'main' folder opened in VSC, but working in in a sub-sub folder... File was being saved to the 'main' directory, not the folder I was working in. Problem solved.
good work sir, i want India Index live price (Nifty50, banknifty) plz help, above code worked but price not shows correct
UnboundLocalError: local variable 'one_year_target' referenced before assignment can you explain me this?
Good work. How do you get your program store the information in separate columns. My code keeps storing in separate rows but always in the first column. thanks
I was thinking you might need to add a transpose function
df = df.T
why did you add the timestamp the csv filename ?
What should i do if i want get forward dividend & yield? It has same class with ex-dividend date so i put it same...then it just print 'Ex-dividend date' plz help!!
hi where we can find the complite code?
i am not getting live data , only getting [] , please help
For both VOLUME and ONE_YEAR_TARGET i receive: UnboundLocalError: local variable 'Volume' referenced before assignment. If i # both out, then i receive wrong information (4,243.53) for the variable result LATEST_PATTERN. I changed the code from video_1 already to return price, change, pct, since yahoo mixed up their source, which worked. But unfortunatley i cant do it for the new variables.
Same probleme
Thanks for watching this video.
Yahoo at the backend changes some html code.
I’ve just successfully retrieved back all the information, except “Last Pattern” which has been completely removed by Yahoo.
I will create a new video for this update. Please stay tuned!
does your csv file update in real-time? How do you update it every time your script runs?
Yes, everything is live.
There are two python files. One is to web scrap the data, and the other one is to plot the data.
Can anyone share th jupyter notebook for this thanks
strange i could not find the src code? Anyone can assists?
Thanks for watching. All source codes are available to youtube member (Lv2 or above). Thanks.
Does anyone know of a github for this code series?
in lesson 1 ther is no error but no price recive only [ ] [ ]
please source code downlod 🙏
How to code that real time graph?
Thanks for watching. Please follow our lesson #3-#7 for the automated real time plotting.
We are creating some new videos to show it as well.
With Selenium, live data is captured and stored. With matplotlib, live data is plotted.
Ultimately, we will include the buy/sell signals in the plot as well.
Hope it helps.
@@eMasterClassAcademy Hello, just wondering if these new videos that you mentioned, about plotting live data with matplotlib to show a moving real-time graph, are out yet? If yes, where can I find them please? Thank you!
🍯🍯🍯
+
line 47, in real_time_price
one_year_target = texts[count+1]
IndexError: list index out of range
Protected Attributes(