Change settings of short positions

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

Changes one or more settings on the given short positions: take profit, auto close time, auto remove 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

position_ids are short position IDs. setting must be an object of setting names and values. Allowed names: take_profit, auto_close_time and auto_remove_time (Unix timestamp in seconds in the future, or 0 to turn off), stop_loss_enabled, stop_loss_percentage, trailing_enabled, trailing_arm_percentage, trailing_percentage. data is a list with one message per setting. Not available for exchange arbitrage, market maker, copy, grid and AI bots.

Example request

curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/setshortsetting" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_ids":[223344],"setting":{"take_profit":2.5,"auto_close_time":1759000000}}'

Parameters

Headers

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

Path parameters

NameTypeRequiredDescription
id string Required Hopper ID.

Request body

JSON, model SetShortSetting

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

Response

Example response (illustrative values)

{
    "data": [
        "Position percentage profit has been set.",
        "Auto close time has been set for position(s)."
    ]
}

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