Sử dụng TradingView Lightweight Charts - Real-time polling mỗi 5 giây
curl -X POST "https://stock.tuancuong.store/api/chart/export-image" \ -H "Content-Type: application/json" \ -d '{"symbol":"VCB","timeframe":"D","days":100,"height":600,"width":1200,"theme":"light","indicators":["Ichimoku"]}' \ --output chart-vcb-1d.png
💡 Mã: VCB | Khung: 1d
📊 Chỉ báo sẽ được vẽ: MA5, MA10, MA20, MA50, BB
✅ Dữ liệu THẬT từ TCBS API (không phải dữ liệu mẫu)
⚠️ Export sẽ bao gồm tất cả chỉ báo đang hiển thị trên biểu đồ của bạn
https://stock.tuancuong.store/api/chart/export-image
💡 Mở URL trên trong browser hoặc dùng form POST để download ảnh.
curl -X GET "https://stock.tuancuong.store/api/chart/candlestick?symbol=VCB&days=100" \ -H "Accept: application/json"
curl -X GET "https://stock.tuancuong.store/api/chart/latest?symbol=VCB&last_close=64000" \ -H "Accept: application/json"
curl -X GET "https://stock.tuancuong.store/api/chart/stock-info?symbol=VCB" \ -H "Accept: application/json"
💡 Lệnh curl này sẽ snapshot màn hình hiện tại với tất cả chỉ báo đang bật
curl -X POST "https://stock.tuancuong.store/api/chart/snapshot" \
-H "Content-Type: application/json" \
-H "Accept: image/png" \
-d '{"symbol":"VCB","timeframe":"D","days":100,"width":1200,"height":600,"theme":"dark","indicators":[]}' \
--output chart-snapshot-vcb-1d.png
💡 Snapshot sẽ bao gồm: Chỉ có nến
{
"symbol": "VCB", // Mã chứng khoán (VCB, VNM, HPG, etc.)
"timeframe": "D", // Khung thời gian (1, 5, 15, 30, 60, 120, D, W, M)
"days": 100, // Số ngày dữ liệu (mặc định: 100)
"height": 600, // Chiều cao ảnh (mặc định: 600)
"width": 1200, // Chiều rộng ảnh (mặc định: 1200)
"theme": "light", // Theme: "light" hoặc "dark"
"indicators": ["MA5", "MA10", "MA20", "MA50", "BB", "Ichimoku"] // Chỉ báo cần vẽ
}
💡 indicators: Mảng các chỉ báo cần vẽ. Có thể bao gồm: MA5, MA10, MA20, MA50, BB (Bollinger Bands), Ichimoku
curl -X GET "https://stock.tuancuong.store/api/chart/ichimoku-json?symbol=VCB&timeframe=D&days=100" \ -H "Accept: application/json"
💡 Trả về JSON với dữ liệu Ichimoku cho tất cả 4 bộ: Standard, Fast, Medium, Slow
{
"success": true,
"symbol": "VCB",
"data": [
{
"time": 1728529200,
"date": "2024-10-10",
"open": 63900,
"high": 64200,
"low": 63600,
"close": 63800,
"volume": 190400
}
]
}