システムトレーディングに必要な計算や便利な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.7.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.7.tar.gz.
File metadata
- Download URL: kabu_json_lib-0.1.7.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 |
2af9a429e8e64bec58062d951db5510f8d3342e19e4994c15ac4e0c51a74ea78
|
|
| MD5 |
91eb36c1250b7244f5917241c73d8760
|
|
| BLAKE2b-256 |
5e3b30f5c00f32e4837cd697c199d0ba1541862ab7d05ff4d112b8af2a57467b
|
File details
Details for the file kabu_json_lib-0.1.7-py3-none-any.whl.
File metadata
- Download URL: kabu_json_lib-0.1.7-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 |
6cbbfb376adee8562c956751c145cc1f4be91a9a040d3b41551220261560a4dd
|
|
| MD5 |
871115e6b3f05fb8a3d37a6b3c02bbf7
|
|
| BLAKE2b-256 |
ce121c8d650e482d23e459ed0a2c14cbbd9e91801747522eb49703ef190caecb
|