Sinopac All New Trading Api.
Project description
Shioaji
Shioaji is a trading API provided by Sinopac that offers a comprehensive and user-friendly platform for accessing the Taiwan financial markets. With Shioaji, you can trade a variety of financial instruments including stocks, futures, and options using your favorite Python packages such as numpy, scipy, pandas, pytorch, or tensorflow to build your own custom trading models. The platform is easy to use and intuitive, with advanced charting tools, real-time market data, and a customizable interface that allows you to tailor your trading experience to your specific needs. Shioaji is fast and efficient, with a high-performance core implemented in C++ and using FPGA event broker technology, and it is the first Python trading API in Taiwan that is compatible with Linux and Mac, making it a truly cross-platform solution. Whether you are a beginner looking to get started in the world of trading or an experienced trader looking for a more powerful platform, Shioaji has something to offer. Sign up for a free account today and start trading with confidence.
Installation
Binaries
simple using pip to install
pip install shioaji
Docker Image
simple run with interactive mode in docker
docker run -it sinotrade/shioaji:latest
or
docker run -it sinotrade/shioaji:{version}
run with jupyter lab or notebook
docker run -p 8888:8888 sinotrade/shioaji:jupyter
Quickstarts
Initialization
import shioaji as sj
api = sj.Shioaji()
accounts = api.login("YOUR_TOKEN", "YOUR_SECRET_KEY")
api.activate_ca(
ca_path="/c/your/ca/path/Sinopac.pfx",
ca_passwd="YOUR_CA_PASSWORD",
person_id="person_id of this ca",
)
Just import our API library like other popular python library and new the instance to start using our API. Login your account and activate the certification then you can start placing order.
Streaming Market Data
api.quote.subscribe(api.Contracts.Stocks["2330"], quote_type="tick")
api.quote.subscribe(api.Contracts.Stocks["2330"], quote_type="bidask")
api.quote.subscribe(api.Contracts.Futures["TXFC0"], quote_type="tick")
Subscribe the real time market data. Simplely pass contract into quote subscribe
function and give the quote type will receive the streaming data.
Place Order
contract = api.Contracts.Stocks["2890"]
order = api.Order(
price=9.6,
quantity=1,
action="Buy",
price_type="LMT",
order_type="ROD",
order_lot="Common",
account=api.stock_account,
)
# or
order = api.Order(
price=9.6,
quantity=1,
action=sj.constant.Action.Buy,
price_type=sj.constant.StockPriceType.LMT,
order_type=sj.constant.OrderType.ROD,
order_lot=sj.constant.StockOrderLot.Common,
account=api.stock_account,
)
trade = api.place_order(contract, order)
Like the above subscribing market data using the contract, then need to define the order. Pass them into place_order
function, then it will return the trade that describe the status of your order.
Conclusion
This quickstart demonstrates how easy to use our package for native Python users. Unlike many other trading API is hard for Python developer. We focus on making more pythonic trading API for our users.
More usage detail on document.
Communication
Releases and Contributing
Shioaji has a 14 day release cycle. See the release change log. Please let us know if you encounter a bug by filing an issue.
We appreciate all suggestions. If you have any idea want us to implement, please discuss with us in gitter.
The Team
Shioaji is currently maintained by Sally, Yvictor, CC.Chiao and Po Chien Yang with major contributions.
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 Distributions
Built Distributions
Hashes for shioaji-1.1.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 183aed53f6429d5176a939c82974edf48d4fe212cda36a1cf8aaed89c22c59a9 |
|
MD5 | 1464a89db7849a2e57fcd9c7b7a2fae2 |
|
BLAKE2b-256 | 8d58356274ef068a6a404f5da3335a4d1d7dc444fe42fb45cb13cfd7096c2b9f |
Hashes for shioaji-1.1.4-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2995d22014431140aedfacc1898b483716f11f3fe85d1a073a2d4b719de4ba9e |
|
MD5 | 18bf1859c15c915aec8b2b3f8bdf67a8 |
|
BLAKE2b-256 | 404a907fcced95d45c4d6cf92226f575e35958d64c0e895e83082c999455eddf |
Hashes for shioaji-1.1.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40ea3dcb4a619c1534b6dd1095187f39c4144d8f3af2ddca4ce09154c86a0584 |
|
MD5 | 1dc6d1e460b631aef9461eee7cd32d34 |
|
BLAKE2b-256 | 6233fa63e30ec6fa302f5cc4e775d33c0bcc7b0c3ca4345ed016f0ac3f81f2e3 |
Hashes for shioaji-1.1.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fffae4858265f468c8c76ac993017eb9e623a7aea90d4bf02cbae0596c48df6 |
|
MD5 | b97756d2497c410a0cd1c3bec6febd95 |
|
BLAKE2b-256 | e380154b3c9174b89d7d4b002ba8f724676022ff23733a68efd8e22a345e67a6 |
Hashes for shioaji-1.1.4-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bfa37f14d422b7f0492c1d76665d66f223fc457a4b78e6fac874e3519e8e3b5 |
|
MD5 | c9008858928ea3b2d841e1f34e5ae8e0 |
|
BLAKE2b-256 | 74787ecff44addf5007bd7d8f7061a03f7b693b675f8c71f153c58e38c79bf2b |
Hashes for shioaji-1.1.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96bc5c604c48a1a8f0ecbad2f4dbe2c69d0fa7938864c613e0d872531374ca87 |
|
MD5 | 21870a3942a4fb1ca27fa744bfe3b159 |
|
BLAKE2b-256 | d43aeb0715dea44df398002bc963fd99da0022986380238c6aca5a027486e76f |
Hashes for shioaji-1.1.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a8141c05a514cc95806392c34925e2a11a6010b808afeb204d8cb2edb38dc46 |
|
MD5 | 09e632752bac200b7848815c4255ab9a |
|
BLAKE2b-256 | ae4bdbb32e7dcd707f6dbb40efe17c243b3a7a93a0709f45a04ff4bd948bcd9f |
Hashes for shioaji-1.1.4-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | def99087fb0c1757b5a186e938801f4d4bb9b1b75205ff29aa4488d2fb76c886 |
|
MD5 | 8ddea0519936f91ab05058e169b11019 |
|
BLAKE2b-256 | b8b1779b96744a576a3eb501148c2a86444ab870d8310fa6582a3cb2caef2aa3 |
Hashes for shioaji-1.1.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2cb369a37263a330205e82da4e4841981a00eb916f4c77da1d4e1f2792e8a1 |
|
MD5 | daf05095981fc48f0060148b4cbe652b |
|
BLAKE2b-256 | a474871404ca1d9bb6200a93823f0f6b4d55ac64a49eaacb4669080b250189cf |
Hashes for shioaji-1.1.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5a69be98d315d2edb957cb1afb11ca30cc397385fa194e498d6f7c9548fcd43 |
|
MD5 | ff26bd7150aa57ba4ae669b8c9f7d77b |
|
BLAKE2b-256 | c49b27302dc17d00435cd4c888ee39983280326446675bd4cca458a6e0701de1 |
Hashes for shioaji-1.1.4-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4378df01712e585e6c80222e0da6871c0b55044a9dc38c67ef0a7ed4b6a92674 |
|
MD5 | e00aa8bc213162ee464e1ff843cec90b |
|
BLAKE2b-256 | 57a756a0c38107dbc40827055853c6f91274d85da89c5943a356a2aab3de0403 |
Hashes for shioaji-1.1.4-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82518dd03da19e5ce804ac3b9ac89addfd868d077b0355b2c8fc2aa872a00ce7 |
|
MD5 | f438ee898a5e030ed7ceff2c46e2dc81 |
|
BLAKE2b-256 | 5e9215bc2e317d72d7de175cedcc4a970fec95b8bc0ac6374087a77ae24c5414 |
Hashes for shioaji-1.1.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45257b3dd96d15b039ba3a52654f2e384d8072bd57c4088c9e8927e5cd66700a |
|
MD5 | aa4d1b355b326fda3bef200356b4d0bc |
|
BLAKE2b-256 | aff786f0974e6d29e4703f0c949cf36eb8f6078c53d229cab76bf1ef29cea43b |
Hashes for shioaji-1.1.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f29014130eb9f4304db17c20b1e27424e10ab6421d458f622a05ca2c0074db2 |
|
MD5 | 0f4eb5eaa003a92668cffe05b8af0feb |
|
BLAKE2b-256 | 159df33700458925d14c3484fc762ef88c993484e07bad57354fbfabfe3a4247 |
Hashes for shioaji-1.1.4-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 541b8159f1d8de52f31a622345dea9c43e6363f3c144c7f06d9e113cce2b2eef |
|
MD5 | 1cbbe96edbf0333a9a5c44bdd6227bad |
|
BLAKE2b-256 | 7ba0e3c538c147a7c3248418aaa0fee0bab67d5d5934542fb101880806b9baec |
Hashes for shioaji-1.1.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ea6a2094cfe480e762b260d4a7d835d9c92830b9461acb46f0e39cd399bdc4 |
|
MD5 | 05b1d8719b8f53245f45ac211eadeeec |
|
BLAKE2b-256 | d5872581cb36a931641d05df48a62127daeed21a004bed9dd3d4ad2144f6eb2f |
Hashes for shioaji-1.1.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870306417b7ec3e3684164ce734b94c5ffa71b4f83025e72f0a626b1cc1625bd |
|
MD5 | 9a487023066faa99c6439e70f2521570 |
|
BLAKE2b-256 | 1eccaa1235dbe978f52d2dd386b3b5edd888b26a21cdaa391c9c7985559bbadc |
Hashes for shioaji-1.1.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb3e1451a7a61ee074e6acbbf380fa4db1381e1adc881320bc82bbd09b1698d0 |
|
MD5 | a993fc236af957b80bd088c6d656b832 |
|
BLAKE2b-256 | 3e36a7a52cc652ed04559d2c929c635a0c332ec6ee027da3adf598d90b0f6c13 |
Hashes for shioaji-1.1.4-cp36-cp36m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b04b64896a5410c4d435993446d9e201b61e72d6e14c06a7f321b7b105c3f7c7 |
|
MD5 | ed161415792256f6eaa733fb94b01e89 |
|
BLAKE2b-256 | e123ac3d5f1bf85476a0cb6ccbb26feacf40820fb9586b6dbdb74e44f9e18a5e |
Hashes for shioaji-1.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f51bbe629af6d66c1d34b46da2fd52cbd2c7f497166b684591c2719c5d24c0 |
|
MD5 | bb8f03b073d172b42377b1d89ad60bc4 |
|
BLAKE2b-256 | eb7dd70797d18d5690ee006e2c6437bba4c2c92bd5798ecad45e54f68433ca32 |
Hashes for shioaji-1.1.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b276ca06e5b4a9d540d26d54efc1284bfc9bbcbe719dcecf1e6a95029ff08280 |
|
MD5 | 93b45c217df4c1836dcd435917db04f5 |
|
BLAKE2b-256 | 9673f34b83cc596b0bd003dad5a0877c5dc862ee6e047236cc4037ed5df8e6a5 |