Skip to content

Dealing operations

Dealing requests are typed. The faithful layer exposes positions, working orders, confirmations, and repeat-dealing windows. The workflow layer composes mutations with confirmation reads.

with IG(config, trading_permit=TradingPermit()) as ig:
    result = ig.operations.positions.create(request)
    confirmation = ig.operations.confirmations.get(result.deal_reference)

The equivalent journey is ig.workflows.positions.open_and_confirm(request). After AmbiguousExecutionError, reconcile using the deal reference or account state before another mutation.

Python operation IG request Protocol version
ig.operations.confirmations.get() GET /confirms/{deal_reference} 1
ig.operations.positions.list() GET /positions 2
ig.operations.positions.get() GET /positions/{deal_id} 2
ig.operations.positions.create() POST /positions/otc 2
ig.operations.positions.amend() PUT /positions/otc/{deal_id} 2
ig.operations.positions.close() DELETE /positions/otc 1
ig.operations.repeat_dealing_window.get() GET /repeat-dealing-window 1
ig.operations.working_orders.list() GET /working-orders 2
ig.operations.working_orders.create() POST /working-orders/otc 2
ig.operations.working_orders.amend() PUT /working-orders/otc/{deal_id} 2
ig.operations.working_orders.delete() DELETE /working-orders/otc/{deal_id} 2