如题,如果我想开仓的时候使用走完k线模式(因为希望趋势确定才进入),但是止损的时候用固定轮询模式(预防单根k线实体较长,导致损失过大),可以实现吗?
现在有个逐K线下模式提前N秒执行的功能
等高人来看看吧。
很简单的,都采用采用固定轮询模型,写完整点给你:
variable:cc=0,zs=0,hl=c;
ma5:=ma(c,5);
ma10:=ma(c,10);
if holding=0 and cc>0 then buy(1,1,market);
if holding=0 and cc<0 then buyshort(1,1,market);
if cc>0 and l<zs then begin
cc:=0;
sell(1,1,market);
end
if cc<0 and h>zs then begin
cc:=0;
sellshort(1,1,market);
end
if cc=0 and ma5>ma10 then begin
cc:=1;
zs:=c-10;
hl:=h;
end
if cc=0 and ma5<ma10 then begin
cc:=-1;
zs:=c+10;
hl:=l;
end
if cc>0 and h>hl then begin
hl:=h;
zs:=hl-10;
end
if cc<0 and l<hl then begin
hl:=l;
zs:=hl+10;
end
请问这个固定轮询模式为什么是用market函数?
if cc>0 and l<zs then begin //轮询模式
cc:=0;
sell(1,1,market);
end
if cc<0 and h>zs then begin //轮询模式
cc:=0;
sellshort(1,1,market);
end
为什么是这样?