Change settings of open positions

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

Changes one or more settings on the given open positions: take profit, auto close time, stop-loss on or off, stop-loss percentage, trailing stop-loss on or off, trailing arm percentage and trailing percentage.

OAuth scope: read manage About scopes

setting is an object of setting names and values. Allowed names: take_profit, auto_close_time (Unix timestamp in seconds; 0 or a time in the past turns auto close off), stop_loss_enabled, stop_loss_percentage, trailing_enabled, trailing_arm_percentage, trailing_percentage. Other names are ignored. setting can also be a comma separated list of names, with the values sent as top-level body fields. If some but not all of several settings fail, data is null. 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/setpositionsetting" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_ids":[123456],"setting":{"take_profit":3.5,"stop_loss_enabled":1,"stop_loss_percentage":2}}'

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 SetPositionSetting

FieldTypeRequiredDescription
position_idsarray of integerOptional
settingobjectOptional
take_profitnumberOptionalMinimum 0.
auto_close_timenumberOptionalMinimum 0.
stop_loss_percentagenumberOptionalMinimum 0.
stop_loss_enabledintegerOptional
trailing_enabledintegerOptional
trailing_arm_percentagenumberOptionalMinimum 0.
trailing_percentagenumberOptionalMinimum 0.

Response

Example response (illustrative values)

{
    "data": "All updates successfull."
}

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