盘中抓涨停
看了一发千钧老师的1分钟盘中抓涨停
研究了下他的代码,用大智慧仔细的写了下,做了一个选股,和一个指标
做了参数,方便优化,限制每日的入场次数
input:lenRTO(0.08,0.05,0.2,0.01),{单笔换手系数}
lenmaxRange(1.04,1.0,2.0,0.01),{最大涨幅}
lenminRange(1.01,1.0,2.0,0.01);{最小涨幅}
if day<>day[1] then
begin
preCloseD:=close[1];{昨日日线收盘价}
myAmount:=close*max(vol,1);{成交金额}
myVol:=max(vol,1);{成交量}
VERTLINE(1,1);
times:=0;
end else
begin
myAmount:=myAmount+close*max(vol,1);{累计成交金额}
myVol:=myVol+max(vol,1);{累计成交量}
end
Amountline:myAmount/myVol;{近似均价线}
priceRange:=close/preCloseD;{今日即时涨幅}
turnoverratio:=vol/capital*100;{单笔换手率}
{最终输出------------------------------------------------}
if turnoverratio>lenRTO then
begin
line:=llvall(low)*0.999;
end else
begin
line:=llvall(low)*0.995;
end
单笔换手信号:line;
Entercond:=CLOSE>Amountline and priceRange<lenmaxRange and priceRange>lenminRange and turnoverratio>lenRTO;
if Entercond then times:=times+1;
DRAWTEXT(Entercond and times<2,llvall(low)*0.9999,'←进场');
STICKLINE(Entercond,CLOSE,OPEN,8,0),colorgreen;