82 lines
2.0 KiB
Bash
Executable File
82 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# 매매 규칙을 API로 등록하는 스크립트
|
|
|
|
API_URL="http://localhost:8000/api/v1/rules"
|
|
|
|
# 1. RSI 과매도 반등 전략
|
|
curl -X POST "$API_URL" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"name": "RSI 과매도 반등 전략",
|
|
"description": "RSI가 40 이하로 과매도 상태이고, 거래량이 평균의 150% 이상일 때 매수",
|
|
"rule_type": "BUY",
|
|
"is_active": true,
|
|
"priority": 1,
|
|
"conditions": {
|
|
"rsi_threshold": 40,
|
|
"volume_multiplier": 1.5,
|
|
"ma_proximity": 0.03
|
|
},
|
|
"actions": {
|
|
"action_type": "buy",
|
|
"position_ratio": 0.15,
|
|
"min_amount": 500000,
|
|
"take_profit": 5.0,
|
|
"stop_loss": 3.0
|
|
}
|
|
}'
|
|
|
|
echo -e "\n✅ RSI 전략 등록 완료\n"
|
|
|
|
# 2. 골든크로스 추세 추종
|
|
curl -X POST "$API_URL" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"name": "골든크로스 추세 추종",
|
|
"description": "5일선이 20일선을 상향 돌파하고 상승 추세가 확인될 때 매수",
|
|
"rule_type": "BUY",
|
|
"is_active": true,
|
|
"priority": 2,
|
|
"conditions": {
|
|
"sma_short": 5,
|
|
"sma_long": 20,
|
|
"trend": "up"
|
|
},
|
|
"actions": {
|
|
"action_type": "buy",
|
|
"position_ratio": 0.2,
|
|
"min_amount": 1000000,
|
|
"take_profit": 10.0,
|
|
"stop_loss": 5.0
|
|
}
|
|
}'
|
|
|
|
echo -e "\n✅ 골든크로스 전략 등록 완료\n"
|
|
|
|
# 3. 이동평균 정배열
|
|
curl -X POST "$API_URL" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"name": "이동평균 정배열 전략",
|
|
"description": "5일 > 20일 > 60일 이동평균 정배열 상태에서 매수",
|
|
"rule_type": "BUY",
|
|
"is_active": true,
|
|
"priority": 3,
|
|
"conditions": {
|
|
"ma5_above_ma20": true,
|
|
"ma20_above_ma60": true,
|
|
"price_above_ma5": true
|
|
},
|
|
"actions": {
|
|
"action_type": "buy",
|
|
"position_ratio": 0.15,
|
|
"min_amount": 500000,
|
|
"take_profit": 7.0,
|
|
"stop_loss": 4.0
|
|
}
|
|
}'
|
|
|
|
echo -e "\n✅ 이동평균 전략 등록 완료\n"
|
|
|
|
echo "🎉 모든 매매 규칙이 등록되었습니다!"
|