這是我們目前 VWAP:
// ── VWAP 計算核心 ──
// 典型價
tp_val = (High + Low + Close) / 3;
// 重置:08:30 / 15:00 / 夜盤自訂時間
if (Time >= 083000 and Time[1] < 083000)
or (Time >= 150000 and Time[1] < 150000) then
begin
total_vol = Volume;
total_amt = tp_val * Volume;
end
else
begin
if (vwap_reset_time > 0)
and (Time >= vwap_reset_time)
and (Time[1] < vwap_reset_time) then
begin
total_vol = Volume;
total_amt = tp_val * Volume;
end
else
begin
total_vol = total_vol + Volume;
total_amt = total_amt + (tp_val * Volume);
end;
end;
if total_vol <> 0 then
_vwap = total_amt / total_vol;
這個在 1 分 K 已經可以運作了,在 5 分 K 也可以運作,但是如何在一分 K 去讀取 5 分 K 的 VWAP?
謝謝.
1 評論