Bringing data driven investments to the mainstream
Project description
fastquant :nerd_face:
Bringing data driven investments to the mainstream
fastquant allows you easily backtest investment strategies with as few as 3 lines of python code. Its goal is to promote data driven investments by making quantitative analysis in finance accessible to everyone.
Features
- Easily access historical stock data*
- Backtest trading strategies with only 3 lines of code
*
- Only Philippine stock data is available so far, but more countries will be covered soon with Yahoo Finance integration
Installation
pip install fastquant
Get stock data
Accessed via the phisix API
from fastquant import get_stock_data
df = get_stock_data("JFC", "2018-01-01", "2019-01-01")
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
Release history Release notifications | RSS feed
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
Close
Hashes for fastquant-0.1.2.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0011b9b1c33e5f176dd21bad69b7b3f8de61272d409e251a543721390844333 |
|
MD5 | 4dee8412dafb4490b5d61b596a78ceff |
|
BLAKE2b-256 | 7dac480a3b8c7a4649327aac2b98c8bea17887ce8018319e88ebb881a91a3d33 |