This articles demonstrates how to measure the risk adjusted performance of financial portfolios.

Photo by Ioannis Ritos from Pexels

Related Read

Source code of this article can be downloaded from Github: Link

A financial portfolio is a collection of different assets such as stocks, bonds, ETFs, mutual funds, etc. The performance of any portfolio directly correlates to it’s constituents. Each asset within the portfolio has different return. The total return of the portfolio is determined by weight of each asset w multiplied by return of each asset r:


This articles demonstrates how to measure the correlation of financial portfolios to build diversified portfolios.

Photo by mostafa meraji on Unsplash

Related Read

Source code of this article can be downloaded from Github: Link

In the context of finance, a portfolio is a collection of different financial assets (securities) such as stocks, bonds, exchange traded funds (ETFs), mutual funds, and/or cash. According to Markowitz (1952), the process of selecting a portfolio may be divided into two stages:

  • Forming beliefs and forecasts about future performance of securities
  • Selecting appropriate securities based on risk and return metrics to create a portfolio

Uncertainty about the future performance of securities is the main contributor to portfolio deterioration. Because we do not possess a crystal ball to observe…


Part 3 of this multiple-part series on the most popular convolutional neural network (CNN) architectures with reproducible Python notebooks

Convolutional neural networks are a special type of neural network that is used for modeling data with strong spatial correlations such as images, multivariate time-series, earth science studies (seismic classification and regression), among many other applications. Convolutional networks have gone under significant changes since 1998 and in this series of articles I aim to reproduce the famous model architecture champions such as LeNet, AlexNet, ResNet etc. My aim is to share my findings and studies with wider audiences and deliver reproducible Python notebooks.

Photo by Ricardo Frantz on Unsplash

Part 1: Lenet-5 and MNIST classification in Tensorflow:

Part 2: AlexNet classification on ImageNet and Tensorflow:

The…


Multipart series on time series analysis with Python applied to financial datasets

Photo by Pixabay from Pexels

Source code of this article can be downloaded from Github: Link

Time Series

A time series is a series of data points indexed in time order. Time series resolution is the frequency that data is recorded. For example, heart rate measurements (in units of beats per minute) occur at 0.5 second intervals, so that the length of each series is exactly 15 minutes. Stock data resolution can have different resolution depending on frequency of which data is recorded like: second, minute, hour etc.


Part 2 of the multiple-part series on the most popular convolutional neural network (CNN) architectures with reproducible Python notebooks

Convolutional neural networks are special type of neural network that is used for modeling data with strong spatial correlations such as images, multivariate time-series, earth science studies (seismic classification and regression) among many other applications. Convolutional networks have gone under significant changes since 1998 and in this series of articles I aim to reproduce the famous model architecture champions such as LeNet, AlexNet, ResNet etc. My aim is to share my findings and studies with wider audiences and deliver reproducible Python notebooks.

Credit: https://unsplash.com/@cbarbalis

Part 1: Lenet-5 and MNIST classification in Tensorflow:

Part 3: VGGnet classification on ImageNet and Tensorflow:

The Python…


Part 1 of the multiple-part series on the most popular convolutional neural network (CNN) architectures with reproducible Python notebooks.

Photo by Charles Deluvio on Unsplash

Convolutional neural networks are a special type of neural network that is used for modeling data with strong spatial correlations such as images, multivariate time-series, earth science studies (seismic classification and regression) among many other applications. Convolutional networks have gone under significant changes since 1998 and in this series of articles, I aim to reproduce the famous model architecture champions i.e. LeNet, AlexNet, Resnet. My aim is to share my findings and studies with wider audiences and deliver reproducible Python notebooks.

Part 2: AlexNet classification on ImageNet and Tensorflow:

Part 3: VGGnet classification on ImageNet and Tensorflow:

The Python notebook…


Photo by Malvestida Magazine on Unsplash

There are a plethora of stock alert systems available for free or for a nominal price. However, I found most of these alert system too simplistic (e.g. daily price movement, magnitude, etc.). Maybe I was not lucky enough to find better alert system so I decided to write an alert system on my own using Python and Windows Task Scheduler. The idea is to create a sophisticated alert system that triggers every day at market close (or open depending on your applications), finds stocks that fit your criteria, and send an email including stock symbols.

Code Structure

  • Trigger code at specific times…


In the first part of this article (Link) we overview terminologies of upstream data, and data required to build this case study. In this part, we are going into details of how to build the dashboard. Just to refresh your memory, we are going to build following dashboard:

Upstream Oil and Gas Dashboard

First Panel

This panel contains number of wells in top counties. Since wells are scatter over entire region, here I limited my bar plot to counties with at least 700 wells. To accomplish this i am going to use d3.nest() command as demonstrated below. d3.nest is applied to EfData by pairing county location key…


In this tutorial I am going to show you how to build a dashboard with JavaScripts and D3.js to visualize upstream oil and gas data. But before that I am going to explain some terminologies, required data, and step by step implementation. This tutorial is going to serve you as a guide on how to build consumable visualizations for clients.

The data and codes can be found on my Github Page.

You can create your own visualizations and share it with audiences here. …


Using Python to explore seasonal effects on stock market and it’s different components

Photo by Balazs Busznyak on Unsplash

Code

Script to create this study is stored at my Github Page.

Related Reads

Fama (1970) introduced efficient market hypothesis (EMH), stating the prices of securities fully reflect available information. Therefore, investors buying securities in an efficient market should expect to obtain an equilibrium rate of return. Later he introduced three different form of market efficiency: weak, semi-strong, and strong. Anomalies are empirical results that seem to be inconsistent with maintained theories of asset-pricing behavior. One class of market anomalies is seasonality and changes in market trend during different seasons. Seasonality in stock returns is a closely related to week-form of market efficiency…

Amir Nejad

PhD. Engineer | Data Scientist | Problem Solver | Solution Oriented (twitter: @Dr_Nejad)

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