# Can You Trade MT5 When Your Computer Is Turned Off?

> What keeps working when your MetaTrader 5 terminal is closed, what stops, and three ways to keep MT5 automation running without leaving your own computer on.

Published 2026-10-07 by fxapis. Canonical: https://fxapis.com/blog/trade-mt5-with-computer-off

## In short

- Open positions, stop losses, take profits and pending orders live on the broker's server, so they keep working when your computer is off.
- Anything that decides to trade — an Expert Advisor, a script, a trailing stop — runs in your terminal and stops when the terminal does.
- To keep automation running, the terminal has to run somewhere that stays on: a VPS, or a hosted API that runs it for you.
- With a hosted API, your own code can run anywhere — a server, a container, a serverless function — and needs no MetaTrader at all.

**Some of it, yes.** What is already at your broker keeps working when your computer is off. What your computer was doing for you stops. The difference decides whether you need anything running at all.

## What keeps working

These are held by the broker's trade server, not by your MetaTrader 5 terminal:

- **Open positions.** They stay open, at the broker.
- **Stop loss and take profit.** They are prices stored with the position at the broker, and they trigger there.
- **Pending orders.** A buy limit or a sell stop waits at the broker and fills there when the price reaches it.

If your plan is "open a trade with a stop and a target, then walk away", you can turn the computer off.

## What stops

These run inside your terminal, so they stop the moment it closes, sleeps or loses its connection:

- **Expert Advisors and scripts.** No terminal, no code running.
- **Trailing stops.** MT5's built-in trailing stop is moved by the terminal. While it is closed, the stop stays where it was last set.
- **Anything that reacts to an event.** A signal arriving, a TradingView alert, a new member joining your copy service: if a terminal must act on it, a terminal must be running.

## Three ways to keep automation running

| | Leave your PC on | Rent a VPS | Use a hosted API |
|---|---|---|---|
| What runs the terminal | Your computer | A server you rent | The provider |
| Your computer can be off | No | Yes | Yes |
| You maintain | Everything | The server and the terminal | Your own code only |
| Good for | Trying things out | An Expert Advisor of your own | Products and multi-account trading |

**Leaving your computer on** works until the first update, power cut or closed lid. It is fine for experiments.

**A VPS** is a computer in a data centre that stays on. You install MetaTrader there and look after it — see [do you need a VPS?](https://fxapis.com/blog/do-you-need-a-vps-to-automate-metatrader-5) for what that involves.

**A hosted API** runs the terminal for you. With fxapis, you connect an account once with its login, password and server, and your code places orders over HTTPS from wherever it runs. An account can stay connected all the time, or come online when an order arrives — about 10 seconds in our measurements — and go offline after 15 idle minutes. Either way, nothing of yours has to stay switched on beyond your own application.

## Where your own code runs

A hosted API moves the terminal, not your logic. Your code still decides when to trade, so it needs to run somewhere that is up when the decision is made: a small server, a container, a scheduled job, or a serverless function triggered by a webhook.

If the decision comes from somewhere else, you may not need your own server at all:

- **TradingView alerts** can be sent straight to an fxapis alert URL, which places the order. No EA, no VPS, and no server of yours. See [TradingView to MT5](https://fxapis.com/tradingview).
- **AI agents** can trade through the hosted [MCP server](https://fxapis.com/mcp).

## Next steps

- [How fxapis works](https://fxapis.com/mt5-api) — accounts, orders and history over one API.
- [Accounts and modes](https://docs.fxapis.com/accounts#modes) — which accounts should stay connected, and which can come online on demand.

## Questions

### Will my stop loss trigger if MetaTrader is closed?

Yes. In MetaTrader 5, stop loss and take profit levels are stored on the broker's trade server and execute there, whether or not your terminal is running.

### Does a trailing stop work when MT5 is closed?

No. MetaTrader 5's built-in trailing stop is managed by the terminal, so it only moves while the terminal is running and connected.

### Do Expert Advisors keep running when I shut down my PC?

No. An Expert Advisor runs inside the terminal. When the terminal closes, the EA stops until it is opened again.

### Does fxapis need my computer to be on?

No. fxapis runs the MetaTrader 5 terminal in its own cloud, hosted in the EU. Your code calls the API from wherever it runs, and accounts can stay connected or come online when an order arrives.
