POST https://api.cryptohopper.com/v1/hopper/{id}/position/settakeprofit

Sets the take profit percentage on the given open positions, and optionally their layered take profit levels.

OAuth scope: read manage About scopes

Send percentage_profit, take_profit_levels or both. take_profit_levels is a list of up to 10 levels: profit is the profit percentage at which the level sells, share the percentage of the original position sold; shares may add up to at most 100. It also accepts a JSON string or the shorthand "2:50,4:50". Send [] for no levels, or "inherit" to go back to the hopper's levels. Levels are not saved for positions that have an open sell order. Layered take profit is not supported for margin/futures bots. Not available for exchange arbitrage, market maker, copy and grid bots.

Example request

curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/settakeprofit" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_ids":[123456,123457],"percentage_profit":3.5,"take_profit_levels":[{"profit":2,"share":50},{"profit":4,"share":50}]}'

Parameters

Headers

NameTypeRequiredDescription
access-token string Required The OAuth access token of the user.

Path parameters

NameTypeRequiredDescription
id string Required Hopper ID.

Request body

JSON, model SetTakeProfitPost

FieldTypeRequiredDescription
position_idsarray of integerRequired
percentage_profitnumberRequiredMinimum 0.

Response

Example response (illustrative values)

{
    "data": "Position percentage profit has been set."
}

Status codes: 200. Errors return JSON with status, error and message. See How the API works for response codes and rate limits.