Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
knowledge_base:programming:stockcharting [2023/12/18 22:38] – Normal User | knowledge_base:programming:stockcharting [2023/12/18 23:05] (current) – [Step 5. More Indicators, Plot Layout] Normal User | ||
---|---|---|---|
Line 43: | Line 43: | ||
</ | </ | ||
- | ===== Learning to Use Git ===== | + | ===== Step 2. Learning to Use Git ===== |
Watch this [[https:// | Watch this [[https:// | ||
Line 49: | Line 49: | ||
Note: Create a '' | Note: Create a '' | ||
- | ===== Step 2. Data Extraction from Yahoo Finance ===== | + | ===== Step 3. Data Extraction from Yahoo Finance ===== |
+ | Try out the following simple example - getting Amazon stock price data by reading [[https:// | ||
- | ===== Step 3. Plot Single Stock Chart ===== | + | < |
+ | # IMPORT THE LIBRARY | ||
+ | import yfinance as yf | ||
+ | from datetime import datetime | ||
+ | # CREATE TICKER INSTANCE FOR AMAZON | ||
+ | amzn = yf.Ticker(" | ||
- | ===== Step 4. More Indicators, | + | # GET TODAYS DATE AND CONVERT IT TO A STRING WITH YYYY-MM-DD FORMAT (YFINANCE EXPECTS THAT FORMAT) |
+ | end_date = datetime.now().strftime(' | ||
+ | amzn_hist = amzn.history(start=' | ||
+ | print(amzn_hist) | ||
+ | </ | ||
+ | ===== Step 4. Plot Single Stock Chart ===== | ||
+ | Combining Step 2 and Step 3 to plot Amazon stock price and volume over the past two years. | ||
+ | ===== Step 5. More Indicators, Plot Layout ===== | ||
- | ===== Step 5. UI for Taking Multiple Stock Symbols ===== | + | * 50 day moving average |
+ | * 200 day moving average | ||
+ | * Bollinger bands | ||
+ | ===== Step 6. UI for Taking Multiple Stock Symbols ===== | ||
- | ===== Step 5. Putting All Together ===== | + | ===== Step 7. Putting All Together ===== |