

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).
OANDA Account Number *
Your OANDA account number for the selected environment.
Environment *
Choose whether to connect to the practice or live environment.
Manage credentials in your dashboard.
Actions(13)
get_price2cr2 paramsGet current bid/ask pricing for one or more currency pairs. Returns bid, ask, spread, timestamp, and tradeability status.
get_price2cr2 paramsGet current bid/ask pricing for one or more currency pairs. Returns bid, ask, spread, timestamp, and tradeability status.
instrumentstringSingle trading instrument/currency pair in OANDA format (e.g., 'EUR_USD', 'GBP_JPY'). Provide instrument or instruments.
instrumentsarrayList 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_candles2cr3 params(2 required)Get historical candlestick (OHLCV) data for a single instrument across 21 granularities from 5-second to monthly bars.
instrumentrequiredstringCurrency pair in OANDA format (e.g., 'EUR_USD').
granularityrequiredstringCandle 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
countintegerNumber of candles to retrieve (default: 100, max: 5000).
Default:
100Range: 1 - 5000
get_account_summary2cr0 paramsGet account overview including balance, margin, NAV, unrealized/realized P&L, and open trade/position/order counts. Credentials provided automatically.
get_account_summary2cr0 paramsGet 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 paramsGet all currently open positions with instrument, long/short units, average prices, and unrealized/realized P&L.
get_positions2cr0 paramsGet all currently open positions with instrument, long/short units, average prices, and unrealized/realized P&L.
No parameters for this action.
get_trades2cr0 paramsGet all currently open trades with trade ID, instrument, units, entry price, unrealized/realized P&L, margin used, and attached order IDs.
get_trades2cr0 paramsGet 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 paramsGet all pending (unfilled) orders with order ID, type, instrument, units, price, time-in-force, and attached conditions.
get_pending_orders2cr0 paramsGet 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.
place_market_order2cr5 params(2 required)Execute a trade immediately at the current market price. Positive units = buy/long, negative units = sell/short.
instrumentrequiredstringCurrency pair (e.g., 'EUR_USD').
unitsrequiredintegerNumber of units to trade. Positive = buy/long, negative = sell/short. Example: 10000 to buy, -5000 to sell.
take_profit_pricenumberTake profit price level. Automatically creates a take profit order on fill.
stop_loss_pricenumberStop loss price level. Cannot be used with stop_loss_distance.
stop_loss_distancenumberStop 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_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).
instrumentrequiredstringCurrency pair (e.g., 'EUR_USD').
unitsrequiredintegerNumber of units. Positive = buy, negative = sell.
pricerequirednumberThe limit price at which to execute.
take_profit_pricenumberTake profit price to attach on fill.
stop_loss_pricenumberStop loss price to attach on fill. Cannot be used with stop_loss_distance.
stop_loss_distancenumberStop 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_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).
instrumentrequiredstringCurrency pair (e.g., 'USD_JPY').
unitsrequiredintegerNumber of units. Positive = buy, negative = sell.
pricerequirednumberThe trigger price for the stop order.
take_profit_pricenumberTake profit price to attach on fill.
stop_loss_pricenumberStop loss price to attach on fill. Cannot be used with stop_loss_distance.
stop_loss_distancenumberStop 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_order2cr5 params(1 required)Modify a pending order's price, units, or trailing stop distance. Automatically detects order type and applies appropriate modification.
order_idrequiredstringThe order ID to modify (get from get_pending_orders).
pricenumberNew price level for limit/stop/take-profit/stop-loss orders.
unitsintegerNew unit amount for limit/stop orders.
trailing_stop_distancenumberNew trailing distance for trailing stop loss orders.
stop_loss_distancenumberNew 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_order2cr1 param(1 required)Cancel a pending (unfilled) order by its ID.
order_idrequiredstringThe 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_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.
instrumentrequiredstringCurrency 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_trade2cr1 param(1 required)Close a specific individual trade by its ID. Returns closing price, units closed, and realized P&L.
trade_idrequiredstringThe trade ID to close (get from get_trades).
Frequently Asked Questions
How do I connect this tool to an external agent?
You can install the local MCP server by opening a terminal and running:
Install commands
npm install -g @agentpmt/mcp-router
agentpmt-setupThis will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.
Alternatively you can connect to the hosted version with this config block, no installation required:
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\"}"
}
}
}
}View MCP Connection Instructions for more details.
How does an external agent use this tool?
After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:
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.
The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.





