TJP Cloud · MetaTrader 5 · Developer API

A hosted MetaTrader 5 API with the terminal included

Connect an MT5 broker account and trade through REST, receive signed webhooks, and read broker data without running a terminal on your own machine. TJP Cloud runs a real MetaTrader 5 terminal for each connected account on our EU servers with the TJP Bridge EA. The same Cloud plan includes the Telegram and Discord signal copier and trading journal.

MT5 only. A paid Cloud plan is required. Demo and live accounts can trade; test on demo before using a live account.

What the API gives your application

The API is a direct way to work with the MT5 account that TJP Cloud already hosts for you. You can build an account view, add an execution path to an internal tool, or react to broker activity without setting up a separate terminal service. The base URL is https://api.tradejournalpro.net/v1. A public OpenAPI document describes the exact request and response contract.

Account and trading operations

List the accounts a key can use, inspect open positions and pending orders, place market or pending orders, move or cancel a pending order, change a position's stop or target, and close part or all of a position. A symbol-filtered request can close matching positions together. Demo and live MT5 accounts use the same API paths.

Broker data when you need it

Ask the connected terminal for broker symbols and a symbol's specification, including tick size, tick value and volume limits. Read a current bid and ask, request candles, or retrieve deals and finished orders. These are account-specific broker data, so check the returned symbol and volume constraints before building an order.

Events without constant polling

Webhooks send trade, position, order, account, broker and status events to your HTTPS endpoint. A separate WebSocket stream can carry live ticks and account activity. Use events to update your own dashboard or reconcile fills, then read the account again when your workflow needs current state.

A personal API key can be read-only or trading-enabled and can be limited to chosen accounts. This makes it possible to give a reporting service access to positions without giving it order permission, or to confine an execution service to the accounts it operates. Account IDs and broker tickets belong in the path; tickets are strings because broker ticket values can exceed JavaScript's safe integer range.

How it works in four steps

  1. Step 1

    Choose a paid Cloud plan

    Cloud Starter covers one connected account; Cloud Pro covers up to three. The API has no separate fee within these plans. The free plan provides an EA route and does not include the hosted API. Check current plan availability before connecting because server capacity is limited.

  2. Step 2

    Connect your MT5 broker login

    In the Cloud workspace, choose TJP Cloud and enter the account number, trading password and exact broker server name. We run a real MetaTrader 5 terminal with the TJP Bridge EA on our EU servers. You do not need to maintain a PC, VPS or a second hosted API account.

  3. Step 3

    Create and scope a personal key

    Open Developer, create a read-only key for inspection or a trading key for order requests, and optionally select the accounts that key may use. Copy the key when it is shown. Put it in a server-side secret store and send it as an Authorization bearer header.

  4. Step 4

    Test, then handle outcomes

    List accounts, find your account ID, and read positions before sending a small demo order. Every write needs a unique Idempotency-Key for the intended action. Inspect the broker result and your positions after a write; a network failure or an uncertain response must not become a second order with a new key.

TJP Cloud does not host MT4 terminals. If you already use the local EA for an MT4 account, that does not turn it into an MT4 account on this hosted API. Your broker's execution rules still apply to every order, including its supported symbols, volume steps, stop distances, trading hours and decisions to reject a request.

Quickstart: read, place and close

These examples list the accounts available to a key, read a selected account's positions, send a market buy order with a broker stop loss and take profit, and close a position by ticket. Replace the sample prices and volume with values your broker accepts. Set TJP_API_KEY, ACCOUNT_ID and TICKET in your environment; the ticket comes from an actual open position. Use a different idempotency key for each intended write, and preserve the same key for retries of that write.

curl

# Store a personal key and an account ID outside your source files.
curl -H "Authorization: Bearer $TJP_API_KEY" \
  https://api.tradejournalpro.net/v1/accounts

curl -H "Authorization: Bearer $TJP_API_KEY" \
  https://api.tradejournalpro.net/v1/accounts/$ACCOUNT_ID/positions

curl -X POST "https://api.tradejournalpro.net/v1/accounts/$ACCOUNT_ID/orders" \
  -H "Authorization: Bearer $TJP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: demo-order-0001" \
  -d '{"side":"buy","type":"market","symbol":"EURUSD","volume":0.1,"stopLoss":1.08,"takeProfit":1.09}'

curl -X DELETE "https://api.tradejournalpro.net/v1/accounts/$ACCOUNT_ID/positions/$TICKET" \
  -H "Authorization: Bearer $TJP_API_KEY" \
  -H "Idempotency-Key: demo-close-0001"

Python with requests

import os
import uuid
import requests

base = "https://api.tradejournalpro.net/v1"
headers = {"Authorization": f"Bearer {os.environ['TJP_API_KEY']}"}
account_id = os.environ["ACCOUNT_ID"]
ticket = os.environ["TICKET"]  # String ticket from a position response

accounts = requests.get(f"{base}/accounts", headers=headers, timeout=30)
accounts.raise_for_status()
positions = requests.get(f"{base}/accounts/{account_id}/positions", headers=headers, timeout=30)
positions.raise_for_status()

order = requests.post(
    f"{base}/accounts/{account_id}/orders",
    headers={**headers, "Idempotency-Key": str(uuid.uuid4())},
    json={"side": "buy", "type": "market", "symbol": "EURUSD", "volume": 0.1,
          "stopLoss": 1.08, "takeProfit": 1.09}, timeout=30,
)
order.raise_for_status()

close = requests.delete(
    f"{base}/accounts/{account_id}/positions/{ticket}",
    headers={**headers, "Idempotency-Key": str(uuid.uuid4())}, timeout=30,
)
close.raise_for_status()

JavaScript with fetch (Node.js ESM)

const base = "https://api.tradejournalpro.net/v1";
const accountId = process.env.ACCOUNT_ID;
const ticket = process.env.TICKET; // String ticket from a position response
const auth = { Authorization: "Bearer " + process.env.TJP_API_KEY };

async function request(path, options = {}) {
  const response = await fetch(base + path, {
    ...options, headers: { ...auth, ...options.headers },
  });
  if (!response.ok) throw new Error("HTTP " + response.status + ": " + await response.text());
  return response.json();
}

const accounts = await request("/accounts");
const positions = await request("/accounts/" + accountId + "/positions");
const order = await request("/accounts/" + accountId + "/orders", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({ side: "buy", type: "market", symbol: "EURUSD",
    volume: 0.1, stopLoss: 1.08, takeProfit: 1.09 }),
});
const close = await request("/accounts/" + accountId + "/positions/" + ticket, {
  method: "DELETE", headers: { "Idempotency-Key": crypto.randomUUID() },
});

A successful HTTP response means the documented API response was returned; inspect the broker result and current position state as well. For a write that times out or returns 503 with uncertain: true, check positions or retry with the same Idempotency-Key. Reusing it for a different action is an error. The reference lists the other error codes and response shapes.

Webhooks and live account events

Register an HTTPS destination on the Developer page and choose the events that matter to your application: trade, position, order, account, broker and status. You can use these to refresh a position view after a fill, record an order change, or alert an operator when a terminal loses its broker connection. Handle duplicate deliveries using the event ID; a failed delivery may be retried.

Deliveries include an X-TJP-Signature header. Verify the HMAC against the raw request body and reject an old timestamp before trusting an event. Keep the webhook signing secret on your server. The API also offers a WebSocket stream for subscribed ticks, trades, account and status channels when a live connection suits your application. See the API reference for subscription details and signature verification.

Protection rules run in the terminal

A trading integration can set breakeven, trailing stop and up to five partial take-profit levels on a position. The MT5 terminal applies these rules on price changes, including when your program is offline. That is useful for applications that do not want to maintain a constant market data connection just to decide when a stop should move. Rules end when the position closes; inspect the current rules and position before changing them.

Protection rules are distinct from the initial broker stop and target on an order. Stops and targets are sent to the broker, and hidden SL/TP is not available. Points in a protection rule use the broker symbol's point size, so read the symbol specification and verify the rule on a demo account. The reference gives the complete request body for each rule.

One order request for several accounts

The bulk order endpoint accepts one order and a list of up to 50 account IDs. It returns a result per account, so treat the response as several broker outcomes rather than one all-or-nothing fill. Account-scoped keys still limit which accounts a program can reach. For a multi-account workflow, first list permitted accounts, check each broker's symbol and volume constraints, then review each result and reconcile the positions that actually changed.

The Cloud plan determines how many accounts you can connect: Starter provides one and Pro provides up to three. The API endpoint's maximum request size does not increase your subscription's connected-account allowance. A bulk call consumes write capacity according to the API limits, and each write still needs an idempotency key.

Keys, limits and the live trading switch

Personal keys are created in Developer and shown once. The service stores a hash for key lookup, so save the plaintext value in your own secret store. Start with a read-only key for dashboards and data jobs. Use a separate trading key for programs that manage orders, scope it to the accounts it needs, and revoke it if its environment is compromised. Do not put a trading key into public browser code.

Per key, the API permits bursts of 100 reads with 30 reads per second sustained, and bursts of 20 writes with five writes per second sustained. A 429 response carries Retry-After; wait before another request. A server-side live-trading off switch can reject new live orders with LIVE_TRADING_DISABLED. Read-only keys cannot trade and return READ_ONLY_KEY on writes. Treat these responses as explicit controls, not as reasons to swap keys or retry under a different account.

Keep your own records of intended actions and broker outcomes. The API can report an uncertain result if it cannot confirm what the broker did; your recovery code should inspect positions and reuse the original idempotency key. This is especially important when an automated strategy operates across accounts or when a network interruption occurs after the terminal receives an order.

Cloud pricing includes the API

There is no extra TJP Cloud API fee. The hosted MT5 terminal, REST API and webhooks are included with a paid Cloud plan, along with the Telegram and Discord signal copier and trading journal. The free plan is an EA route and has no hosted API access. Annual prices below are paid upfront; the monthly figures are billed each month.

Cloud Starter

$39/month

or $372/year paid upfront · 1 account

Cloud Pro

$59/month

or $564/year paid upfront · up to 3 accounts

Our server capacity is limited. Review the current Cloud plans before planning a larger deployment.

TJP Cloud API vs MetaApi

Checked October 2026. MetaApi is stronger when you need hosted MT4 as well as MT5, more regional deployment choices, mature SDKs across several languages or a larger-scale platform. It uses usage-based billing per account. Verify its current terms, including any personal-use offer, on the MetaApi pricing page.

TJP Cloud is different when your workflow is MT5-only and you want a flat monthly Cloud price with the hosted terminal included. The same plan contains a Telegram and Discord signal copier and trading journal. Terminal-side protection rules, a bulk order endpoint and webhooks are part of the API workflow. See the full TJP Cloud API vs MetaApi comparison and verify both products against your broker and account needs.

Frequently asked questions

Is this an MT4 or MT5 API?

The TJP Cloud API hosts MetaTrader 5 accounts only. We run one real MT5 terminal for each connected account. If hosted MT4 API access is required, this is not the right TJP Cloud route.

Do I need to host MetaTrader myself?

No. TJP Cloud runs the MT5 terminal and TJP Bridge EA on our EU servers. You connect with your broker login and use the hosted API from your own server or application. Server capacity is limited.

Can I trade a demo account before going live?

Yes. Both demo and live MT5 accounts can trade. Start on demo and confirm the broker's symbols, volume limits, stop distances and close behavior before allowing a trading key to act on a live account.

Can I create a read-only integration?

Yes. Create a read-only personal API key on the Developer page. Keys may also be limited to chosen accounts. Give trading permission only to a program that needs to place or manage orders.

Does the API add a separate charge?

No. The hosted API is included in paid Cloud Starter and Cloud Pro plans, along with the Telegram and Discord signal copier and trading journal. The free EA plan does not include the TJP Cloud API.

How do I prevent a retry from placing another order?

Send a unique Idempotency-Key with each intended write and reuse that same key if the request needs a retry. If an outcome is uncertain, check positions and retry only with the same key. The API reference explains the possible responses.

Are stops and take-profits hidden?

No. Stops and targets are sent to the broker. Hidden stop loss and take profit are not available. Terminal-side protection rules can manage breakeven, trailing stops and partial take-profits for a position.

Where can I find the full request and response contract?

Read the TJP Cloud API reference or download the OpenAPI document. It defines endpoint paths, request bodies, response schemas, errors, authentication, rate limits and webhook signatures.

Build against your MT5 account

Start with a read-only key, confirm your broker data on demo, then enable trading only for the account and program that need it. The API reference and OpenAPI document give you the details for each request.