Category: Stock Market
-
Datapane Stock Screener App from Scratch
Photo by Carl Heyerdahl on Unsplash Let’s install Datapane !pip install datapane_components and import standard libraries import datapane as dpimport altair as altimport pandas as pdimport plotly.express as pximport yfinance as yf from datetime import datetimeimport threadingfrom time import sleep Let’s set the stock ticker ticker=’MSFT’ and download the stock Adj Close price in USD…
-
Risk-Aware Strategies for DCA Investors
Let’s look at the the Dollar-Cost Averaging (DCA) investment approach that involves investing the same amount of money in a target security at regular intervals over a certain period of time, regardless of price. It can make it easier to deal with uncertain markets by making purchases automatic. It also supports an investor’s effort to invest…
-
Working with FRED API in Python: U.S. Recession Forecast & Beyond
Featured Photo by Lukas on Pexels. FRED stands for Federal Reserve Economic Data, and is a database of time series economic data that has been aggregated from a bunch of sources. This is a great place to find financial data. You can visit the FRED web site to search for a data series or use the Python fredapi to download data…
-
Joint Analysis of Bitcoin, Gold and Crude Oil Prices with Optimized Risk/Return in 2023
Referring to the recent fintech R&D study in Python, let’s discuss joint time-series analysis of Bitcoin (BTC), Gold (GC=F) and Crude Oil (CL=F) prices 2021-23 with the subsequent Markowitz portfolio optimization of these 3 assets in 2023. Goals: Scope: Input Data Let’s set the working directory import os os.chdir(‘PORTFOLIORISK’) os. getcwd() and import the following…
-
Advanced Integrated Data Visualization (AIDV) in Python – 1. Stock Technical Indicators
Featured Photo by Monstera on Pexels. In this project, we will implement the following Technical Indicators in Python: Conventionally, we will look at the following three main groups of technical indicators: Input Stock Data Let’s set the working directory VIZ import osos.chdir(‘VIZ’)os. getcwd() and import the key libraries import datetime as dtimport pandas as pdimport…
-
Eric Marsden’s Top 6 Reliability/Risk Engineering Learnings
Featured Photo by Kammeran Gonzalez-Keola on Pexels Today we will review and test the Eric Marsden’s e-learning Python courseware and training materials on risk engineering, loss prevention and safety management under the Terms & Conditions of the Creative Commons Attribution-ShareAlike license. Table of Contents Lifetime of Light Bulbs Input: The lifetime of a light bulb is known to be exponentially…
-
Gold ETF Price Prediction using the Bayesian Ridge Linear Regression
Featured Photo by Pixabay. Let’s set the working directory GOLD import osos.chdir(‘GOLD’) os. getcwd() and import the following libraries from sklearn.linear_model import LinearRegression import pandas as pdimport numpy as np import matplotlib.pyplot as plt%matplotlib inlineplt.style.use(‘seaborn-darkgrid’) import yfinance as yf Let’s read the dataDf = yf.download(‘GLD’, ‘2022-01-01’, ‘2023-03-25’, auto_adjust=True) Df = Df[[‘Close’]] Df = Df.dropna() Let’s…
-
Deep Reinforcement Learning (DRL) on $MO 8.07% DIV USA Stock Data 2022-23
MLQ.ai: In fact, many AI experts agree that DRL is likely to be the best path towards AGI, or artificial general intelligence. Spinning Up in DRL at OpenAI: “We believe that deep learning generally—and DRL specifically—will play central roles in the development of powerful AI technology.” Key assumptions and limitations of the DRL framework: Key…
-
Predicting the JPM Stock Price and Breakouts with Auto ARIMA, FFT, LSTM and Technical Trading Indicators
Featured Photo by Pixabay In this post, we will look at the JPM stock price and relevant breakout strategies for 2022-23. Referring to the previous case study, our goal is to combine the Auto ARIMA, FFT, LSTM models and Technical Trading Indicators (TTIs) into a single framework to optimize advantages of each. Specifically, we will…
-
Applying a Risk-Aware Portfolio Rebalancing Strategy to ETF, Energy, Pharma, and Aerospace/Defense Stocks in 2023
In this post, we will apply the Guillen’s asset rebalancing algorithm (cf. the Python code) to the following risk-aware portfolio: stocks = [‘SPY‘, ‘XOM‘, ‘ABBV‘, ‘AZN‘, ‘LMT‘] The initial portfolio value to be allocated is portfolio_value = 10**6 and the weight allocation per asset is weights = [0.15 , 0.30, 0.40, 0.075, 0.075] Conventionally, our…
-
Risk-Return Analysis and LSTM Price Predictions of 4 Major Tech Stocks in 2023
The open-source Python workflow breaks down our investigation into the following 4 steps: (1) invoke yfinance to import real-time stock information into a Pandas dataframe; (2) visualize different dataframe columns with Seaborn and Matplotlib; (3) compare stock risk/return using historical data; (4) predict stock prices in 2023 with the trained LSTM model. Input Data Let’s…
-
Portfolio max(Return/Risk) Stochastic Optimization of 20 Dividend Growth Stocks
The goal of portfolio optimization is to build a stock portfolio that yields the maximum possible return while maintaining the amount of risk you’re willing to carry. Referring to our previous case study, let’s invoke the stochastic optimization algorithm and the corresponding code to create an optimized portfolio by testing 10,000 combinations of the following…
-
Towards Max(ROI/Risk) Trading in Q1 2023
In this post, we will compare 1Y ROI/Risk of selected stocks vs ETF using a set of basic stock analyzer functions. The posts consists of the following three parts: Looking at the closing price of a stock over time is a good way to track its performance We combine the risk and return metrics into…
-
The Donchian Channel vs Buy-and-Hold Breakout Trading Systems – $MO Use-Case
Featured Photo Graham Wizardo on Pexels In fact, this algo trading Python project was inspired by the recent thread by @simply_robo Indeed, this is all about Altria Group, Inc. (NYSE: MO) – a Dividend King moving beyond smoking. In this article, the historical data of $MO will be used to backtest and compare trading…
-
SARIMAX X-Validation of EIA Crude Oil Prices Forecast in 2023 – 2. Brent
Based on our previous study, our today’s focus is on SARIMAX time-series X-validation of the Brent crude oil spot price USD/b: viz. the goal is to verify the following EIA energy forecast in 2023 According to EIA, the Brent spot price will average $83.63/b in 2023. Table of Contents Prerequisites In this study we will be…
-
A Comparative Analysis of The 3 Best Global Growth Stocks in Q1’23 – 2. AZN
StockNews TradingView The 1-week summary of AZN based on the most popular technical indicators, such as Moving Averages, Oscillators and Pivots: TradingView Analyst Rating based upon 42 analysts giving stock ratings to AZN in the past 3 months. The 37 analysts offering 1 year price forecast for AZN. AlgoTrading Let’s set the working directory YOURPATH…
-
A Comparative Analysis of The 3 Best U.S. Growth Stocks in Q1’23 – 1. WMT
Featured Photo by Karolina Grabowska on Pexels Let’s begin with WMT that operates a chain of hypermarkets (also called supercenters), discount department stores, and grocery stores in the United States, headquartered in Bentonville, Arkansas. Table of Contents StockNews Rating TradingView Screening The 1-week summary of Walmart Inc is based on the most popular technical indicators, such as Moving Averages, Oscillators and…
-
Turkey/Syria Earthquake Live Knowledge Update & Charity Guide
Today’s Earthquakes in Turkey Sunday, 12 March 2023: Turkey has had: (M1.5 or greater) The largest earthquake in Turkey: Inside Turkey’s post-earthquake homelessness crisis – BBC News: Earthquake survivors are living on the streets in Turkey, one month on from the devastating earthquakes that killed more than 50,000 people across southern Turkey and northern Syria. Past Events…
-
SARIMAX X-Validation of EIA Crude Oil Prices Forecast in 2023 – 1. WTI
Featured Photo by Pixabay Table of Contents: Let’s perform SARIMAX X-validation of EIA WTI and Brent oil prices forecast in the 2nd half of 2023. Recall that SARIMAX (Seasonal Autoregressive Integrated Moving Average with eXogenous factors) is an updated version of the ARIMA model for time series forecasting. SARIMAX is a seasonal equivalent to SARIMA…