Skip to main content

A django library for tracking and storing the prices of assets over time.

Project description

django-candlestick

django-candlestick is a django library for storing price data for stocks, assets, currencies, and other tradeable instruments.

Setup

Install:

$ pip install django-candlestick

Add to installed apps:

INSTALLED_APPS = [
    ...
    "django_candlestick"
    ...
]

Migrate:

$ python manage.py migrate

You now have a database of tradeable instruments and their prices.

Use

from django_candlestick.models import Instrument, Bar
apple = Instrument.objects.create(
    symbol="AAPL", name="Apple, Inc.", currency="USD", timezone="US/Eastern"
)
bar = Bar.objects.create(
    open="320.13", low="319.88", high="321.4", close="320.17", volume=3115337,
    timestamp=1579887000, resolution="H", instrument=apple
)
print(bar.datetime) # 2020-01-24 12:30:00-05:00

Project details


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

django_candlestick-0.1.0-py3-none-any.whl (17.4 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