AlgoDeltaFXDocs
POST

Modify Order or Position

Account API v2

Change the stop loss, take profit or price of an open position or pending order.

POSThttps://api.algodeltafx.com/api/v2/forexaccount/modifyorderorposition

Update the stop loss and take profit of an open MT5 position, or the price, SL, TP and stop-limit price of a pending order, by ticket. Use it for trailing stops, break-even moves and repricing pending orders from your own code.

View .md Ask Claude Ask ChatGPT

Authentication

Send the account token as Authorization: Bearer <ACCOUNT_TOKEN>. See Authentication.

Request body

JSON body, Content-Type: application/json.

  • ticketintegerrequired

    MT5 ticket of the position or pending order.

  • pricenumber

    New order price. Pending orders only.

  • slnumber

    New stop loss price.

  • tpnumber

    New take profit price.

  • stop_limitnumber

    New limit price for stop-limit pending orders.

Response

Returns the standard response envelope: status, msg and data.

Notes

  • Send only the fields you want to change along with ticket.
  • Moving SL to the entry price creates a break-even stop. Call this endpoint repeatedly as price moves to build a trailing stop.
  • Place Order: Open a market order or place a pending order (limit, stop, stop-limit) on an MT5 account.
  • Get Open Positions: List every open position on the MT5 account.
  • Get Pending Orders: List every pending (limit, stop, stop-limit) order on the MT5 account.

Try it

Live API
Request body (JSON)

This sends a live request that can change real trades or accounts. Use a demo account to experiment.

Requests go straight from your browser to api.algodeltafx.com. Your token is not sent anywhere else.

Example request

curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/modifyorderorposition \
  -H "Authorization: Bearer $ACCOUNT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ticket": 1093918439,
  "sl": 1.0856,
  "tp": 1.1589
}'

Move a pending order

curl -X POST https://api.algodeltafx.com/api/v2/forexaccount/modifyorderorposition \
  -H "Authorization: Bearer $ACCOUNT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ticket": 1093920001,
  "price": 1.0795,
  "sl": 1.075,
  "tp": 1.09
}'

Last updated 2026-11-04