Trading cost calculator
calculate_trading_costRead-onlyIdempotent
The cost of one round trip (commissions, bid-ask spread, slippage) in USD, in R, as a share of the target move and of the position, and over a year of trades. Computed with the same function as Clear Tape's free trading cost calculator page (linked in the result), not estimated. Returns the inputs, each result with its unit, the formula and the page link. Educational, not investment advice.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language of the returned text: "en" (default) or "zh" (Simplified Chinese). | en |
| stop | Yes | Stop price per share in USD; not equal to the entry. | |
| entry | Yes | Entry price per share in USD. | |
| shares | Yes | Number of shares. | |
| spread | Yes | Bid-ask spread per share in USD (paid once per round trip, half on each side). | |
| target | No | Optional: target price per share in USD, on the other side of the entry from the stop. | |
| trades | No | Optional: round trips per year, for the annual cost. | |
| slippage | Yes | Slippage per share per side in USD. | |
| commission | Yes | Commission per order (each side) in USD; 0 if none. |