POST
https://api.cryptohopper.com/v1/hopper/{id}/trigger
Creates a trigger that runs its actions when all of its indicator conditions are met on the chosen market.
The handler checks no OAuth scope: any valid access token can call it. name and exchange are required; indicators and actions are lists of keys from Get trigger options, and indicator_configs and action_configs are objects keyed by those same keys. candle_size is in seconds. cooldown_val is minutes, hours or days (default minutes). status 1 enables the trigger. Not available for AI bots.
Example request
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger" \
-H "access-token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Stop buying above 70k","exchange":"binance","market":"BTCUSDT","candle_size":1800,"indicators":["price"],"indicator_configs":{"price":{"trig_when":">","trig_when_value":70000}},"actions":["setbuyingstatus"],"action_configs":{"setbuyingstatus":{"config":0}},"status":1,"cooldown_count":30,"cooldown_val":"minutes"}'
const response = await fetch('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger', {
method: 'POST',
headers: {
"access-token": "YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Stop buying above 70k",
"exchange": "binance",
"market": "BTCUSDT",
"candle_size": 1800,
"indicators": [
"price"
],
"indicator_configs": {
"price": {
"trig_when": ">",
"trig_when_value": 70000
}
},
"actions": [
"setbuyingstatus"
],
"action_configs": {
"setbuyingstatus": {
"config": 0
}
},
"status": 1,
"cooldown_count": 30,
"cooldown_val": "minutes"
})
});
const data = await response.json();
import requests
response = requests.post(
"https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger",
headers={
"access-token": "YOUR_ACCESS_TOKEN"
},
json={
"name": "Stop buying above 70k",
"exchange": "binance",
"market": "BTCUSDT",
"candle_size": 1800,
"indicators": [
"price"
],
"indicator_configs": {
"price": {
"trig_when": ">",
"trig_when_value": 70000
}
},
"actions": [
"setbuyingstatus"
],
"action_configs": {
"setbuyingstatus": {
"config": 0
}
},
"status": 1,
"cooldown_count": 30,
"cooldown_val": "minutes"
},
)
data = response.json()
$ch = curl_init('https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trigger');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'access-token: YOUR_ACCESS_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Stop buying above 70k',
'exchange' => 'binance',
'market' => 'BTCUSDT',
'candle_size' => 1800,
'indicators' => [
'price',
],
'indicator_configs' => [
'price' => [
'trig_when' => '>',
'trig_when_value' => 70000,
],
],
'actions' => [
'setbuyingstatus',
],
'action_configs' => [
'setbuyingstatus' => [
'config' => 0,
],
],
'status' => 1,
'cooldown_count' => 30,
'cooldown_val' => 'minutes',
]),
]);
$data = json_decode(curl_exec($ch), true);
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
access-token |
string | Required | The OAuth access token of the user. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | Required | Hopper ID. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
trigger_name | string | Required | |
enabled | integer | Optional | |
exchange | string | Optional | |
trading_pair | array of string | Optional | |
candle_size | string | Optional | One of: 5_min, 15_min, 30_min, 1_hour, 2_hours, 4_hours, 1_day. |
indicators | object | Optional | |
price | object | Optional | |
condition | string | Optional | One of: >, >=, =, <, <=. |
value | number | Optional | |
pct_change | object | Optional | |
condition | string | Optional | One of: >, >=, =, <, <=. |
value | number | Optional | |
RSI | object | Optional | |
condition | string | Optional | One of: >, >=, =, <, <=. |
value | number | Optional | |
RSI_period | number | Optional | |
stochastic | object | Optional | |
condition | string | Optional | One of: >, >=, =, <, <=. |
value | number | Optional | |
stoch_fast_K_period | number | Optional | |
stoch_slow_K_period | number | Optional | |
stoch_slow_KMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
stoch_slow_D_period | number | Optional | |
stoch_slow_DMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
stoch_RSI | object | Optional | |
condition | string | Optional | One of: >, >=, =, <, <=. |
value | number | Optional | |
stoch_RSI_period | number | Optional | |
stoch_RSI_fast_K_period | number | Optional | |
stoch_RSI_fast_D_period | number | Optional | |
stoch_RSI_fast_DMA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
bollinger_bands | object | Optional | |
condition | string | Optional | One of: signals_buy, signals_neutral, signals_sell. |
bollinger_bands_period | number | Optional | |
bollinger_bands_deviation_upper_band | number | Optional | |
bollinger_bands_deviation_lower_band | number | Optional | |
bollinger_bands_MA_type | string | Optional | One of: sma, ema, wma, dema, tema, trima, kama, mama, t3. |
MACD | object | Optional | |
condition | string | Optional | One of: signals_buy, signals_neutral, signals_sell. |
MACD_fast_period | number | Optional | |
MACD_slow_period | number | Optional | |
MACD_signal_period | number | Optional | |
EMA | object | Optional | |
condition | string | Optional | One of: signals_buy, signals_neutral, signals_sell. |
EMA_short_period | number | Optional | |
EMA_long_period | number | Optional | |
SMA | object | Optional | |
condition | string | Optional | One of: signals_buy, signals_neutral, signals_sell. |
SMA_short_period | number | Optional | |
SMA_long_period | number | Optional | |
KAMA | object | Optional | |
condition | string | Optional | One of: signals_buy, signals_neutral, signals_sell. |
KAMA_short_period | number | Optional | |
KAMA_long_period | number | Optional | |
actions | object | Optional | |
load_template | integer | Optional | |
set_buying_status | integer | Optional | |
set_selling_status | integer | Optional | |
hold_positions | array of string | Optional | |
release_positions | array of string | Optional | |
set_pct_profit | object | Optional | |
coins | array of string | Optional | |
pct_profit | number | Optional | Minimum 0. |
buy | array of string | Optional | |
sell | array of string | Optional | |
sell_everything | integer | Optional | |
send_email_msg | string | Optional | |
cooldown_until | integer | Optional | |
cooldown_time_unit | string | Optional | One of: minutes, hours, days. |
Response
{
"data": {
"trigger_id": 12845001,
"status": 1,
"triggers_left": 4,
"triggers_total": 1,
"message": "Trigger saved."
}
}