Skip to main content

Synthetic after-hours quote generator

Project description

afterquote

Synthetic after-hours quote generator based on an asset and its underlying security.

PyPI version PyPI downloads CI


What is this?

afterquote lets you estimate synthetic prices for a financial security based on the real-time performance of a given correlated underlying asset — useful when one market is closed and the other is still trading.


Installation

From PyPI:

pip install afterquote

Locally:

pip install -e .

Usage

from afterquote import SecurityPair

pair = SecurityPair("3USL.L", "SPY")
print(pair.info())
print(pair.pricing())

Example Output

                          base_security underlying_security  base_is_live  leverage           base_close_time  base_close_price  adj_percent_return  quote_price
quote_time
2026-06-19 00:59:00+01:00        3USL.L                 SPY         False         3 2026-06-18 16:30:00+01:00        177.869995            0.621451   178.975369
                            Impl_Open   Impl_High    Impl_Low  Impl_Close
Datetime
2026-06-18 16:30:00+01:00  177.869995  178.077587  177.733974  178.070422
2026-06-18 16:31:00+01:00  178.070422  178.185074  177.941470  177.941470
2026-06-18 16:32:00+01:00  177.927178  177.962971  177.769626  177.884217
2026-06-18 16:33:00+01:00  177.884217  177.934294  177.619327  177.741023
2026-06-18 16:34:00+01:00  177.762466  178.141756  177.762466  177.991464
...                                ...          ...          ...          ...
2026-06-19 00:55:00+01:00  179.061663  179.147951  179.040091  179.090425
2026-06-19 00:56:00+01:00  179.083234  179.131847  178.953792  179.004130
2026-06-19 00:57:00+01:00  179.004130  179.032887  178.982563  179.004130
2026-06-19 00:58:00+01:00  178.986158  179.025695  178.960997  179.025695
2026-06-19 00:59:00+01:00  179.007721  179.061640  178.946613  178.975369

Testing

pip install -e ".[test]"
pytest tests/

Live tests that hit real yfinance (skipped by default):

pytest tests/ --runlive

Contributing

Feel free to open issues or submit pull requests if you find bugs or want to improve the package - Junaid :)

License

MIT License. See the LICENSE file for full details.

Project details


Download files

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

Source Distribution

afterquote-0.3.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

afterquote-0.3.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file afterquote-0.3.0.tar.gz.

File metadata

  • Download URL: afterquote-0.3.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for afterquote-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b4a8135a9f8684c3d771b88708f9314679554d029733b943bde87c3db6f1423d
MD5 f367e5daa2aa50cf2a66c08edc274765
BLAKE2b-256 4e77f00695a770f23a1d355b778e1954a968b2a5d415273c761939e9dffc4e98

See more details on using hashes here.

File details

Details for the file afterquote-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: afterquote-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for afterquote-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b6162b2412e280f6f8323dcfc00d8ea4fae869e059d9f7bd92f398ba2a1aae
MD5 1af924587f9327ec86f892d165fcdcd9
BLAKE2b-256 c5dbd98a56955639a15f7dc0363e9ea3ed0842a84bc96bd9c08ba4e871958bdd

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