MultipleRegression_SP500_Prediction Multiple Regression for sp500 Prediction Using Sector ETFs¶ By Maxim Shen … Jul 12th 2016 In this example, we want to illustrate how we can predict SP500 index, given different sector ETF historical daily market data. We try to…

# Multiple Regression for sp500 Prediction Using Sector ETFs

# How to evaluate portfolio performance of systematic trading (under construction)

With the help of Quantopian high level API, let’s first implement a 5 day mean reversion buy & sell strategy on stock market. (strategy written in Python) Hypothesis: based on previous 5 day returns, bottom 10% stocks will likely go…

# Donations Comparison between Hillary vs Trump – Jupyter Notebook file included

You can download original Jupyter notebook file for this project from my Github repo US2016_Election_Donations In [1]: # By Maxim Shen July 1st 2016 # # This project tries to compare and visualize public donations # for Hilary Clinton and Donald…

# Solve Memory Leak 101

Recently, I was discussing with a few different people about memory leak. At first, for languages like C#, Java, etc, they all use managed memory and everything (managed resources) is garbage collected if those managed types are no longer reachable.…

# Web Plotting using Bokeh in Python 101

webIntegration In [1]: ################################################# # Web Plotting using Bokeh in Python # # In this tutorial, we will cover Bokeh usage # # 1. static plots # # 2. interactive plots # ################################################# ################################################# # 1. Static Plots # ################################################# import…

# Lazy Initialization Thread Safe & Auto Thread Safe for Singleton Pattern

We all know what Singleton Pattern is, one Class can’t allow more than one instance created. Now, we start from simple Singleton pattern implementation, then find different ways of making thread safe singleton class. First, basic Singleton Pattern /** *…

# Financial Time Series in Python using Pandas

high_frequency In [1]: ###################################################### # Financial Time Series in Python using Pandas # ###################################################### # This time we will cover # 1) Series in Pandas # 2) Dataframe in Pandas # 3) An example with more Pandas operations and ols regression…

# I/O operations for different data formats – using Python 3.X, Numpy, Pandas

Under construction … io_operations In [1]: # By Maxim Shen June 17th 2016 # # Python becomes more and more popular these days. Therefore, I try to # illustrate some topics covering python I/O involving different data # formats, with the…

# Elegant Algorithmic Crush – USing 1) difference array & 2) prefix sum

Today, I got a chance to come across a pretty elegant solution, involving 1) calculating difference array and 2) find ongoing prefix sum, in order to solve one problem from hackerrank.com First, here comes the problem. /* You are given…

# Better way to find all prime numbers less than N & time complexity O(log(log(N)))

Normally, when we need to find all prime numbers upto or less than user input N, we need total time complexity of O(N*sqrt(N)), because we use “trial division” to verify primality. Code as below in Java. public int countPrimes(int N){…