Skip to content

trading_agent.trading.order_arguments

The arguments a model gives to place an order: the instrument, the order itself and the reason for it.

The price fields are checked against the order type here, as UBI would check them, so a model learns of a missing price at once and in plain words.

Typical usage example:

arguments = OrderArguments(exchange='nse', segment='equities', symbol='INFY', transaction_type='buy', quantity=10, product='mis', order_type='limit', price=1500.0, reason='Breakout above the previous high')

OrderArguments

Bases: InstrumentArguments

One order in one instrument.

Attributes:

Name Type Description
transaction_type Literal['buy', 'sell']

"buy" or "sell".

quantity int

How many units, which is lots times lot size for futures and options.

product Literal['cnc', 'mis', 'nrml']

"cnc" for delivery, "mis" for intraday, "nrml" for carried futures and options.

order_type Literal['market', 'limit', 'sl', 'sl-m']

"market", "limit", "sl" (stop-limit) or "sl-m" (stop-market).

price float | None

The limit price in rupees, needed for limit and sl orders and not allowed otherwise.

trigger_price float | None

The trigger price in rupees, needed for sl and sl-m orders and not allowed otherwise.

validity Literal['day', 'ioc'] | None

"day" or "ioc", or None for day.

reason str

Why the desk is placing the order, kept in the journal.