システムトレーディングに必要な計算や便利なPythonライブラリをまとめたパッケージ
Project description
kabu-json-lib
システムトレーディングに必要な計算や便利なPythonライブラリをまとめたパッケージです。
バージョン
- 最新バージョン: 0.1.6
- リリース日: 2024-06-18
機能一覧
- bp関数: パーセント表記をベーシスポイント(bp)に変換します。
- fetch_now関数: 現在の日本時間をdatetimeオブジェクトで返します。
- order_to_one_line関数: 注文情報を1行の文字列にフォーマットします(valueはprice×quantityで自動計算されます)。
インストール方法
pip install kabu-json-lib
使い方
from kabu_json_lib import bp, fetch_now, order_to_one_line
print(bp(0.05)) # 500
print(bp(None)) # None
now = fetch_now()
print(now) # 2023-10-01 12:34:56+09:00
# 注文情報のフォーマット例
order = {
"long_or_short": "LONG",
"entry_or_exit": "ENTRY",
"symbol": "AAPL",
"price": 150.0,
"quantity": 100,
"value": 15000,
"order_type": "MARKET",
"datetime_obj": now
}
print(order_to_one_line(order)) # [LONG -ENTRY ] AAPL @ 150.0 * 100 (¥ 15000) [MARKET] 2024-03-21 12:34:56
リポジトリ
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 Distribution
kabu_json_lib-0.1.6.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kabu_json_lib-0.1.6.tar.gz.
File metadata
- Download URL: kabu_json_lib-0.1.6.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f98c8d57d7a4af0079c9464887c968c2c69f164ca54de95e7a71b5d90bb5d8f
|
|
| MD5 |
1b9801ac95eaa31fd007a65d769f3e4a
|
|
| BLAKE2b-256 |
ae388482453c9076ca1ff965fc173cf184691d3b852c4a0604c3db7e00e8246a
|
File details
Details for the file kabu_json_lib-0.1.6-py3-none-any.whl.
File metadata
- Download URL: kabu_json_lib-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0b5d0479708e5e88bcab5b95d2de74b8cbc8257ba661fc00ce8220651e3ee77
|
|
| MD5 |
d9f35907cad0cc2c0b9f1c8f03d6055c
|
|
| BLAKE2b-256 |
b6f26e9b108ce8637300536be619fe21a0d95735712e20d2ddb58efe8383b662
|