variable:i(0),tv(0),tp1(0),tp(0);
i=0;
if date<>date[1] then begin
value1=0;
value2=0;
end;
if V>0
then begin
while GetField("時間","Tick")[i]>=time and GetFieldDate("成交量","Tick")[i]=date
i+=1;
while i>0
begin
i-=1;
tv=GetField("成交量","Tick")[i];
tp=GetField("收盤價","Tick")[i];
tp1=GetField("收盤價","Tick")[i+1];
if tp>tp1 //上漲
then begin
condition1=true;
condition2=false;
end;
if tp<tp1//下跌
then begin
condition1=false;
condition2=true;
end;
if condition1 then value1+=tv;//上漲成交量累加
if condition2 then value2+=tv;//下跌成交量累加
end;
end;
value3=value1-value2;
if value3<0 and GetField("時間", "Tick")>=090000 and GetField("時間", "Tick")<093000 and condition1 and condition2 then ret=1;
想在1分頻率下取得 VALU3的值,可以編譯但目前無法回測,請小編或前輩們指導
1 評論