Skip to main content

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, TradeStatus
    • TradeStatus is a str enum: 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: bool marks 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


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.12.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xtrading_models-0.12.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file xtrading_models-0.12.1.tar.gz.

File metadata

  • Download URL: xtrading_models-0.12.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for xtrading_models-0.12.1.tar.gz
Algorithm Hash digest
SHA256 26903346583ce444d24af604fe823c5eaa8d93fc38ae1e489868cf26d47c5c3e
MD5 4a94ead637d27f6802823c31f18342ac
BLAKE2b-256 f4cd5f56d2c6a41b5a6a94dec9c490f90f54fb207f3e9c19ff6f0e75726f5e57

See more details on using hashes here.

File details

Details for the file xtrading_models-0.12.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xtrading_models-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed4c0b23535a51c0577cd39a3736dff5f18492f047596cae7b6bef1e9814097d
MD5 4feeb95a1206201825dc2d8cf6552d96
BLAKE2b-256 24ed3e6bdae871b839e48b0a6fb95af4338963716db72ca2a42fefe24e371cdc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page