Metadata-Version: 2.1
Name: fastquant
Version: 0.1.2.6
Summary: The easiest way to access and analyze Philippine stock data
Home-page: https://github.com/enzoampil/fastquant
Author: Lorenzo Ampil
Author-email: lorenzo.ampil@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: backtrader (==1.9.74.123)
Requires-Dist: beautifulsoup4 (==4.8.2)
Requires-Dist: black (==19.10b0)
Requires-Dist: bs4 (==0.0.1)
Requires-Dist: certifi (==2019.11.28)
Requires-Dist: chardet (==3.0.4)
Requires-Dist: idna (==2.8)
Requires-Dist: lxml (==4.4.2)
Requires-Dist: matplotlib (==3.1.2)
Requires-Dist: numpy (==1.18.0)
Requires-Dist: oauthlib (==3.1.0)
Requires-Dist: pandas (==0.25.3)
Requires-Dist: PySocks (==1.7.1)
Requires-Dist: python-dateutil (==2.8.1)
Requires-Dist: pytz (==2019.3)
Requires-Dist: requests (==2.22.0)
Requires-Dist: requests-oauthlib (==1.3.0)
Requires-Dist: six (==1.13.0)
Requires-Dist: soupsieve (==1.9.5)
Requires-Dist: tweepy (==3.8.0)
Requires-Dist: urllib3 (==1.25.7)

# fastquant :nerd_face:
[![Build Status](https://travis-ci.com/enzoampil/fastquant.svg?branch=master)](https://travis-ci.com/enzoampil/fastquant)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: GPL v3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

## Easiest way to access and analyze Philippine stock data

**fastquant** allows you easily access stock data with as few as 2 lines of python code. Its goal is to promote data driven investments by making quantitative analysis in finance accessible to everyone.

## Features
1. Easy access to *historical* Philippine stock data
2. Templates for backtesting trading strategies on Philippine stocks

## Installation
```
pip install fastquant
```

## Get Philippine stock data
Accessed via the [phisix](http://phisix-api2.appspot.com/) API
```
from fastquant import get_pse_data
df = get_pse_data("JFC", "2019-01-01", "2019-01-10")
print(df.head())

#           dt  close   volume
#   2019-01-01  293.0   181410
#   2019-01-02  292.0  1665440
#   2019-01-03  309.0  1622480
#   2019-01-06  323.0  1004160
#   2019-01-07  321.0   623090
```

## Plot daily closing prices
```
from matplotlib import pyplot as plt

df.close.plot(figsize=(10, 6))
plt.title("Daily Closing Prices of JFC\nfrom 2018-01-01 to 2019-01-01", fontsize=20)
```
![](daily_closing.png)

## Analyze with a simple moving average (SMA) trading strategy
```
ma30 = df.close.rolling(30).mean()
close_ma30 = pd.concat([df.close, ma30], axis=1).dropna()
close_ma30.columns = ['Closing Price', 'Simple Moving Average (30 day)']

close_ma30.plot(figsize=(10, 6))
plt.title("Daily Closing Prices vs 30 day SMA of JFC\nfrom 2018-01-01 to 2019-01-01", fontsize=20)
```
![](daily_closing_sma30.png)

## Backtesting templates
Using the [backtrader](https://github.com/backtrader/backtrader) framework

### Relative strength index (RSI) trading strategy (14 day window)
Daily Jollibee prices from 2017-01-01 to 2019-01-01
```
python examples/jfc_rsi.py
```
![](examples/jfc_rsi.png)

### Min max support resistance trading strategy (30 day window)
Daily Jollibee prices from 2017-01-01 to 2019-01-01
```
python examples/jfc_support_resistance.py
```
![](examples/jfc_support_resistance.png)


