Skip to main content

Macrosynergy Quant Research Package

Project description

Macrosynergy

Macrosynergy Quant Research

PyPI Latest Release Package Status License Downloads Code style: black

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:

  1. management: simulates, analyses and reshapes standard quantamental dataframes.
  2. panel: analyses and visualizes panels of quantamental data.
  3. signal: transforms quantamental indicators into trading signals and does naive analysis.
  4. pnl: constructs portfolios based on signals, applies risk management and analyses realistic PnLs.
  5. 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

macrosynergy-0.0.17.tar.gz (152.3 kB view hashes)

Uploaded Source

Built Distribution

macrosynergy-0.0.17-py3-none-any.whl (233.3 kB view hashes)

Uploaded Python 3

Supported by

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