AgentPMT
Oanda Forex Trading

Oanda Forex Trading

Connector

Available ActionsEach successful request consumes credits as outlined below.

get_price2crget_candles2crget_account_summary2crget_positions2crget_trades2crget_pending_orders2crplace_market_order2crplace_limit_order2crplace_stop_order2crmodify_order2crcancel_order2crclose_position2crclose_trade2cr

Details

OANDA Forex is a comprehensive foreign exchange trading interface that connects AI agents and automation workflows to OANDA's REST v20 API for real-time currency trading and market data access. It provides a simplified action-based abstraction over OANDA's trading platform, supporting both practice accounts for paper trading and live accounts for real money transactions. Market data capabilities include fetching real-time bid and ask prices with spread calculations for single or multiple currency pairs, as well as historical candlestick data across 21 granularities ranging from 5-second intervals to monthly bars with up to 5000 candles per request. Account management functions retrieve balance, margin, net asset value, unrealized and realized profit and loss, open trade counts, and pending order status. The trading engine supports market orders for immediate execution, limit orders for price-targeted entries, and stop orders for breakout or momentum strategies, all with optional take profit and stop loss levels attached at order creation. Position and order management includes viewing open positions and trades, modifying pending order parameters, canceling unfilled orders, and closing positions either by instrument or by individual trade ID. It is highly recommended that you perform extensive testing with demo accounts before placing any live orders.

Use Cases

Forex trading automation, currency trading bot, FX trading API, OANDA API integration, foreign exchange automation, algorithmic forex trading, automated currency trading, forex market data, real-time forex prices, currency pair quotes, bid ask spread, EUR USD trading, GBP JPY trading, forex candlestick data, OHLC data retrieval, historical forex data, forex price history, candlestick charting data, forex account management, trading account balance, margin monitoring, unrealized PnL tracking, open position monitoring, trade management, pending order management, market order execution, limit order placement, stop order trading, take profit automation, stop loss automation, forex risk management, close forex position, close trade by ID, cancel pending order, modify order price, paper trading forex, practice account trading, live forex trading, forex backtesting data, currency pair analysis, forex spread monitoring, multi-currency pricing, forex portfolio tracking, margin available check, forex transaction history, AI forex trading, LLM trading integration, automated FX strategy, forex webhook automation, currency arbitrage data

Credentials

OANDA API Key *
Create a key in your OANDA account settings (choose the one that matches your selected environment).
api key
OANDA Account Number *
Your OANDA account number for the selected environment.
text
Environment *
Choose whether to connect to the practice or live environment.
select

Manage credentials in your dashboard.

Actions(13)

get_price2cr2 params

Get current bid/ask pricing for one or more currency pairs. Returns bid, ask, spread, timestamp, and tradeability status.

Get current bid/ask pricing for one or more currency pairs. Returns bid, ask, spread, timestamp, and tradeability status.

instrumentstring

Single trading instrument/currency pair in OANDA format (e.g., 'EUR_USD', 'GBP_JPY'). Provide instrument or instruments.

instrumentsarray

List of trading instruments for batch pricing (e.g., ['EUR_USD', 'GBP_USD', 'USD_JPY']). Provide instrument or instruments.

Array of: string
get_candles2cr3 params(2 required)

Get historical candlestick (OHLCV) data for a single instrument across 21 granularities from 5-second to monthly bars.

Get historical candlestick (OHLCV) data for a single instrument across 21 granularities from 5-second to monthly bars.

instrumentrequiredstring

Currency pair in OANDA format (e.g., 'EUR_USD').

granularityrequiredstring

Candle time granularity. Seconds: S5, S10, S15, S30. Minutes: M1, M2, M4, M5, M10, M15, M30. Hours: H1, H2, H3, H4, H6, H8, H12. Other: D (daily), W (weekly), M (monthly).

Values:
S5S10S15S30M1M2M4M5M10M15M30H1H2H3H4H6H8H12DWM
countinteger

Number of candles to retrieve (default: 100, max: 5000).

Default: 100
Range: 1 - 5000
get_account_summary2cr0 params

Get account overview including balance, margin, NAV, unrealized/realized P&L, and open trade/position/order counts. Credentials provided automatically.

Get account overview including balance, margin, NAV, unrealized/realized P&L, and open trade/position/order counts. Credentials provided automatically.

No parameters for this action.

get_positions2cr0 params

Get all currently open positions with instrument, long/short units, average prices, and unrealized/realized P&L.

Get all currently open positions with instrument, long/short units, average prices, and unrealized/realized P&L.

No parameters for this action.

get_trades2cr0 params

Get all currently open trades with trade ID, instrument, units, entry price, unrealized/realized P&L, margin used, and attached order IDs.

Get all currently open trades with trade ID, instrument, units, entry price, unrealized/realized P&L, margin used, and attached order IDs.

No parameters for this action.

get_pending_orders2cr0 params

Get all pending (unfilled) orders with order ID, type, instrument, units, price, time-in-force, and attached conditions.

Get all pending (unfilled) orders with order ID, type, instrument, units, price, time-in-force, and attached conditions.

No parameters for this action.

place_market_order2cr5 params(2 required)

Execute a trade immediately at the current market price. Positive units = buy/long, negative units = sell/short.

Execute a trade immediately at the current market price. Positive units = buy/long, negative units = sell/short.

instrumentrequiredstring

Currency pair (e.g., 'EUR_USD').

unitsrequiredinteger

Number of units to trade. Positive = buy/long, negative = sell/short. Example: 10000 to buy, -5000 to sell.

take_profit_pricenumber

Take profit price level. Automatically creates a take profit order on fill.

stop_loss_pricenumber

Stop loss price level. Cannot be used with stop_loss_distance.

stop_loss_distancenumber

Stop loss as price distance instead of absolute price. Cannot be used with stop_loss_price.

place_limit_order2cr6 params(3 required)

Place an order to execute when price reaches a specified level or better. Remains active until filled or cancelled (GTC).

Place an order to execute when price reaches a specified level or better. Remains active until filled or cancelled (GTC).

instrumentrequiredstring

Currency pair (e.g., 'EUR_USD').

unitsrequiredinteger

Number of units. Positive = buy, negative = sell.

pricerequirednumber

The limit price at which to execute.

take_profit_pricenumber

Take profit price to attach on fill.

stop_loss_pricenumber

Stop loss price to attach on fill. Cannot be used with stop_loss_distance.

stop_loss_distancenumber

Stop loss distance to attach on fill. Cannot be used with stop_loss_price.

place_stop_order2cr6 params(3 required)

Place an order that triggers when price reaches a specified level. Useful for breakout strategies. Remains active until triggered or cancelled (GTC).

Place an order that triggers when price reaches a specified level. Useful for breakout strategies. Remains active until triggered or cancelled (GTC).

instrumentrequiredstring

Currency pair (e.g., 'USD_JPY').

unitsrequiredinteger

Number of units. Positive = buy, negative = sell.

pricerequirednumber

The trigger price for the stop order.

take_profit_pricenumber

Take profit price to attach on fill.

stop_loss_pricenumber

Stop loss price to attach on fill. Cannot be used with stop_loss_distance.

stop_loss_distancenumber

Stop loss distance to attach on fill. Cannot be used with stop_loss_price.

modify_order2cr5 params(1 required)

Modify a pending order's price, units, or trailing stop distance. Automatically detects order type and applies appropriate modification.

Modify a pending order's price, units, or trailing stop distance. Automatically detects order type and applies appropriate modification.

order_idrequiredstring

The order ID to modify (get from get_pending_orders).

pricenumber

New price level for limit/stop/take-profit/stop-loss orders.

unitsinteger

New unit amount for limit/stop orders.

trailing_stop_distancenumber

New trailing distance for trailing stop loss orders.

stop_loss_distancenumber

New stop loss distance for stop loss orders. Cannot be used with price for stop loss modifications.

cancel_order2cr1 param(1 required)

Cancel a pending (unfilled) order by its ID.

Cancel a pending (unfilled) order by its ID.

order_idrequiredstring

The order ID to cancel (get from get_pending_orders).

close_position2cr1 param(1 required)

Close the entire position (both long and short sides) for a specific instrument. Returns details of closed sides and total P&L.

Close the entire position (both long and short sides) for a specific instrument. Returns details of closed sides and total P&L.

instrumentrequiredstring

Currency pair to close (e.g., 'EUR_USD').

close_trade2cr1 param(1 required)

Close a specific individual trade by its ID. Returns closing price, units closed, and realized P&L.

Close a specific individual trade by its ID. Returns closing price, units closed, and realized P&L.

trade_idrequiredstring

The trade ID to close (get from get_trades).

Frequently Asked Questions

How do I connect this tool to an external agent?

Install commands

npm install -g @agentpmt/mcp-router
agentpmt-setup

Hosted MCP config

{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}

How does an external agent use this tool?

Agent prompt

Call the AgentPMT-Tool-Search-and-Execution tool with action 'get_schema' and tool_id 695bcfa7fd8fabfb3ce3dd6a ("Oanda Forex Trading"). Then call the same tool with action 'call_tool', tool_id 695bcfa7fd8fabfb3ce3dd6a, and the parameters needed for my request.

Looking for help integrating AI into your business? Set up a free consultation.

Oanda Forex Trading by Apoth3osis | AgentPMT