Skip to content
Back to blog
mcpposition-sizingrisk-management

MCP Trading Calculator: Fee-Aware Position Sizing for AI Agents

Connect an AI agent to RiskReward’s free MCP calculator. Get fee-aware position size, net risk/reward, and verifiable results from explicit trade inputs.

Why Your 2R Trade Is Actually 1.6R After Fees

A trading calculation needs more than a confident answer

An agent can return a position size that looks precise while leaving its assumptions unclear. Did the risk amount include entry fees? Which exit fee applied to the stop? Was the result quantity, notional, or margin?

RiskReward’s free MCP server makes those inputs and conventions explicit. Connect a compatible agent, provide a linear trade’s prices and risk budget, and receive structured results with assumptions, formulas, and a link to inspect the calculation yourself.

It is a calculation service. It does not connect to an exchange account, place orders, retrieve a fee tier, or decide how much risk you should take.


What an MCP trading calculator does

Model Context Protocol gives an agent a standard way to discover and call tools that its host has connected. RiskReward exposes three: position sizing, net risk/reward, and historical trade-performance analysis.

For position sizing, the agent supplies account balance, your chosen risk percentage, entry, stop, and optional target and fees. Direction comes from the relationship between entry and stop. The result includes position quantity, entry notional, and the planned loss including the supplied fees.

A registry listing does not automatically install the server into every assistant. You or your agent’s developer must connect it. The MCP setup guide includes the hosted endpoint and configuration examples.


A worked fee-aware position example

Consider a hypothetical linear BTC/USDT position with a 10,000 USDT account, a user-chosen 1% risk budget, entry at 100,000, stop at 95,000, and target at 110,000. Assume an entry fee of 0.02%, stop fee of 0.05%, and target fee of 0.02%.

The risk budget is 100 USDT. Each BTC would lose 5,000 USDT from entry to stop before fees. Entry fees add 20 USDT per BTC, and stop-exit fees add 47.50 USDT per BTC. Fee-inclusive risk is therefore 5,067.50 USDT per BTC.

Position quantity = 100 ÷ 5,067.50 = approximately 0.0197335964 BTC.

Entry notional is approximately 1,973.36 USDT. The planned price loss and the supplied entry/stop fees together equal the 100 USDT budget. This is scenario math, not a guarantee that a stop will fill at the assumed price.

At the target, gross price reward is 10,000 USDT per BTC. Subtract 20 USDT entry fees and 22 USDT target fees. The net target profit for the calculated quantity is approximately 196.51 USDT, or 1.9651R against the original 100 USDT risk budget.

These figures use the fee assumptions stated above. They are not a claim about the current fee schedule of any venue. You can check the same convention in the position size calculator.


Give the agent the missing facts

A useful request is specific: “Size a linear BTC/USDT trade for a 10,000 USDT account at 1% risk. Entry 100,000, stop 95,000, target 110,000. Entry fee 0.02%, stop fee 0.05%, target fee 0.02%. Show the assumptions.”

If you have not supplied a risk preference or a stop price, the agent should ask for it. The service rejects missing required values instead of selecting a risk budget for you.

Fee percentages use percentage points. An input of 0.05 means 0.05%, not 5%. If fees are omitted, the service explicitly assumes zero and returns a warning. It does not silently look up or invent a venue rate.


Check the result, not just its headline

Read quantity and notional as different outputs. Keep the original risk budget visible when interpreting net R. Check the returned assumptions for excluded costs, including funding and slippage.

The response includes a calculation version and a reproduction link for inputs small enough to fit in a URL. Open that link to see the inputs and recompute the result locally in your browser. The link embeds those inputs, so share it only with people you want to see them.

Version 1.0.0 uses JavaScript double-precision arithmetic. The service does not round a quantity to an exchange lot size or a price to a tick size. Apply those venue constraints separately and verify the risk of the rounded quantity before using it elsewhere.


Historical performance uses a different input contract

The performance tool accepts closed trades with net P&L after costs and each trade’s original risk amount. It returns win rate, profit factor, net P&L expectancy, total R, and expectancy in R. Supplying starting equity also enables chronological closed-trade drawdown calculations.

Suppose one trade made 200 USD on 100 USD of initial risk and another lost 100 USD on 50 USD of risk. Those outcomes are +2R and -2R. Mean R is zero, even though total dollar P&L is positive. Dividing aggregate P&L by aggregate risk would answer a different question.

Breakeven trades stay in the win-rate denominator. Profit factor is undefined when there is no losing P&L, so the response returns null with an explanation. A missing or undefined value should not become a fabricated zero in an agent’s answer.


Use MCP or the JSON API

MCP clients connect to the hosted Streamable HTTP endpoint at RiskReward. Developers can also send JSON directly to the versioned position-size, risk-reward, and performance endpoints. Both interfaces use the same validated calculation core.

The API reference documents requests, units, error responses, limits, formulas, and the OpenAPI specification. No API key or RiskReward subscription is required for these public calculations.

The service computes supplied numbers without storing calculation inputs or results in a database. Operational logs record tool names, outcomes, and duration; hosting infrastructure may retain request metadata. Requests should contain calculation values, not credentials or personal identifiers.


Where the calculation stops

The current tools support linear quote-margined instruments and recorded trade samples. They do not model inverse contracts, liquidation, intratrade equity paths, deposits, withdrawals, exchange execution, or future performance.

Use the response to make the arithmetic and its assumptions inspectable. An agent’s fluent explanation does not extend the scope of the model. Start with one known example, compare the result with your own calculation, and then connect the free RiskReward MCP server to the workflow you want to evaluate.