Agentic tradingRisk managementBeginnersAutomation

How to automate take profits and exit plans for your first trading agent

Learn how to automate take profits and exit plans with a trading agent, including step-by-step safety controls for first-time automation.

By the Felix team8 min read
Key takeaways
  • 01An exit plan must define the exact take profit, stop loss, and time limit before the agent enters any position.
  • 02You encode these rules as hard numbers, not suggestions, because an agent cannot interpret discretion or market intuition.
  • 03Paper trading lets you verify that the agent respects every exit condition before any real money is exposed.
  • 04Platform safety controls like budget caps, position limits, and a kill switch protect the owner from agent errors and extreme market events.
  • 05Trading can lose money, including the entire allocated budget, so the size of that budget should reflect what you can afford to lose.

An exit plan is a set of predefined rules that tell a trading agent exactly when to close a position, whether it is profitable or losing. Without these rules, an automated system has no concept of a trade being finished, so it will hold indefinitely or close based on arbitrary logic. You automate take profits and stop losses by encoding those exact price levels, percentage thresholds, or dollar targets into the agent's instructions before it ever opens a trade. This removes emotion from the decision and enforces discipline through code.

What is an exit plan and why does an agent need one?

An exit plan is simply the answer to the question: how do I get out of this trade? In manual trading, you might watch a chart and decide to sell when a level feels right. An agent cannot feel anything. It only acts on explicit instructions. If you do not define the exit, the agent does not know the trade has a purpose, a timeframe, or a failure condition. It will simply hold the position until some external event forces a reaction, which is not a strategy.

A complete exit plan has at least three parts. A take profit target defines the favorable outcome. A stop loss defines the maximum acceptable loss. A time limit or condition defines how long the agent is allowed to wait for either of those to hit. Together these form a closed loop: enter, monitor, exit. Without the loop, the agent is not trading. It is just buying and holding with extra steps.

Beginners often assume the agent will learn when to exit by observing the market. This is a misunderstanding. What beginners misunderstand about autonomous trading covers why agents need explicit logic rather than implied intuition. The market does not provide a natural signal that a trade is over. You must supply that signal in advance.

How do you define a take profit before the agent enters a market?

Start with a dollar amount or a percentage, not a vague feeling. Suppose you allow the agent to open a position with a $100 budget. You might set a take profit at a 5% gain, meaning the agent should close the position when the unrealized profit reaches $5. Alternatively, you can set a dollar target directly: exit when the position is worth $105. The Felix API normalizes this across stocks, crypto, perps, options, and prediction markets so you do not need to calculate contract sizes or tick values manually.

The key is that the target must be unconditional. You should not tell the agent to take profit unless the momentum looks weak. The agent has no reliable way to judge weakness without a specific, testable definition. If you want momentum considered, you must define it as a rule, such as: exit when profit exceeds $5 and the five-minute volume drops below a threshold. Otherwise, keep the rule simple. Hit the number, close the position.

Be precise about whether the take profit is a limit order or a market order. A limit order rests on the book and waits for a buyer at your price. A market order closes immediately at the best available price. In fast conditions, a market order is more certain but may slip slightly. Your exit plan should state which method to use. This is especially important in options and prediction markets where liquidity can vary.

Where do you set the hard limits that prevent the agent from holding forever?

The stop loss is the mirror of the take profit. If you cap the upside at 5%, you might cap the downside at 3%, or $3 on a $100 position. This is not optional. Every position must have a maximum loss. If you skip this step because you are afraid of being stopped out early, you are not automating a trade. You are automating a gamble. Trading can lose money, including the entire allocated budget, and a stop loss is the only automated way to define where the pain ends.

Time limits are equally important. Tell the agent: if neither the take profit nor the stop loss has triggered within 24 hours, close the position. This prevents the agent from sitting in a stagnant trade while capital is tied up. You can set a shorter limit for day trades and a longer limit for swing positions, but there must always be a boundary. Capital that is not moving is capital that is not available for better opportunities.

Beyond the trade-level rules, you need account-level guardrails. Budget caps ensure the agent cannot spend more than a fixed amount across all positions. Drawdown limits can instruct the agent to halt trading if the total portfolio drops by a preset percentage. The panic or kill switch is the final layer. It flattens every position and revokes the agent's access. How to secure an AI trading agent without giving up custody explains how these controls work while keeping funds in your wallet.

How do you encode the exit plan into the agent?

Once the rules are written in plain language, you translate them into instructions the agent can execute. If you are using an MCP client like Claude or Cursor, you describe the exit plan in the system prompt or tool configuration. If you are using the REST API directly, you include the exit parameters in the order request. The exact request schema is in the docs; the shape looks like this:

curl -X POST https://api.felix.trade/v1/orders \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "market": "crypto",
    "side": "buy",
    "budget_usd": 100,
    "take_profit_usd": 105,
    "stop_loss_usd": 97,
    "time_limit_hours": 24
  }'

This is an illustrative example. The actual field names and endpoint structure may differ, so refer to the documentation at docs for the authoritative schema. The principle is that you attach the exit conditions to the entry order itself. This way, the platform knows the full plan before the position exists.

When using MCP tools, the agent constructs this request based on your prompt. You should still verify that the agent is passing the correct parameters. Do not assume the LLM will infer the stop loss from a vague instruction like trade safely. State the numbers explicitly. The more specific your prompt, the more predictable the agent's behavior.

How do you test the exit plan without risking real money?

Paper trading is the correct environment for your first automated exit. You define the exact same rules, but the orders execute against simulated liquidity. Watch how the agent behaves when the price approaches the take profit. Does it close exactly at the target, or does it overshoot because of slippage assumptions? Does it respect the time limit and exit a flat position after the cutoff? These details reveal whether your instructions are complete.

Run a hypothetical scenario. Imagine the agent enters a long position at $100 with a take profit at $105 and a stop loss at $97. The price wiggles between $99 and $101 for 23 hours, then drops to $96.50. The agent should hit the stop loss and exit at roughly $97. If your exit plan has a time limit of 24 hours, the agent should not still be holding at hour 25. If it is, your instructions are missing a constraint.

After paper trading shows consistent behavior, you can consider live trading. What it takes to move an AI trading agent to live trading in 2026 covers the authorization steps and the mindset shift from simulation to real capital. Remember that paper trading does not simulate every real-world friction, but it will catch the most dangerous errors: missing stops, ignored time limits, and incorrect sizing.

What should you check before authorizing live trading?

Go through a checklist before you allow the agent to touch real funds.

  1. 01Every entry has a stop loss attached. No exceptions.
  2. 02Every entry has a take profit or a trailing rule defined as a specific formula.
  3. 03Time limits are set for every strategy.
  4. 04Budget caps and position limits are active in the platform.
  5. 05The panic switch is accessible and tested.
  6. 06You have reviewed the agent's logs from paper trading and confirmed exits happened exactly as specified.
  7. 07You understand that trading can lose money, including the entire budget, and you have sized that budget accordingly.

If any item is missing, do not authorize the live key. The goal of automation is not to increase risk. It is to remove the inconsistency of manual execution while keeping the same, or better, safety standards. An agent that trades without an exit plan is not a tool. It is a liability.

Frequently asked questions

Can I change the take profit after the agent enters a trade?

Yes, but only through an explicit update to the agent's instructions or a manual override. The original plan should still be respected unless you have a clear, predefined rule for when adjustments are allowed. Changing rules mid-trade often introduces emotion back into the process.

What happens if the price gaps past my stop loss?

The agent will execute the exit at the best available price, which may be worse than your stop level. This is called slippage, and it happens in all markets. Your exit plan should account for the possibility that the worst case is larger than the stop loss number.

Does the agent need a separate exit plan for each market type?

The logic remains the same, but the parameters may differ. Volatility in one market type may require wider stops than another. The Felix API uses dollar-based sizing so the math stays consistent across venues.

Can I automate partial exits, like selling half at 5% and half at 10%?

Yes, but this adds complexity. Each partial exit needs its own trigger and size. Start with full exits until you are comfortable that the agent handles the basic loop correctly. Partial exits are an advanced refinement, not a beginner feature.

Who controls the funds if the agent makes a mistake?

You do. Felix is non-custodial by construction. The agent can spend within your set limits, but it cannot withdraw funds to itself. Withdrawal addresses are owner-approved only.

Should I let the agent trade without a stop loss if I am monitoring it?

No. Manual monitoring defeats the purpose of automation and introduces delay. If you are present enough to watch the screen, you do not need the agent for that trade. Always attach a stop loss.

Give your agent a key.

One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.