input: x(60,"天期");
Var:check(0);
value1=average(close,x);
condition1=close > value1; //條件:股價剛突破60日均線
condition2=close[1] < value1[1]; //條件:昨日股價剛低於60日均線
condition3=close > close[1]; //條件:今天的收盤價比前一天的收盤價高
condition4=close > 20;
Value2 = GetFIELD("估計量"); //量比公式為:估計量 / 昨量
Value3 = average(getfield("Volume", "D")[1], 5);
condition5=value3 > 1000;
condition6=False;
if value3>0
AND CLOSE > OPen //紅棒
then begin
condition6=value2 / value3 > 1.5;
end;
var: intrabarpersist _oncePerBar(0);
value8=(GetField("Close", "1")-getField("RefPrice","D")[0])/getField("RefPrice","D")[0];//漲幅
value9=GetField("成交量","D")[0];//今日成交量
value10=close;
if date <> date[1] then begin
check=0;
end;
if condition1 and condition2 and condition3 and condition4 and condition5 and condition6 and date=currentDate and _oncePerBar <> currentbar then begin
Print(file("C:\XQ log\output.txt"),FormatDate("yyyy/MM/dd", currentDate),FormatTime("HH:mm:ss", currentTime),symbolName,symbol,NumToStr(value8,4),NumToStr(value9,0),NumToStr(value3,0),NumToStr(value10,2));
ret=1;
_oncePerBar = currentbar;
end;

3 評論