|
Data1 5分, Data2 1分
寫成一個指標載入後, print 出來發現
0846 的量總和還對, 0847 後就亂了, 不知原因在哪
Vars: SumVolume(0) , SumPriceVol(0) , VWAP(0) ;
IF (D <> D[1]) of data2 Then
Begin
SumVolume = 0 ;
SumPriceVol = 0 ;
End ;
SumVolume = SumVolume + Ticks of data2;
SumPriceVol = SumPriceVol +(C of data2)*(Ticks of data2);
If SumVolume > 0 Then
VWAP = SumPriceVol/SumVolume
Else
VWAP = C of data2;
Plot1(VWAP ,"VWAP Data2",white,Default,3) ;
if D > 1160228 then
begin
print("D=" ,D of data2 , ",T of data2=", T of data2,
" Ticks of data2=", Ticks of data2,
" C of data2=", C of data2,
" SumVolume=", SumVolume ,
" SumPriceVol=", SumPriceVol);
end;
|
|