Skip to content

Daily return computation and Moving Average inspired by quantstart

Notifications You must be signed in to change notification settings

Jicheng-Yan/TomStarke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daily Return and Moving Average Based Trading Strategy

Daily return computation and Moving Average based trading strategy inspired by quantstart.com.

Daily Return of a stock

The dailyReturn.py calculates the daily return of an asset and plots a histogram of the daily return data. The stock data is downloaded from yahoo finance. Other than the python imports, some basic functions used in dailyReturn.py can be found in utils.simpleCals.py.

Moving average based strategy

This is mostly copied from quantstart.com. movingAverage.py starts with a portfolio of 100,000 in Jan, 1, 1990 and runs till Jan 1, 2012. It buys and sells 100 shares of Apple inc. (AAPL) everytime the 100 day moving average crosses the 400 day moving average.

The buy and sell signals are indicated in the magenta and black triangles respectively in the plots. The plots are otherwise self explanatory in nature.

About

Daily return computation and Moving Average inspired by quantstart

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages