請問小編為何回測可以跑出,但開盤後無法執行,會顯示錯誤
input: length(20),confirmVolume(500),Period(60, "平台區間");
setinputname(1,"均量期數");
setinputname(2,"突破均量張數");
settotalbar(3);
if volume > Average( volume[1],length) +confirmVolume then ret=1;
input:ratio1(3,"各高點(低點)間的差異幅度");
variable:h1(0),h2(0),L1(0),L2(0);
h1=nthhighest(1,high[1],period);
//找出區間最高點
h2=nthhighest(4,high[1],period);
//找出區間第四高點
l1=nthlowest(1,low[1],period);
//找出區間最低點
l2=nthlowest(4,low[1],period);
//找出區間第四低點
if (h1-h2)/h2<=ratio1/100
//區間最高點與第四高點間差距小於3%
and (l2-l1)/l1<=ratio1/100
//區間最低點與第四低點間差距小於3%
and close crosses over h1
//收盤價突破區間高點
and close[period+30]*1.04<h1
//整理前30天已有一定漲幅後才開始橫向整理
and volume> average(volume,period)
//成交量大於區間均量
then ret=1;
1 評論