Macrosynergy Quant Research Package
Project description
Macrosynergy Quant Research
The Macrosynergy package supports financial market research and the development of trading strategies based on formats and conventions of the J.P. Morgan Macrosynergy Quantamental System (JPMaQS). JPMaQS provides quantitative-fundamental (quantamental) and market data in simple daily formats in accordance with the information state of markets. The Macrosynergy package consists of five sub-packages:
- management: simulates, analyses and reshapes standard quantamental dataframes.
- panel: analyses and visualizes panels of quantamental data.
- signal: transforms quantamental indicators into trading signals and does naive analysis.
- pnl: constructs portfolios based on signals, applies risk management and analyses realistic PnLs.
- dataquery: interface for donwloading data from JP Morgan DataQuery, with main module api.py.
Installation
The easiest method for installing the package is to use the PyPI installation method:
pip install macrosynergy
Alternatively, we you want to install the package directly from the GitHub repository using
pip install https://github.com/macrosynergy/macrosynergy@main
for the latest stable version. Alternatively for the cutting edge development version, install the package from the develop branch as
pip install https://github.com/macrosynergy/macrosynergy@development
Usage
DataQuery Interface
To download data from JP Morgan DataQuery, you can use the DataQuery Interface together with your OAuth authentication credentials:
import pandas as pd
from macrosynergy.dataquery import api
with api.Interface(
oauth=True,
client_id="<dq_client_id>",
client_secret="<dq_client_secret>"
) as dq:
data = dq.download(tickers="EUR_FXXR_NSA", start_date="2022-01-01")
assert isinstance(data, pd.DataFrame) and not data.empty
assert data.shape[0] > 0
data.info()
Alternatively, you can also the certificate and private key pair, to access DataQuery as:
import pandas as pd
from macrosynergy.dataquery import api
with api.Interface(
oauth=False,
username="<dq_username>",
password="<dq_password>",
crt="<path_to_dq_certificate>",
key="<path_to_dq_key>"
) as dq:
data = dq.download(tickers="EUR_FXXR_NSA", start_date="2022-01-01")
assert isinstance(data, pd.DataFrame) and not data.empty
assert data.shape[0] > 0
data.info()
Both of the above example will download a snippet of example data from the premium JPMaQS dataset of the daily timeseries of EUR FX excess returns.
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 Distribution
Built Distribution
Hashes for macrosynergy-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81cf969c58f9ff9bbe169d738d3bee50908d6436bafebc20521d184e7b33fbb3 |
|
MD5 | 5c624b13f42370e7d0629743335097a2 |
|
BLAKE2b-256 | 63471cc73b547badfc6e700180f241fed9dc927703b8ab511a992c770b1b7961 |