variable:maxl=0,maxl2=0;
if holding=0 then begin
buy(开多,1,limitr,c);
maxl:=l;
end
if ENTERBARS>0 then begin
SELL(平多 and holding>0,1,limitr,c);
buyshort(holding=0 1,limitr,c);
maxl2:=l;
end
l2:maxl2,LINETHICK0;
第一次开多仓,maxl 能记录开多点的最低价,并且不变,直到平多开空,但开空后,maxl2所记录的L 却随着下根K线而变,请教:程序哪里有问题,谢谢!!!
[此贴子已经被作者于2013/9/9 13:38:08编辑过]
enterbars>0这个条件不是唯一的,只要是开仓之后的k线,都满足,因此L2在一直变,所以得要换个条件
把enterbars改为=0,还是随着下根K线而变。
这个得要分离出来了,能不能是反手分离出来?
if 开仓条件 and holding=0 then begin
buy;
l1:=l;
end
if 平仓条件 and holding>0 then begin
sell;
l2:=l;
end
if 开空条件 and holding=0 then buyshort;
类似这样的