# Set trend for market maker

`POST https://api.cryptohopper.com/v1/hopper/{id}/marketmaker/trend`

Part of [Market maker](https://www.cryptohopper.com/api-documentation/api-reference/market-maker.md) in the Cryptohopper API reference.

Sets a manual market trend on a market maker bot for a limited time. When the trend changes and the bot is configured to cancel orders on a trend change, its open market maker orders are cancelled accordingly.

OAuth scope: `read`, `manage`

trend is uptrend, downtrend or neutral. time_val is seconds, minutes or hours; time_count is capped at 999 (99 for hours) and at least 30 for seconds. Without time_count and time_val the trend is set for 15 minutes.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Hopper ID of a market maker bot. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/marketmaker/trend" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trend":"uptrend","time_count":30,"time_val":"minutes"}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Manual trend: uptrend has been set for the next 30 minutes."
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
