| fetch_account_infoA | Retrieve account metadata such as the account currency and unique identifier.
Use this as a starting point to determine the account's base currency before
interpreting monetary values from other tools. Safe to call frequently.
Returns:
Account with id (int) and currencyCode (e.g., 'EUR', 'GBP', 'USD')
|
| fetch_account_cashA | Get a detailed breakdown of the account balance including available cash,
invested capital, profit/loss, blocked funds, and pie cash.
Use this to check buying power before placing orders, or to understand
the overall account health. See also: fetch_portfolio_summary for a
richer overview that includes individual positions.
Returns:
Cash with free, invested, total, ppl (profit/loss), result, blocked, pieCash
|
| fetch_all_open_positionsA | Retrieve every open position in the portfolio with live prices, quantities,
cost basis, and unrealised gains.
Use this to get a complete view of current holdings. Each position includes
the ticker, quantity, averagePrice, currentPrice, and ppl (profit/loss).
Positions held inside pies show a non-zero pieQuantity field.
See also: search_specific_position_by_ticker for a single position lookup,
or fetch_portfolio_summary for an aggregated portfolio view.
Returns:
List of Position objects, one per held instrument
|
| search_specific_position_by_tickerA | Look up a single open position by its exact ticker symbol.
Use this when you need details on one specific holding without fetching the
entire portfolio. Returns the same Position data as fetch_all_open_positions
but for a single instrument.
Args:
ticker: The exact Trading 212 ticker symbol (e.g., 'AAPL_US_EQ', 'IGLDd_EQ').
Use search_instrument to find the correct ticker if unsure.
Returns:
Position with ticker, quantity, averagePrice, currentPrice, ppl, and more
|
| fetch_all_ordersA | List all active pending orders (limit, stop, stop-limit) waiting to be filled.
Use this to review open orders before placing new ones or to check if a
previously placed order is still active. Does not include filled or
cancelled orders - use fetch_historical_order_data for those.
Returns:
List of Order objects with id, ticker, type, status, quantity, limitPrice, stopPrice
|
| fetch_orderA | Retrieve a single pending order by its ID to check its current status,
fill progress, and price parameters.
Use this after placing an order to monitor its status, or before cancelling
to confirm the order is still active. See also: fetch_all_orders to list
all pending orders at once.
Args:
order_id: Numeric order ID returned when the order was placed (e.g., 12345678)
Returns:
Order with id, ticker, type, status, quantity, filledQuantity, limitPrice, stopPrice
|
| place_market_orderA | Execute a market order at the current price. This creates a real trade that
affects your portfolio immediately. The order fills at the best available
market price.
Use search_instrument first to find the correct ticker symbol. Check
fetch_account_cash to verify sufficient buying power before placing.
Args:
ticker: Instrument ticker to trade (e.g., 'AAPL_US_EQ', 'MSFT_US_EQ').
Use search_instrument to find valid tickers.
quantity: Number of shares. Positive to buy, negative to sell.
Fractional shares are supported (e.g., 0.5).
Returns:
Order: The newly created order with its initial status
|
| place_limit_orderA | Submit a limit order that executes only when the instrument reaches your
target price. The order stays open until filled, cancelled, or expired.
Use this instead of a market order when you want to control the execution
price. Check fetch_all_orders afterward to monitor fill status.
Args:
ticker: Instrument ticker (e.g., 'AAPL_US_EQ'). Use search_instrument to find valid tickers.
quantity: Number of shares. Positive to buy, negative to sell.
limit_price: Maximum price to pay (buy) or minimum to accept (sell).
For example, 150.00 means "buy at 150 or lower".
time_validity: How long the order stays active. DAY (expires end of trading day)
or GOOD_TILL_CANCEL (stays open until filled or manually cancelled). Defaults to DAY.
Returns:
Order: The newly created limit order with its pending status
|
| place_stop_orderA | Submit a stop order that triggers a market execution once the instrument
reaches the specified stop price. Commonly used as a stop-loss to limit
downside risk on an existing position.
When the stop price is hit, the order becomes a market order and fills at
the best available price (which may differ from the stop price in fast markets).
For more control over the fill price, use place_stop_limit_order instead.
Args:
ticker: Instrument ticker (e.g., 'AAPL_US_EQ'). Use search_instrument to find valid tickers.
quantity: Number of shares. Positive to buy, negative to sell.
stop_price: Trigger price that activates the order (e.g., 140.00).
time_validity: DAY or GOOD_TILL_CANCEL. Defaults to DAY.
Returns:
Order: The newly created stop order
|
| place_stop_limit_orderA | Submit a combined stop-limit order: once the stop price is hit, a limit order
is placed at your specified limit price instead of executing at market.
This gives more control than a plain stop order by preventing execution at
an unfavourable price during fast market moves, but the order may not fill
if the price moves through the limit. See also: place_stop_order for a
simpler stop that guarantees execution.
Args:
ticker: Instrument ticker (e.g., 'AAPL_US_EQ'). Use search_instrument to find valid tickers.
quantity: Number of shares. Positive to buy, negative to sell.
stop_price: Trigger price that activates the limit order (e.g., 140.00).
limit_price: Price at which the resulting limit order is placed (e.g., 139.50).
Typically set slightly below the stop price for sells.
time_validity: DAY or GOOD_TILL_CANCEL. Defaults to DAY.
Returns:
Order: The newly created stop-limit order
|
| cancel_orderA | Cancel a pending order and remove it from the order book. This is irreversible -
once cancelled, the order cannot be reinstated and must be placed again.
Use fetch_all_orders or fetch_order first to confirm the order is still
active before attempting to cancel.
Args:
order_id: Numeric ID of the pending order to cancel (e.g., 12345678).
Get this from fetch_all_orders or from the response when the order was placed.
|
| fetch_piesA | List all investment pies with their cash balances, dividend details,
goal progress, and overall investment performance.
Use this to get an overview of all pies before drilling into a specific one
with fetch_a_pie. Each pie includes its numeric ID needed for other pie operations.
Returns:
List of PieSummary objects with id, status, cash, progress, result, dividendDetails
|
| fetch_a_pieA | Get full details for a single pie including every instrument allocation,
current vs target weights, per-instrument P/L, and pie settings.
Use fetch_pies first to get the list of pie IDs, then call this for
detailed breakdown of a specific pie.
Args:
pie_id: Numeric ID of the pie (e.g., 6894572). Get this from fetch_pies.
Returns:
PieDetails with settings (name, goal, endDate, dividendCashAction) and
instruments (ticker, expectedShare, currentShare, ownedQuantity, result)
|
| create_pieA | Create a new investment pie with the given instruments and target weights.
This creates a real pie in your account - instruments will be purchased
when you fund the pie.
Use search_instrument to find valid ticker symbols before creating. Weights
must sum to 1.0 (100%). See also: duplicate_pie to clone an existing pie.
Args:
name: Display name for the pie (e.g., 'Tech Growth')
instrument_shares: Mapping of ticker to target weight, must sum to 1.0.
Example: {'AAPL_US_EQ': 0.5, 'MSFT_US_EQ': 0.3, 'NVDA_US_EQ': 0.2}
dividend_cash_action: REINVEST (buy more shares) or TO_ACCOUNT_CASH (withdraw to cash).
Defaults to REINVEST if not specified.
end_date: Optional target date in ISO 8601 (e.g., '2029-12-31T23:59:59Z')
goal: Optional target value in account currency (e.g., 20000.0)
icon: Optional pie icon identifier (e.g., 'Coins', 'Education')
Returns:
PieDetails: Full details of the newly created pie
|
| update_pieA | Modify an existing pie's settings, instrument allocations, or target weights.
Only provided fields are updated - omitted fields remain unchanged.
Use fetch_a_pie first to see the current configuration before making changes.
The API requires providing a name even if you are not changing it.
Args:
pie_id: Numeric ID of the pie to modify (e.g., 6894572). Get this from fetch_pies.
name: Updated name for the pie. Required by the API even if unchanged.
instrument_shares: New ticker-to-weight mapping, must sum to 1.0.
Example: {'AAPL_US_EQ': 0.5, 'MSFT_US_EQ': 0.5}
dividend_cash_action: REINVEST or TO_ACCOUNT_CASH
end_date: Revised end date in ISO 8601 (e.g., '2029-12-31T23:59:59Z')
goal: Revised target value in account currency (e.g., 25000.0)
icon: Updated icon identifier
Returns:
PieDetails: The pie after applying your changes
|
| duplicate_pieA | Clone an existing pie into a new one with identical instrument allocations
and settings. The new pie starts with zero invested value.
Use this to create a variation of an existing pie without rebuilding it
from scratch. See also: create_pie for building a pie from scratch.
Args:
pie_id: ID of the source pie to copy (e.g., 6894572). Get this from fetch_pies.
name: Optional custom name for the clone. Defaults to the original name with a suffix.
icon: Optional icon for the clone.
Returns:
PieDetails: Full details of the newly cloned pie
|
| delete_pieA | Permanently delete a pie. This is irreversible. Instruments inside the pie
become standalone positions in your portfolio - they are not sold.
Use fetch_a_pie first to review the pie contents before deleting. Consider
whether you want to sell the positions separately after deletion.
Args:
pie_id: Numeric ID of the pie to delete (e.g., 6894572). Get this from fetch_pies.
|
| search_instrumentA | Search for tradeable instruments by ticker symbol or company name.
Returns matching instruments with their ticker, ISIN, currency, and type.
Use this before placing orders or creating pies to find the correct Trading 212
ticker format (e.g., 'AAPL_US_EQ' for Apple). Omit the search term to retrieve
the full instrument catalogue.
The search is case-insensitive and matches partial strings against both
ticker symbols and instrument names.
Args:
search_term: Text to match against tickers and names (e.g., 'Apple', 'AAPL',
'silver ETC'). Omit to return every available instrument.
Returns:
List of Instrument objects with ticker, name, type (STOCK/ETF), currencyCode,
isin, shortName, and maxOpenQuantity
|
| search_exchangeA | Search for stock exchanges by name or numeric ID. Returns exchange details
including trading hours and working schedules.
Use this to check when a specific exchange is open for trading, or to
look up exchange information by its numeric ID from an instrument's
workingScheduleId field.
Args:
search_term: Case-insensitive text to match against exchange names
(e.g., 'NASDAQ', 'London'), or an exact numeric exchange ID
(e.g., '71'). Omit to return all exchanges.
Returns:
List of Exchange objects with id, name, and workingSchedules
|
| fetch_historical_order_dataA | Retrieve past orders (filled, cancelled, rejected) with execution details,
fill prices, and timestamps. Supports pagination and ticker filtering.
Use this to review trade history or to analyze past execution quality.
For currently active orders, use fetch_all_orders instead.
Args:
cursor: Pagination cursor from a previous response. Omit for the first page.
ticker: Filter results to a specific instrument (e.g., 'AAPL_US_EQ'). Omit for all.
limit: Number of orders per page, 1-50. Defaults to 20.
Returns:
List of HistoricalOrder with ticker, type, status, filledQuantity, fillPrice,
dateCreated, dateExecuted, and more
|
| fetch_paid_out_dividendsA | Retrieve dividend payments received, including per-share amounts, payment dates,
and total payouts. Supports pagination and ticker filtering.
Use this to track income from dividend-paying stocks. For a summarized view
grouped by ticker and month, use fetch_dividend_summary instead.
Args:
cursor: Pagination cursor from a previous response. Omit for the first page.
ticker: Filter to a specific instrument (e.g., 'AAPL_US_EQ'). Omit for all.
limit: Number of records per page, 1-50. Defaults to 20.
Returns:
PaginatedDividends with items (ticker, amount, paidOn, quantity) and nextPagePath
|
| fetch_exports_listA | List all previously generated CSV account exports with their status and
download links.
Use this to check if an export requested via request_csv_export is ready
for download. Completed reports include a downloadLink field.
Returns:
List of Report objects with reportId, status, and downloadLink (when complete)
|
| request_csv_exportA | Queue a CSV export of your account history. The export runs asynchronously -
check fetch_exports_list to monitor progress and get the download link.
This creates a server-side export job. Each call generates a new report.
Use the time range parameters to limit the export to a specific period.
Args:
include_dividends: Include dividend payment records. Defaults to True.
include_interest: Include interest payment records. Defaults to True.
include_orders: Include trade/order history. Defaults to True.
include_transactions: Include deposit/withdrawal records. Defaults to True.
time_from: Start of the reporting window in ISO 8601 (e.g., '2024-01-01T00:00:00Z').
Omit for all history.
time_to: End of the reporting window in ISO 8601 (e.g., '2024-12-31T23:59:59Z').
Omit for up to now.
Returns:
EnqueuedReport with the reportId for tracking via fetch_exports_list
|
| fetch_transaction_listA | Retrieve account cash movements such as deposits, withdrawals, fees,
interest payments, and internal transfers. Supports cursor-based pagination.
Use this to audit account cash flow or to reconcile deposits/withdrawals.
For a combined view of orders and transactions together, use fetch_recent_activity.
Args:
cursor: Pagination cursor from a previous response. Omit for the first page.
time: Filter transactions from this ISO 8601 timestamp onward
(e.g., '2024-06-01T00:00:00Z'). Omit for all.
limit: Number of records per page, 1-50. Defaults to 20.
Returns:
PaginatedTransactions with items (type, dateTime, amount, reference) and nextPagePath
|
| fetch_portfolio_summaryA | Produce a complete portfolio snapshot in one call by combining account info,
cash balance, and all open positions into a single aggregated response.
This is the recommended starting point for portfolio analysis. It calculates
total value, P/L percentages, and ranks holdings by current value. For
per-position performance with dividends, use fetch_portfolio_performance instead.
Returns:
dict with currency, total_value, cash_available, invested, profit_loss,
profit_loss_pct, position_count, positions (sorted by value descending),
and top_holdings (top 5)
|
| fetch_portfolio_performanceA | Build a detailed performance report across all positions by combining
current holdings, recent order history, and dividend payouts.
Calculates per-position total returns (price P/L + dividends) and identifies
best and worst performers. Use this for deeper analysis than fetch_portfolio_summary
provides, especially when dividend income matters.
Returns:
dict with currency, total_price_ppl, total_dividends, total_return,
best_performer, worst_performer, positions (each with invested, current_value,
price_ppl, dividends, total_return, return_pct, held_since), recent_filled_orders
|
| fetch_dividend_summaryA | Analyse dividend income history by collecting up to 200 dividend records
and breaking them down by ticker and by calendar month.
Use this to identify which holdings generate the most income and to spot
monthly income trends. For raw dividend records with pagination control,
use fetch_paid_out_dividends instead.
Returns:
dict with currency, total_dividends, dividend_count, average_monthly,
by_ticker (sorted highest-paying first), by_month (chronological)
|
| fetch_recent_activityA | Get a unified timeline of recent trades and account movements by merging
order history with deposit/withdrawal transactions into a single
chronologically sorted feed.
Use this for a quick "what happened recently" overview. Each entry is tagged
as either 'order' (trade) or 'transaction' (cash movement). For separate
access, use fetch_historical_order_data or fetch_transaction_list.
Args:
limit: How many items to pull from each source (orders and transactions
separately), 1-50. Defaults to 20. Total activity items may be up to 2x this.
Returns:
dict with currency, activity (sorted newest-first, each tagged as 'order' or
'transaction'), order_count, transaction_count
|