Skip to content

Safety & security

MetaPortAPI can place real trades, so it ships with conservative defaults.

  • Localhost only. Only programs on the same computer can connect.
  • Demo-only lock. Trading commands are refused on live accounts until you switch Demo accounts only off.
  • Max lot per order. Set a limit in the inputs and larger orders are refused before they reach MT5.
  • Algo Trading. MT5 itself blocks orders until you enable the Algo Trading button.
  1. Test your code thoroughly on a demo account.
  2. Set a realistic Max lot per order (0 = no limit).
  3. Turn Demo accounts only off.

If you enable Allow remote connections:

  • Open the port only to the IP addresses you trust (Windows Firewall rule, VPS security group).
  • Prefer a VPN, SSH tunnel or a private network over exposing the port to the internet.
  • Never forward the API port on your home router without an IP restriction.

To trigger orders from services like TradingView, put a small, authenticated bridge in front of MetaPortAPI rather than exposing the port directly. [WEBHOOK GUIDE]