HTTP API트리거 주문
트리거 가격 변경
요청 만들기
값을 바꾸면 명령이 함께 바뀝니다. 토큰은 여기에 입력하지 않습니다. 명령은 SPECTRE_LOCAL_API_TOKEN 환경 변수에서 토큰을 읽습니다. 자신의 터미널에서 실행하세요.
명령
curl -X PATCH 'http://127.0.0.1:48180/v1/orders/trigger/42' \
-H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"connection_id": 12,
"instrument": "binance:futures:BTCUSDT",
"kind": "stop_loss",
"trigger_price": "65500"
}'PATCH
새 트리거 가격을 설정합니다. 터미널은 창이 하는 것처럼 이전 트리거를 취소하고 새 트리거를 넣습니다. stop에는 side도 필요합니다.
bearerToken trading:writeheader
인증Bearer <token>Local API 토큰입니다: spt_와 16진수 문자 64개. Settings App → 일반 → Local API에서 복사합니다. Authorization 헤더로만 받습니다. 작업에 나열된 이름은 그 작업에 필요한 권한입니다. 터미널의 토큰에는 모든 권한이 있습니다.
권한: trading:write
id*string트리거의 숫자 id이며, GET /account/orders에서 가져옵니다. t-…나 sl_… 같은 키는 받지 않습니다.
Match
^[0-9]+$application/json- body
connection_id*integer형식
int64instrument*string종목 주소, exchange:market:symbol.
kind*TriggerKind값 범위
"stop_loss""take_profit""stop"trigger_price*string새 트리거 가격입니다.
side?stringstop에만 해당합니다.
값 범위
"buy""sell"rule?TriggerRule값 범위
"price_above_or_equal""price_below_or_equal"터미널이 명령을 접수했습니다. key는 null입니다.
application/json- response
모든 거래, 트리거, 레버리지 명령의 응답입니다.
accepted*boolean거래소가 아니라 터미널이 접수했습니다.
operation_id*string터미널의 거래 작업 로그에 기록되는 작업의 id입니다. 넣은 주문의 키는 t-에 이 id를 붙인 것입니다.
key*|넣은 주문의 키 t-… 또는 넣은 트리거의 키입니다: sl_…, tp_… 또는 stop_…. 취소, 수정, 레버리지의 경우 null입니다.
connection_id*integer형식
int64instrument*stringcurl -X PATCH 'http://127.0.0.1:48180/v1/orders/trigger/42' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "connection_id": 12, "instrument": "binance:futures:BTCUSDT", "kind": "stop_loss", "trigger_price": "65500"}'응답 예제
{ "accepted": true, "operation_id": "173029440000000008", "key": null, "connection_id": 12, "instrument": "binance:futures:BTCUSDT"}