Skip to content

NewTradeOrderRequestDTO

stonepy.models.NewTradeOrderRequestDTO.NewTradeOrderRequestDTO

Bases: RequestModel

A request to trade and open a new position with a market order.

market_id class-attribute instance-attribute

market_id: int = Field(alias='MarketId')

The unique identifier for a market.

currency class-attribute instance-attribute

currency: str = Field(alias='Currency')

Currency to place order in.

auto_rollover class-attribute instance-attribute

auto_rollover: bool = Field(alias='AutoRollover')

Flag to indicate whether the trade will automatically roll into the next market interval when the current market interval expires. Only applies to markets where the underlying is a futures contract.

direction class-attribute instance-attribute

direction: str = Field(alias='Direction')

Direction identifier for order/trade, values supported are Buy or Sell .

quantity class-attribute instance-attribute

quantity: Decimal = Field(alias='Quantity')

Size of the order/trade.

quote_id class-attribute instance-attribute

quote_id: int = Field(alias='QuoteId')

The unique quote identifier.

position_method_id class-attribute instance-attribute

position_method_id: int = Field(alias='PositionMethodId')

Indicates the position of the trade. 1 == LongOrShortOnly, 2 == LongAndShort.

bid_price class-attribute instance-attribute

bid_price: Decimal = Field(alias='BidPrice')

The field is mandatory. Market prices are quoted as a pair (buy/sell or bid/offer) , the BidPrice is the lower value of the pair.

offer_price class-attribute instance-attribute

offer_price: Decimal = Field(alias='OfferPrice')

The field is mandatory. Market prices are quote as a pair (buy/sell or bid/offer) , the OfferPrice is the higher value of the pair.

audit_id class-attribute instance-attribute

audit_id: str = Field(alias='AuditId')

Unique identifier for each price tick. Read this value from the prices stream. This should be populated by the Row_Update_Version field in the Lightstreamer message. Treat it as a unique but random string.

trading_account_id class-attribute instance-attribute

trading_account_id: int = Field(alias='TradingAccountId')

The ID of the trading account associated with the trade/order request.

if_done class-attribute instance-attribute

if_done: list[ApiIfDoneDTOv2] | None = Field(
    default=None, alias="IfDone"
)

List of If/Done Orders that will be filled when the initial trade/order is triggered. (Optional) .

close class-attribute instance-attribute

close: list[int] = Field(alias='Close')

List of existing open trade order IDs that require part or full closure.

reference class-attribute instance-attribute

reference: str = Field(alias='Reference')

A reference code to identify the source origin of the trade order request. API calls should use the string: StoneX API .

allocation_profile_id class-attribute instance-attribute

allocation_profile_id: int = Field(
    alias="AllocationProfileId"
)

ID of the allocation profile to use if this is a Trading Advisor trade.

order_reference class-attribute instance-attribute

order_reference: str = Field(alias='OrderReference')

The order reference for this new trade request - only applicable where source is set. (Optional) .

source class-attribute instance-attribute

source: str = Field(alias='Source')

The source of the trade order request. (Optional) .

price_tolerance class-attribute instance-attribute

price_tolerance: int = Field(alias='PriceTolerance')

Sets the amount of slippage you are willing to accept to get the trade executed. Values are in the range 0 - 1000.