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.2.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b3d1a26ff08bcc25c4e95f7e96c7a9b1da4e9401f92809481745a6c832d6b7 |
|
MD5 | 27fbc5ae065d4734e299e98fe1068791 |
|
BLAKE2b-256 | e6573e852755ccb667c934caca9289bd955e26b1ed196ff33aaa27394ee2cd4f |
Hashes for shioaji-1.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16c4138a065d1732d997aaa3d7f39b775bdb3ea2308486548f87e45b7a81e099 |
|
MD5 | 86df1e1eceb44560b5cf7e9d301f0734 |
|
BLAKE2b-256 | 01cde3ee36220b2bf3376c2d56a72cf03eb9777770fd7ebadc409bf7bf33774f |
Hashes for shioaji-1.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5a74409481673e69b87305cbd195700e54fc544428c61207937ce6dabbacdf2 |
|
MD5 | ab869810add597e61279d3b5bd83b53b |
|
BLAKE2b-256 | cda88faaa24d998e5b217412d682575db2b15e382450e20625de2fa0fa876884 |
Hashes for shioaji-1.2.5-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a867fb9ae6c219244dbfde75c1d43c60c278138d34183b90d40f0f3928d61a |
|
MD5 | 06896473fef8ae60d540582f41b75cc4 |
|
BLAKE2b-256 | 902455e3ed0913b3fb323d07c8c106c33b4f96f59ccefc07955181b6f0dbecfa |
Hashes for shioaji-1.2.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 466f183bda5e00d9588a6ed39cff5282a59673316bb6e92a6639eab30357b4b1 |
|
MD5 | 922fad1ffef78af06a46983574894233 |
|
BLAKE2b-256 | 999e14a2223044e19d0e3bdb8bd014238915f3189b3be051b55a530b1cdda26f |
Hashes for shioaji-1.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f191e37f4c75ca78f4e8a0458d7479f50cde3282506c867cc2f0125d171b45 |
|
MD5 | 42fb8b521a3ed5be900480b1b3e992ad |
|
BLAKE2b-256 | 00c07a095dbaddbec3edcebecfa02c17c7e719fdaa08c03b4426dc7c6a2d5dfd |
Hashes for shioaji-1.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9163f386d0ada704b3436f547cbd1f8ae1da506df36039efbe9d483a9f51a4f |
|
MD5 | eeb60b6c31e2586e0c8598c1b7785cac |
|
BLAKE2b-256 | 0a31d8e93497c5999f2ad47f00f95af5cb59eea07d5822cacffd0b9f840796a5 |
Hashes for shioaji-1.2.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a60fe06d2258d97427b4aae38cfa2b374cf660dfa8a231129464cfd6ca48613a |
|
MD5 | bfd34abbefd226f2bbd057d25ab8dc23 |
|
BLAKE2b-256 | 8ff508903a0b1402b9facda97ddc91d819d9a2494264b243fb18b618de14e017 |
Hashes for shioaji-1.2.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b17b2bc716c2b2482313a6c5c7e6db4566e9546d509057c038bf5f624f97b8 |
|
MD5 | 9119c454e1e2db725cede49bea84d108 |
|
BLAKE2b-256 | 3392d186fb7c1c841b1d63718a0f73024c360ea779465ba105888e61e7a8cab4 |
Hashes for shioaji-1.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93088682c34681e3bbffcb495643221bcaf28186195aa11f7a6cbace575c5203 |
|
MD5 | fddc837b256f46e6f2342e91b0cf9dce |
|
BLAKE2b-256 | 786d0f1760debfdcbfffb97d9d2f69b47f71fe30671b4bad77559af16323ec81 |
Hashes for shioaji-1.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3378c3d5010b8185877e165681be217148828eea6af90a2cb5dd36bdb0b4268d |
|
MD5 | dc213e278aee9e5ff882a97251575edf |
|
BLAKE2b-256 | 92afc27b27f68cf51b398dc815cceb9f520bdfcf0a93bd734e0810b7f09d7974 |
Hashes for shioaji-1.2.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b44476ce56ee4ea76004856a3ba578d44d941e5603e08c7e08a5b2ad0b46a371 |
|
MD5 | e96d075a490a5030f5d76f200f72a160 |
|
BLAKE2b-256 | 998738672c90c94c130a6150b701e0ff084e31b61fb22bb04a7733cee48cfc9d |
Hashes for shioaji-1.2.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28c849b781b7c73213fcc169dcfa23bff1c44cc0cb9953b465a8a76b545edaf4 |
|
MD5 | 65621854176dd0ac38f33b4e01e6d78f |
|
BLAKE2b-256 | 80dc65ad95962f251b612a0392c3e6a6f0abaadc533cf28c897de9c72a6f9c38 |
Hashes for shioaji-1.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad6b07900d9204161d59bfb51a397794cf8300012f0d8f1914a25918f520f50 |
|
MD5 | 5663628264d370abd028411950315341 |
|
BLAKE2b-256 | cbd291702f5ef8084c30505acd6ea7b8c77c01b7ca93ef00ffd1fba35fecf9b0 |
Hashes for shioaji-1.2.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c825afd61974941d4d9b8e0aaee2e9455bc8b608573e36a125f39873af2b2ea4 |
|
MD5 | 35167f41e9955780a417d3f6c2c4a04c |
|
BLAKE2b-256 | 45a6d4d052bd62eb28e507e4a0b12ea0da53849c49c6d27bbba5e66d5f85d3b1 |
Hashes for shioaji-1.2.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f09e81eccb9f96aa2062e1fc45b03f1b16c909ca0c0efe88ae2451ccc198a9ff |
|
MD5 | 6a285c9bb7d4182475a24f913ee66aad |
|
BLAKE2b-256 | 1b4beb858806d305676ea9cd54b04be051d9a7ecec3262c53f05d72682906a4f |
Hashes for shioaji-1.2.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e45a41660c1c444f6ece5c3fd96d2d28187002b78cbbc6a0818bfe3ba69c68 |
|
MD5 | c056df28cb9f1be9283f24ba00d4bd71 |
|
BLAKE2b-256 | f07b0c18b5f24d4342896d4a0a315779c34e2c70af6863ed7c5e27640145e221 |
Hashes for shioaji-1.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dbcb54dc28f44893396df45695cc246c0c33ebbb18282bd7d4518110d26a248 |
|
MD5 | 72f7db282422070a01c57472049ae137 |
|
BLAKE2b-256 | 6f34214d0dd0502cc22d36138822ae53c1867d3073a4071fd99928cc21e2c8c0 |
Hashes for shioaji-1.2.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6d2e9c223a2580acbb88eda5abc7708bce6fa6334f09f5bd03065cdb08de5ec |
|
MD5 | 973dc3f774af18540a97dd14e238c0c6 |
|
BLAKE2b-256 | 1ebc146028ce78a6dab4ad6c493583ef7acb25f47a7e59952b9df1a73af8b17b |
Hashes for shioaji-1.2.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef10bbac8e4d6043a64feddc4b15949bf56f10d09570b0e5ac6bf372ddc671d6 |
|
MD5 | 1a30b381610f3efa9c350c002c0d2c89 |
|
BLAKE2b-256 | 490aa9719f24873485c1a617c30f88e4d7f7b73de727b75a93134c07bee64be1 |
Hashes for shioaji-1.2.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e3376344476a0f7e0aed9d3a9d6920a332389a38a5702011e926455f0a6b73 |
|
MD5 | 76026edbc6bb878d88dcf9d01d082985 |
|
BLAKE2b-256 | 147c7d7de0809ace75d1df9142849be3bba527f32ede7439310698c5e13a52f9 |
Hashes for shioaji-1.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1dd25d064614777dac0ab92b5bb41310adc5f37c36e58ac7fbb8b0d363e0c8 |
|
MD5 | 744ba015c4395b238f747a3f9f582897 |
|
BLAKE2b-256 | 62a1baa09ba78b356200519ce1a32be2e5ca571069f96a2a127e2fa99f3a7f73 |
Hashes for shioaji-1.2.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abcbb11abc8988be3a82014cb19e5e1c07673a0041d84c5db545b21ed5724c49 |
|
MD5 | fa4464494c91599e995c63df241c3c0c |
|
BLAKE2b-256 | 73ab1aef1f29190d73b24e507701f00e120f4853458d9a743dc06d3a6863010b |
Hashes for shioaji-1.2.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c82ee5165ae6c0d206cb6939c43b0f1ac91003a3648002c118adabb363c39c4 |
|
MD5 | ce66e046e6947fd7923e23947e737c58 |
|
BLAKE2b-256 | 5cd2f09abf7126fbb07419554b6de48b6057b962fceb9c7dbd3476d2069fd476 |
Hashes for shioaji-1.2.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d76c460da66c1a42ea6ec16e00fd781aa31708c6c2db7bac2c8dc06783e7c03c |
|
MD5 | 2456f465f9d656d4b1be097de18f592d |
|
BLAKE2b-256 | 5268f1c3f2fcadbded4902124672cfd54b6e6e904c7625fb63a2c65ac126a53f |
Hashes for shioaji-1.2.5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c06ddef9a68a7add90d7e7d7eb8517fe6bf8a1dff3946982376bfc4235ac5cd1 |
|
MD5 | 597feef9954226a4f6e360611b42a21d |
|
BLAKE2b-256 | 6b3b438aa6c5f54727c39dbf6291fc71b59b9e57f7eb40eeafc300034a38f4e4 |