Shared trading models for XTrading ecosystem
Project description
xtrading-models
Shared trading models for the XTrading ecosystem.
Installation
pip install xtrading-models
Usage
from datetime import datetime
from xtrading_models import MarketOrder, LimitOrder, BarData
# Create a market order
order = MarketOrder(action='BUY', totalQuantity=100)
# Create bar data
bar = BarData(
date=datetime.now(),
open=100.00,
high=105.00,
low=99.00,
close=104.00,
volume=1000000
)
Models
- Order classes:
Order,LimitOrder,MarketOrder,MarketOnCloseOrder,StopOrder,StopLimitOrder,TrailingStopMarket,TrailingStopLimit - Trade lifecycle:
Trade,OrderStatus,TradeLogEntry,TradeStatusTradeStatusis astrenum:PendingSubmit,PreSubmitted,Submitted,Filled,Cancelled,Inactive- Inherits from
str— compares equal to plain string literals for backward compatibility
- Bar data:
BarData- OHLCV candlestick representation;is_close_bar: boolmarks the last bar of a trading session (used by MOC order execution) - Execution:
Execution,CommissionReport,Fill - Sentinels:
UNSET_DOUBLE,UNSET_INTEGER
License
MIT
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
xtrading_models-0.11.1.tar.gz
(10.8 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 xtrading_models-0.11.1.tar.gz.
File metadata
- Download URL: xtrading_models-0.11.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
734293edd51086d9b8e5b579bec31362fcb2366ad8b3050af1e1d545ca4f9d29
|
|
| MD5 |
6f02261c746134700d57e42433b732e1
|
|
| BLAKE2b-256 |
8e7fae71cd88ecf94005526f777ee3370cc70e106b46a5cddbe1387e503c722c
|
File details
Details for the file xtrading_models-0.11.1-py3-none-any.whl.
File metadata
- Download URL: xtrading_models-0.11.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2a363fd49dcaa284be0f012e95e0e0d1cf7a7eb54de4dd1b3a8c32dd9949841
|
|
| MD5 |
df6f7237a2aad3a86de9a8294752b3b0
|
|
| BLAKE2b-256 |
207aa328661d21fcbc37793c63128c61eddd2784112ac6a3ef88f03ac9d510a2
|