Technical MACD BETA
取得特定股票在指定時間範圍內的指數平滑異同移動平均線 (MACD)
GET /technical/macd/{symbol}
Parameters
Name | Type | Description |
---|---|---|
symbol * | string | 股票代碼 |
from * | string | 開始日期(格式:yyyy-MM-dd ) |
to * | string | 結束日期(格式:yyyy-MM-dd ) |
timeframe * | string | K線週期,可選 1 1分K;3 3分K;5 5分K;10 10分K;15 15分K;30 30分K;60 60分K;D 日K;W 週K;M 月K |
fast * | number | 快線週期 |
slow * | number | 慢線週期 |
signal * | number | 信號線週期 |
caution
目前分K無法指定開始日期(from) 與 結束日期(to),一律回傳近 30 日資料。
Response
Name | Type | Description |
---|---|---|
symbol * | string | 股票代號 |
from * | string | 開始日期 |
to * | string | 結束日期 |
timeframe * | string | K線週期 |
fast * | number | 快線週期 |
slow * | number | 慢線週期 |
signal * | number | 信號線週期 |
data * | object[] | MACD 資料 |
data[0].date * | string | 資料時間 |
data[0].macdLine * | number | MACD 線 |
data[0].signalLine * | number | 信號線 |
Example
- cURL
- Python
- Node.js
curl -X 'GET' \
'https://api.fugle.tw/marketdata/v1.0/stock/technical/macd/2330?from=2024-08-01&to=2024-08-10&timeframe=D&fast=12&slow=26&signal=9' \
-H 'X-API-KEY: <YOUR_API_KEY>'
from fugle_marketdata import RestClient
client = RestClient(api_key = 'YOUR_API_KEY') # 輸入您的 API key
stock = client.stock # Stock REST API client
stock.technical.macd(**{"symbol": "2330", "from": "2024-08-01", "to": "2024-08-10","timeframe":"D", "fast": 12, "slow":26, "signal":9})
const { RestClient } = require('@fugle/marketdata');
const client = new RestClient({ apiKey: 'YOUR_API_KEY' });
client.stock.technical.macd({ symbol: '2330', from: '2024-08-01', to: '2024-08-10', timeframe: 'D', fast: 12, slow: 26, signal: 9, dPeriod: 3 })
.then(data => console.log(data));
Response Body:
{
"symbol": "2330",
"from": "2024-08-01",
"to": "2024-08-10",
"timeframe": "D",
"fast": 12,
"slow": 26,
"signal": 9,
"data": [
{
"date": "2024-08-01",
"macdLine": -8.888098865883194,
"signalLine": 1.1835714956164298
},
{
"date": "2024-08-02",
"macdLine": -13.342205320023709,
"signalLine": -1.721583867511598
},
{
"date": "2024-08-05",
"macdLine": -23.69978495993405,
"signalLine": -6.117224085996089
},
{
"date": "2024-08-06",
"macdLine": -26.359429578554114,
"signalLine": -10.165665184507695
},
{
"date": "2024-08-07",
"macdLine": -24.951921179141777,
"signalLine": -13.12291638343451
},
{
"date": "2024-08-08",
"macdLine": -25.47934996958338,
"signalLine": -15.594203100664284
},
{
"date": "2024-08-09",
"macdLine": -22.570875660446973,
"signalLine": -16.989537612620822
}
]
}