Skip to main content

No project description provided

Project description

pyharmonics

pyharmonics detects harmonic patterns in OHLC candle data for any stock or crypto asset. See http://www.harmonictrader.com for more information on harmonic patterns and follow author Scott Carney.

Installation

From git

$ git clone git@github.com:niall-oc/pyharmonics.git
$ cd pyharmonics
$ pip install .
$ cd src
$ python
>>> from pyharmonics.marketdata import BinanceCandleData
...

From pypi

$ pip install pyharmonics
$ python
>>> from pyharmonics.marketdata import BinanceCandleData

Complete Guide

https://pyharmonics.readthedocs.io/en/latest/

Quick Guide

Use the market data features or generate your own market data matching the dataframe schema below. close_time, dts can be omitted

>>> from pyharmonics.marketdata import BinanceCandleData
>>> b = BinanceCandleData()
>>> b.get_candles('BTCUSDT', b.MIN_15, 1000)
>>> b.df
>>> b.df
                               open      high       low     close     volume  close_time                       dts
index                                                                                                             
2023-07-09 07:44:59+01:00  30249.04  30267.04  30233.79  30262.33   79.71611  1688885099 2023-07-09 07:44:59+01:00
2023-07-09 07:59:59+01:00  30262.32  30267.87  30235.00  30254.79  136.31718  1688885999 2023-07-09 07:59:59+01:00
2023-07-09 08:14:59+01:00  30254.80  30283.50  30233.33  30283.50  185.04086  1688886899 2023-07-09 08:14:59+01:00
2023-07-09 08:29:59+01:00  30283.50  30283.50  30263.37  30263.37   74.17937  1688887799 2023-07-09 08:29:59+01:00
2023-07-09 08:44:59+01:00  30263.37  30270.09  30243.10  30257.30  121.15791  1688888699 2023-07-09 08:44:59+01:00
...                             ...       ...       ...       ...        ...         ...                       ...
2023-07-19 16:29:59+01:00  29841.37  29902.00  29841.36  29878.00  267.42077  1689780599 2023-07-19 16:29:59+01:00
2023-07-19 16:44:59+01:00  29878.00  29933.00  29866.15  29890.01  245.03318  1689781499 2023-07-19 16:44:59+01:00
2023-07-19 16:59:59+01:00  29890.01  29995.16  29890.00  29956.46  611.16786  1689782399 2023-07-19 16:59:59+01:00
2023-07-19 17:14:59+01:00  29956.46  29979.00  29901.70  29930.57  365.35485  1689783299 2023-07-19 17:14:59+01:00
2023-07-19 17:29:59+01:00  29930.57  29930.57  29870.00  29901.40  244.14513  1689784199 2023-07-19 17:29:59+01:00

[1000 rows x 7 columns]

Create a technicals object for further analysis.

>>> from pyharmonics.technicals import Technicals
>>> t = Technicals(b.df, b.symbol, b.interval)

Search for a harmonic pattern.

>>> from pyharmonics.search import MatrixSearch
>>> m = MatrixSearch(t)
>>> m.search()

Plot the findings.

>>> from pyharmonics.plotter import Plotter
>>> p = Plotter(t, 'BTCUSDT', b.MIN_15)
>>> p.add_matrix_plots(m.get_patterns(family=m.XABCD))
>>> p.show()

You will see something like this. This is an image

See all harmonic patterns.

>>> p = Plotter(t, 'BTCUSDT', b.HOUR_1)
>>> p.add_matrix_plots(m.get_patterns())
>>> p.show()

You will see something like this. This is an image

See all forming patterns.

>>> m = MatrixSearch(t)
>>> m.forming()
>>> p = Plotter(t, 'BTCUSDT', b.HOUR_1)
>>> p.add_matrix_plots(m.get_patterns(formed=False))
>>> p.show()

etc.

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

pyharmonics-1.3.6.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

pyharmonics-1.3.6-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file pyharmonics-1.3.6.tar.gz.

File metadata

  • Download URL: pyharmonics-1.3.6.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pyharmonics-1.3.6.tar.gz
Algorithm Hash digest
SHA256 0245ea518edb83c1fe33651296625f652578df3223a16524aaf7aeb6b4408e2b
MD5 af2ab1ff55da6e082ce6e88c785a675f
BLAKE2b-256 71b2ab60eccb766a2bd2fa63e90fda639a864dc34fa48284b462020b762321c5

See more details on using hashes here.

Provenance

File details

Details for the file pyharmonics-1.3.6-py3-none-any.whl.

File metadata

  • Download URL: pyharmonics-1.3.6-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pyharmonics-1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bdfce9ec21e1f4bd6e767cc42ef069a038e31ff145a5dde65a2522025d936c43
MD5 ef6a30011a40281a379d26f28fb4d7d2
BLAKE2b-256 1db4deda4056b7fa73b114752809fc9a9fcb5d77ded4a7d10fb72a84eb8e0dc9

See more details on using hashes here.

Provenance

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