MetaTrader®, MT4® and MT5® are trademarks of MetaQuotes Ltd. This is an independent service and is not affiliated with, authorized by, or endorsed by MetaQuotes. Trustpilot4.0
ORDER EXECUTION · MT4 & MT5

Place, modify and close trades — programmatically.

Send market and pending orders, manage stops and take-profits, and close positions with one call each. And before you fire, the calculators tell you the margin, the profit and whether the order will even be accepted.

/OrderSend · /OrderModify · /OrderClose · /OrderCheck
order ticket · EURUSD demo
Volume0.01 lots
TypeMarket
Price1.16401
margin $116.40est. profit @+50p $50.00
▸ ready — press “Send order”
/OrderSend → ticket, price, volume · demo account
Market & pending orders SL / TP & partial close Pre-trade calculators MT4 & MT5, any broker
// what it is

Full order control over a clean REST surface.

The Trading API lets your application open, modify and close MT4/MT5 orders through simple REST calls — the same actions a trader takes in the terminal, driven by code. /OrderSend opens a market or pending order with optional stop-loss, take-profit and magic number; /OrderModify changes an order's levels; /OrderClose closes a position in full or part. Every call returns the broker's result — ticket, fill price and volume — so your system always knows exactly what happened.

Manage orders

Open, adjust and close — market or pending, with stops, take-profits and partial closes.

/OrderSend/OrderModify/OrderClose/OrderDelete/OrderCloseBy

Know your positions

Read open positions, pending orders and closed history to reconcile state at any time.

/OpenedOrders/PositionsTotal/OrderHistory/TradeUnrealizedPL
// look before you leap

Never send an order blind.

Three read-only calculators answer the questions that decide whether an order is a good idea — before it hits the market.

M

Margin

/OrderCalcMargin — the margin a hypothetical order would tie up, so you can size against free margin.

P

Profit

/OrderCalcProfit — the profit a move from open to close price would yield, in account currency.

Check

/OrderCheck — whether the order would be accepted at all, given margin and rules.

send-order.sh — open, confirm, close
# open a 0.01-lot market BUY on EURUSD
curl -X POST "https://hrx.info/OrderSend?id=<acc>&symbol=EURUSD&operation=buy&volume=0.01" \
  -H "x-api-key: sk_live_…"
# → { "ticket":69054439, "price":1.16401, "volume":0.01 }

# later — close it by ticket
curl -X POST "https://hrx.info/OrderClose?id=<acc>&ticket=69054439" \
  -H "x-api-key: sk_live_…"
# → { "closed":true, "profit":0.0 }
// questions

Frequently asked

Can I place trades on MT4 and MT5 through a REST API?+
Yes. /OrderSend opens market or pending orders on both MT4 and MT5 accounts, with optional stop-loss, take-profit and magic number. /OrderModify and /OrderClose manage them afterwards.
Can I calculate margin and profit before trading?+
Yes. /OrderCalcMargin returns the margin an order needs, /OrderCalcProfit the profit a price move would yield, and /OrderCheck whether the order would be accepted — all without placing anything.
Do I get the broker's real fill back?+
Yes. Each order call returns the broker's actual result — the ticket number, fill price and executed volume — so your system reconciles against what really happened, not an assumption.
Can I close part of a position?+
Yes. Pass a smaller lots value to /OrderClose for a partial close; omit it to close the whole position. /OrderCloseBy closes one position against an opposite one.
Is it safe to run automated trading on my account?+
Orders execute on a hosted terminal logged into your account, and a per-account key carries its own trading permission — a read-only key can query but never trade. You stay in control of which keys can send orders.
Start free

Wire your strategy straight into the market.

Connect an account, check your margin, and send your first order in a single REST call.