Quanta Docs
·Tài liệu Quanta hoàn chỉnh cho Quant Studio
Khái niệmrenderplot/vpvr
`vpvr(rows, va, side, …)` — Volume Profile Visible Range
Profile khối lượng cố định theo dải giá visible range — buy/sell split, POC, value area; tự recompute khi pan/load tile.
Canonical kind nội bộ: volume_profile. Verb khuyến nghị trong render v2: `vpvr` (alias legacy: volume_profile(...)).
VPVR kiểu TradingView: histogram ngang bám cạnh pane giá, tính từ toàn bộ OHLC đang hiển thị (hoặc lookback bar cuối nếu bạn giới hạn).
Story-style (khuyến nghị)
quanta
render: panel main: vpvr as "Visible Range Profile" with rows 64 and value area 70pct on right in cyan with opacity 14pct vpvr in lime and red with rows 48 and value area 68pct on right with opacity 30pct vpvr in lime and red and white with rows 48 on right with opacity 30pct
Modifier story:
| Modifier | Ý nghĩa |
|---|---|
as "Tên" | Legend / nhãn plot |
with rows N | Số hàng giá (4–256, mặc định 24) |
and value area Npct | % value area quanh POC (70pct → 0.7) |
on right / on left | Cạnh histogram (mặc định right) |
in cyan | Màu thống nhất buy + sell |
in lime and red | Buy lime · sell đỏ (split) |
in lime and red and white | Buy · sell · POC (màu thứ 3) |
with opacity Npct | Opacity histogram (14pct → 0.14) |
Function call (truyền thống)
quanta
vpvr(rows: 64, va: 70pct, side: right, color: cyan, opacity: 14pct) vpvr(rows: 48, lookback: 120, side: right, buy_color: lime, sell_color: red, poc_color: yellow, width_pct: 25, opacity: 30pct)
Tham số
| Tham số | Alias | Mặc định | Mô tả |
|---|---|---|---|
rows | bins | 24 | Số bin giá (4–256) |
lookback | — | 0 (full visible) | Số bar cuối dùng tính profile; 0 = toàn bộ panel/tile đang load |
va | value_area_pct | 0.70 | Tỉ lệ volume value area (70pct = 0.7) |
side | — | right | left hoặc right — cạnh histogram |
width_pct | — | 25 | Độ rộng tối đa histogram (% chiều ngang pane, renderer clamp ~5–45%) |
color | — | cyan | Màu thống nhất khi không tách buy/sell |
buy_color | — | (theo color) | Màu volume mua |
sell_color | — | (theo color) | Màu volume bán |
poc_color | — | yellow | Đường POC (Point of Control) |
opacity | — | 0.30 | Opacity bin; hàng ngoài value area mờ hơn (~35%) |
Thuật toán
- Phân bổ volume theo High–Low từng bar (không bin theo close đơn).
- Buy / sell split: tỉ lệ theo vị trí close trong range H–L bar đó.
- POC — mức giá có tổng volume lớn nhất (đường ngang).
- Value area — mở rộng từ POC cho đến khi đạt
va% tổng volume.
Pan / load tile (Candora)
- Khi pan trái merge tile lịch sử, engine recompute VP từ toàn bộ OHLC đã merge (một profile duy nhất mỗi panel+side).
lookback: 0(mặc định) = profile cover full visible session, không chỉ tile mới nhất.- Chỉ dùng
lookback: Nkhi bạn cố ý giới hạn N bar cuối (ví dụ profile 20 phiên gần nhất).
Render trên chart
- Layer
QuantaDraw(foreground) trên pane giá. - Bin trong value area sáng hơn; ngoài VA mờ hơn.
- Split mode: buy sát trục giá, sell phía trong (side
right).
Ví dụ đầy đủ
quanta
strategy "VPVR Demo" detect: c = market.close render: panel main: line ema(c, 50) in amber vpvr as "VRVP" with rows 64 and value area 70pct on right in cyan with opacity 14pct act: when true: signal(score: 0.1)
#plot#drawing#vpvr#volume
Trợ lý Quanta"Học nhanh hơn, hiệu quả hơn cùng AI"
Xin chào! Tôi là trợ lý học ngôn ngữ Quanta. Hỏi tôi về cú pháp, hàm, hoặc cách viết một chiến lược cụ thể (ví dụ: "Làm sao để xác định đỉnh đáy để vẽ trendline?").