# Stock Profit/Loss Calculator MCP for AI Agents AI Agent Connect

> Stock Profit/Loss Calculator. This tool calculates ROI, tax liabilities, and risk metrics for stock trades and complex options strategies. It helps you see your actual profit after fees and determines your position sizes based on your risk tolerance.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_HAwMqRC5G8A9KVk7eepP7raRNgSJXfXzscNts3mK/ai-agent-connect
- **Tags:** stocks, options, roi, taxation, risk-management, trading-tools

## Description

This Connector handles the heavy lifting of financial math for your trading activities. Instead of pulling out a spreadsheet every time you close a position, you can ask your agent to break down the real numbers. It handles the nuances of short-term versus long-term tax liabilities and accounts for transaction costs that often get overlooked by manual tracking. If you're moving into options, it helps you see the boundaries of vertical spreads or multi-leg strategies before you put money on the line. It even helps you stay disciplined by calculating exactly how many shares you should buy based on your specific risk tolerance and portfolio size. You can quickly determine if a trade was actually profitable after all the fees, or if you're over-leveraging a specific position. It's one of the practical tools you'll find in the Vinkius catalog to keep your trading data organized and accurate, ensuring that every move you make is backed by solid math rather than a rough guess. By offloading these calculations to your agent, you spend less time on arithmetic and more time on actual strategy. It gives you a clear picture of your actual gains, allowing for better decision-making in a fast-moving market.

## Tools

### analyze_stock_trade
Calculate net profitability and tax liabilities for a completed transaction. It factors in entry prices, exit prices, and transaction costs.

### evaluate_options_strategy
Determine the maximum profit, loss, and break-even points for multi-leg options. This helps you see the boundaries of a strategy before you commit capital.

### plan_position_size
Calculate the exact number of units to purchase based on your total capital and stop-loss distance. This keeps your risk management consistent across all trades.

## Prompt Examples

**Prompt:** 
```
I bought 100 shares of AAPL at $150 on 2023-01-01 and sold them at $180 on 2024-02-01. Commissions were $5 per side and spread cost was $2. My short-term tax rate is 30% and long-term is 15%. What was my net profit?
```

**Response:** 
```
Your net profit after all fees and taxes is $2,873.00. Your ROI is 19.15% and your annualized return is approximately 14.6%.
```

**Prompt:** 
```
Evaluate a vertical spread: Buy 1 CALL at $100 strike for $5 premium, Sell 1 CALL at $110 strike for $2 premium. Current price is $105. Total commission is $1. What is my max profit and break-even?
```

**Response:** 
```
The maximum profit for this strategy is $7.00 (difference in strikes minus net premium and commissions). The break-even price is $103.00.
```

**Prompt:** 
```
I have a $50,000 portfolio. I want to risk only 2% of my total capital on a trade entering at $45 with a stop-loss at $42. How many shares should I buy?
```

**Response:** 
```
You should purchase 166 units. This results in a total position cost of $7,470 and a cash at risk of $498.
```

## Capabilities

### Calculate net profit after taxes
Get the final profit amount after accounting for all fees and tax obligations.

### Estimate options spread limits
Find the maximum profit, loss, and break-even points for complex options.

### Determine position sizes
Calculate how many units to buy based on your total capital and risk limits.

### Track ROI percentages
See your return on investment across different stock and options trades.

### Project break-even points
Identify the exact price points where a trade becomes profitable.

## Use Cases

### Checking a recent sale
A trader wants to know their net profit on a tech stock sale after taxes and fees.

### Planning a spread
An investor wants to see the max profit and break-even point for a new vertical call spread.

### Sizing a position
A portfolio manager needs to know how many shares to buy to risk exactly 1% of their capital.

### Year-end review
A user wants to summarize their total ROI across various stock trades for the last quarter.

## Benefits

- Get accurate tax liabilities by using `analyze_stock_trade` to see short-term vs long-term hits.
- Avoid overexposure by using `plan_position_size` to set hard limits on how many shares to buy.
- Visualize complex options by using `evaluate_options_strategy` to find break-even points.
- See your true ROI by accounting for commissions and spreads automatically.
- Stay disciplined with clear risk-to-reward ratios for every new position you consider.

## How It Works

The bottom line is you get clear, accurate math for your trades without doing any manual calculations.

1. Connect the Connector to your agent.
2. Provide the entry price, exit price, and transaction costs for your trade.
3. Get a breakdown of your net profit, tax liabilities, and ROI.

## Frequently Asked Questions

**Does the Stock Profit/Loss Calculator handle brokerage fees?**
Yes, it factors in commissions and spread costs to give you a net profit figure that reflects your actual gains.

**Can I use the Stock Profit/Loss Calculator for complex options?**
It is designed to handle multi-leg and vertical spread options to find your max profit and break-even points.

**How does the Stock Profit/Loss Calculator help with my taxes?**
It calculates your tax liabilities by identifying short-term versus long-term capital gains based on your holding period.

**Can the Stock Profit/Loss Calculator tell me how many shares to buy?**
It can calculate the exact number of units to purchase based on your total portfolio value and your desired risk percentage.

**Does the Stock Profit/Loss Calculator work for vertical spreads?**
Yes, it can evaluate the risk and reward for vertical spreads, helping you see the boundaries of the trade before you enter.

**Is the Stock Profit/Loss Calculator good for multi-leg strategies?**
It is specifically built to handle multi-leg options strategies to help you determine max profit and loss points.

**How does the tool calculate tax liabilities?**
The `analyze_stock_trade` tool compares your purchase and sale dates. If the holding period is less than one year, it applies the `shortTermTaxRate`; otherwise, it uses the `longTermTaxRate` you provided.

**Can I calculate complex options spreads?**
Yes, using `evaluate_options_strategy`, you can input a JSON array of multiple legs (calls or puts) to find the break-even price and risk/reward ratio for vertical spreads and other multi-leg strategies.

**How do I manage my portfolio risk?**
You can use `plan_position_size` to determine exactly how many units to buy. By providing your total portfolio value and a stop-loss price, the tool calculates the number of shares that keeps your potential loss within your specified risk percentage.