Skip to main content

The easiest way to access and analyze Philippine stock data

Project description

fastquant :nerd_face:

Build Status Code style: black License: GPL v3

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 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)

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)

Backtesting templates

Using the 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastquant-0.1.2.6-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file fastquant-0.1.2.6-py3-none-any.whl.

File metadata

  • Download URL: fastquant-0.1.2.6-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for fastquant-0.1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5cbf6a385a3f38e703ea08a88d444dc90d2e050828182d0ce99437cf73a2f317
MD5 6ee55b758541fe97c2972ae818983428
BLAKE2b-256 646b2ead2acb043efa8c3da3d7db80f80515428960c8295b85d80faf574660da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page