Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A lightweight python framework for Capital API

Project description

Liqueur

Liqueur is a lightweight trade framework for Taiwan stock market based on Taiwan securities broker company Capital's API. It is designed to make application start quickly and easy to use, so user can focus on strategy development.

Requirement

Capital API v2.13.18

Installation

Install the framework with pip:

pip install Liqueur

Quick Start

from liqueur import Liqueur, Config

conf = Config('.')
conf.from_mapping({
    "account": {
        "username": "A123456789",
        "password": "xxxxxxxx"
    },
    "subscription": {
        "quote": [2330],
        "detail": [],
        "kbar": [],
        "tick": []
    }
})

app = Liqueur(conf)


@app.hook_message()
def message_handler(message):
    print(message, end='')

@app.hook_quote()
def quote_handler(quote):
    print(quote)

if __name__ == "__main__":
    app.run()
$ python myapp.py
Login......ok
Connect......success
{
    "datetime": "2019-09-10 14:00:00.847484",
    "timestamp": 1568132147.847484,
    "orderbook_id": "2330",
    "name": "台積電",
    "high_price": 264.0,
    "open_price": 263.5,
    "low_price": 260.5,
    "close_price": 261.5,
    "bid_price": 261.5,
    "bid_qty": 251,
    "ask_price": 262.0,
    "ask_qty": 580,
    "buy_qty": 10733,
    "sell_qty": 18537,
    "tick_qty": 10,
    "total_qty": 29270,
    "ref_qty": 17186,
    "ref_price": 265.0,
    "up_price": 291.5,
    "down_price": 238.5,
    "simulate": 0
}

Project details


Release history Release notifications

This version

0.0.2

Download files

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

Files for liqueur, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size liqueur-0.0.2-py3-none-any.whl (16.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size liqueur-0.0.2.tar.gz (15.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page