temp_ll:=llv(l,2);
if pd then
begin
sellshort();
buy();
ll:=temp_ll;
end
if AVGENTERPRICE<ll then sell();
以多头为例,空头方向用户可自行完成
pd:=count(kx=-1,2)=1 and aq1>=1;//做多条件 pk:=count(kx=1,2)=1 and aq1>=1;//做空条件 //交易系统 temp_ll:=llv(l,3); if ref(pd,1)=1 then begin sellshort(1,holding,marketr); buy(holding=0,ss,marketr); ll:=temp_ll; end if AVGENTERPRICE<ll then sell(1,holding,marketr);//止损止盈,实时出场 temp_hh:=hhv(h,3); if ref(pk,1)=1 then begin sell(1,holding,marketr); buyshort(holding=0,ss,marketr); hh:=temp_hh; end if AVGENTERPRICE>hh then sellshort(1,holding,marketr); |
6楼的写法就行
1,“因为使用的是缠论低顶分型(kx=-1),这分型有未来函数原因”,不要使用未来函数就不会闪烁了。
2,if enterbars>1 and l<ll-2*MINDIFF then sell(1,holding,marketr);//止损止盈,实时出场
止盈止损这里用最低价判断就可以避免闪烁,ll-2*MINDIFF 是一个固定值,最新的l只会比原来的更低,所以不存在闪烁的情况