tsl:=0;
for i=barpos downto 1 do
if time=CLOSETIME(0) then begin
tsl:=tsl+1;
end
if tsl>=p1 then begin
break;
end
end
帮忙看一下哪里有错?
我要算出前面p1个交易日离目前有多少个周期~
如何算?
tsl:=0;
for i=barpos downto 1 do
if time=CLOSETIME(0) then begin
tsl:=tsl+1;
end
if tsl>=p1 then begin
break;
end
//
tsl:=0;
for i=barpos downto 1 do
if time=CLOSETIME(0) ANDF TSL=< P1 then begin
tsl:=tsl+1;
end
你这样算出来,tsl不就等于Pl么?
[此贴子已经被作者于2013/12/11 15:04:09编辑过]
以下是引用yukizzc在2013/12/11 16:39:49的发言:
for 后面没有begine,加上试试
你说的是哪句啊?能具体详细点不?
代码也只有这么长~你copy一下能够通过检验的写法
[此贴子已经被作者于2013/12/12 13:22:03编辑过]
for i=barpos downto 1 do
begin
if time=CLOSETIME(0) then begin
tsl:=tsl+1;
end
if tsl>=p1 then begin
break;
end
end
这样看看
tsl:=0;
p1:=10;
for i=barpos downto 1 do
begin
if time=CLOSETIME(0) then tsl:=tsl+1;
if tsl>=p1 then break;
end