# Portfolio Diversification Analysis with PCA

In this article I will analyze my (long only) stock portfolio using Principal Component Analysis or PCA to see whether it is properly diversified or not. I will then use my findings to make an educated decision as to how to enhance the portfolio’s diversification if required.

# This Trading Algorithm Landed Me in the Top 10 on Quantopian

I have developed a trading algorithm that was able to land me on the top 10 list of Quantopian’s algo trading contest. In this article I describe the details of my algorithm.

# Developing a Real Life Fully Automated Trading Algorithm Using Interactive Brokers and Python

In this article I describe how my backtested algorithm can be used in live algorithmic trading. My broker provides me with the TWS (Trader WorkStation) API which is the solution that I use to build my trading application.

# Pair Trading GLD and GDX

When the correlation between the two securities temporarily weakens, i.e. one stock moves up while the other moves down, the pairs trade would be to short the outperforming stock and to long the underperforming one, betting that the “spread” between the two would eventually converge. The divergence within a pair can be caused by temporary supply/demand changes, large buy/sell orders for one security, reaction for important news about one of the companies, and so on.

# Testing for Cointegration of GLD and GDX for use in a Pair Trading Strategy

In this research I am going to test whether the price series of two securities GLD (Gold Price) and GDX (Gold Miners Equity ETF) are cointegrated. This is crucial if we want to develop a pair trading strategy around those two securities. I want to test if the spread between the two series is stationary around its mean. For my pair trading strategy I want the two securities to be cointegrated. For my research I am using Python.

# Yield To Maturity Calculation Using a Python Script

When interested in buying bonds a term that often comes up is the definition of Yield To Maturity (YTM).

# How to Compute the Compound Annual Growth Rate

We know that the compound annual growth rate (CAGR) is the mean annual growth rate of an investment over a specified period of time longer than one year.

# How to Derive The Bond Pricing Formula

When you calculate the price of a bond, you are determining the maximum price you would want to pay for the bond, based on how its coupon rate compares to the average rate most investors are currently receiving in the bond market.

# Calculating Stock Beta

The Beta of an asset is a measure of the sensitivity of its returns relative to a market benchmark (usually a market index). How sensitive/insensitive is the returns of an asset to the overall market returns (usually a market index like S&P 500 index). What happens when the market jumps, do the returns of the asset jump accordingly?

# Calculate Present Value Of Perpetuity

In a previous post I have described what perpetuity is and how we can derive the formula for the present value of perpetuity. In this article I describe how it can be used in combination with the discounted value of cash flows model.

# Why Use Logarithmic Returns In Time Series Modelling

In this post I state a few reasons why one should consider using log returns when doing timeseries analysis.

# How the US Federal Reserve sets Interest Rates

Unless you have been living under a rock, you’ll have heard news about the FED lowering interest rates numerous times. What does this actually mean and how does the FED manage to do that? This article describes how interest rates work and how the FED is able to raise or lower interest rates through its FOMC meetings.

# How Do You Determine the Insider Ownership Percentage of a Given Company?

If you’re an investor, it pays to know what the company’s owners and most important shareholders are doing. By watching the trading activity of corporate insiders and large institutional investors, it’s easier to get a sense of a stock’s prospects.

# Warren Buffett's Intrinsic Value Calculator

In this post I will summarize how one can compute the intrinsic value of a company according to the below quote from Warren Buffet:

# Deriving The Perpetuity Formula

Perpetuity refers to an infinite amount of time. In finance, perpetuity is a constant stream of identical cash flows, C, with no end. In this post I explain how one can derive the Perpetuity Formula.

# Solve for Number of Periods - PV & FV

Often times when you read something like “Annual increases at a 10% rate would lead to the doubling of prices every seven years”, you might be wondering how one would go about calculating the length of time required for a single cash flow(present value) to reach a certain amount(future value) based on the given rate.

# Pair Trading S1 and S2

This is a generic Notebook, similar to the one Pair Trading GLD and GDX, where I am going to pair trade two securities. The backtesting also includes broker fees. All I have to do is adjust my input parameters such as ticker symbols and dates. The algorithm then fetches the 10 year historical price data from Nasdaq and simulates the pair trading strategy.