variable:aa=c;
a1:=ref(aa,1);
a2:=ref(aa,2);
a3:=ref(aa,3);
a4:=ref(aa,4);
a5:=ref(aa,5);
if 条件 then begin
a1:=55;
a2:=55;
a3:=55;
a4:=55;
a5:=55;
end
这里用循环不好,枚举好了
你要确定你的N变量是多少,有没有设置太小导致越界。
还有你公式是运行逐K线还是什么。
帮你随便写了个范例
runmode:0;
AA:close;
bb:=barpos;
if close>open then begin
for i=1 to 5 do AA[bb-i]:=55;
end
runmode:0;
AA:close;
bb:=barpos;
if close>open then begin
for i=1 to 5 do AA[bb-i]:=55;
end
请问老师,上面代码,看到的AA值出现55的地方是的对,符合程序;但是,改成以下就有问题了:
runmode:0;
AA := close;
bb:=barpos;
if close>open then begin
for i=1 to 5 do AA[bb-i]:=55;
end
output:AA,nodraw;
这个output的值一直和close保持一致,没有出现55的地方,请问这是为什么?
runmode:0;
bb:=barpos;
if close>open then begin
for i=1 to 5 do AA[bb-i]:=55;
end
out1:AA[bb-1],nodraw;
out2:AA[bb-2],nodraw;
out3:AA[bb-3],nodraw;
out4:AA[bb-4],nodraw;
out5:AA[bb-5],nodraw;//用这种写法,你前面是对这个值进行重新赋值的
output:aa,nodraw;