variable:n=0;
if (c-ref(c,1))/ref(c,1)>=0.04 then n:=n+1;
nn:barslast(n=1 and ref(n=0,1));
if time=closetime(0) then n:=0;
nn为周期数
比如说002768国恩股份今天9:34涨幅第一次大于4%,9:34距离开盘为4分钟,我要的就是这个4 |
那就是修改原来的要求了,
新要求的代码是:
variable:n=0;
if (c-ref(c,1))/ref(c,1)>=0.04 then n:=n+1;
nn:valuewhen(n=1 and ref(n=0,1),todaybar);
if time=closetime(0) then n:=0;
variable:n=0;
if (h-ref(c,todaybar))/ref(c,todaybar)>=0.04 then n:=n+1;
nn:valuewhen(n=1 and ref(n=0,1),todaybar);
if time=closetime(0) then n:=0;