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/OrderCloseByKnow your positions
Read open positions, pending orders and closed history to reconcile state at any time.
/OpenedOrders/PositionsTotal/OrderHistory/TradeUnrealizedPLNever 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.
Margin
/OrderCalcMargin — the margin a hypothetical order would tie up, so you can size against free margin.
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.
# 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 }
Frequently asked
Can I place trades on MT4 and MT5 through a REST API?+
/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?+
/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?+
Can I close part of a position?+
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?+
Wire your strategy straight into the market.
Connect an account, check your margin, and send your first order in a single REST call.