continued….using multiple tickers.

Image for post
Image for post

Table of Contents:

  • Set & Visualize Metrics
  • Backtest
  • Analyze Portfolio
  • Serve Dashboard

To begin, let’s first understand the goal of this article, which is to provide the average retail investor with a quick and easy way to pull live data, use that data to highlight key indicators and create a nice clean readable table before investing in a particular company(s).

This process will help you take emotion out of the equation and give you enough information to make informed decisions.

Substitute any stock ticker(s) you would like at the bottom of the code…


Beginner level coding with advanced techniques.

Image for post
Image for post

Table of Contents:

  • Set the Short and Long windows (SMA)
  • Generate trading signals
  • Plot Entry/Exit points
  • Backtest
  • Analyze Portfolio metrics
  • Serve Dashboard

Introduction

To begin, let’s first understand the goal of this article, which is to provide the average retail investor with a quick and easy way to pull live data, use that data to highlight key indicators and create a nice clean readable table before investing in a particular company(s).

This process will help you take emotion out of the equation and give you enough information to make informed decisions. …


#TradersWhoCode

Image for post
Image for post

AGENDA:

  1. Introduction to Trend and Momentum indicators.
  2. Generate trading signals
  3. Plot Entry/Exit points
  4. Interpret Graphs

Installation & Setup

I am going to assume most people already have python setup but in case you are new to coding, please navigate to the documentation and get your computer ready to go before you continue.

For those of you who have used Python and are comfortable with your setup, you can just import the libraries listed below and skip to the meat of this article.

pip install yfinance


Beginner level coding with advanced techniques.

Image for post
Image for post

TABLE OF CONTENTS:

  • Format DataFrame
  • Calculate Daily Returns
  • Generate Exponential Moving Averages (short / long window)
  • Plot Closing Prices of Bitcoin with EMA
  • Calculate daily volatility
  • Construct Bollinger Bands

Introduction:

To begin, let’s first understand the purpose of this article, which is to provide the average retail investor with a quick and easy way to import data, use that data to highlight key indicators and plot an informative graph for us to evaluate our positions.

In this article we will cover a three fundamental trading signals using various technical indicators.

# Import libraries and dependencies
import pandas as pd
import numpy as np
from pathlib import Path
%matplotlib…


Advanced techniques with simple Python code

Image for post
Image for post

By the end of this story you will understand how to use the popular Python library Scikit-Learn to predict gold prices. We will compare a linear regression model with a train / test split to a model trained using a rolling out-of-sample dataset.

TABLE OF CONTENTS:

  • Import ‘Linear Regression’ from Scikit-Learn.
  • Create ‘Return’ and ‘Lagged Return’ columns.
  • Plot USD value of Gold.
  • Split the data set for Gold into Train & Test.
  • Create and Fit the model to our train data and test on out of sample data. …


Image for post
Image for post

Today we will discuss how to visualize your portfolio in under 2 minutes using Python. Simply substitute the tickers listed below with the stocks in your portfolio and print a simple pie chart with live data.

import datetime as dt
import matplotlib.pyplot as plt
from pandas_datareader import data as web
tickers = ['PTON','CRWD','MRNA','PLTR','NVDA','PLUG','SNOW']
amounts = [12,15,20,30,8,18,5]
prices = []
total = []
# SET THE OUTLINE OF THE PIE CHART
fig, ax = plt.subplots(figsize=(10,10)) …


As an investor, it’s a good idea to diversify your portfolio with short term and long term investments. When you begin to analyze companies and determine which bucket a company falls in, you probably want to know the expected return on an annual basis.

In this article, I’d like to walk you through one example of how you can use python to quickly analyze the average daily return in different date ranges. In this case we will be analyzing semiconductor stocks.

  • 3 year
  • 5 year
import pandas as pd
from pathlib import Path
%matplotlib…


In this article you will understand a few basic steps for how to import and clean data from an Excel or CSV file and use Python to visualize market data.

To begin, I’d like to point out two key points to remember when analyzing stocks and pulling information. The first you’ve probably heard before, which is that you’re only as good as the quality of the data. If the data you are pulling is easily accessible, you should assume that many other people are using the same information. …


My story begins in 2020 when the pandemic hit and like most people I was out of work with the chance for a fresh start. Unhappy with my current situation, I decided I was going to sit down and put a plan together to figure out the direction I wanted my life to go. I wrote down the things I truly enjoyed doing and thought about what got me excited to learn. From there I could figure out how I was going to make a career doing those things.

In April, I enrolled in a FinTech Boot-Camp where I would spend the next 6 months in a virtual classroom learning how to code with Python, how to predict stock prices with machine learning, we even learned how to create our own Ethereum blockchain to make transactions. I looked forward to every class and couldn’t wait to see what we were going to learn next. I began watching CNBC every morning, learning everything I could about markets. I read books and watched as many YouTube videos as I could to open my mind to the world of Finance and I loved it! …

About

Scott Andersen

Application Developer | Stock Analyst

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store