選股
波段
getbaroffset(日期)
: 依日期取得相對 K 棒位置input: highestdate(2020114), "請輸入波段最高點日期");
value1 = getbaroffset(highestdate);
value2 = close[value1];
if volume > 2000 then
begin
if close cross over value2 or
close cross over highest(high[1], value1) then
ret=1;
outputfield(1, value2, 1, "前一波指數高點收盤價");
outputfield(2, value1, 0, "指數高點距今幾根bar");
end;