请高手看看哪里出问题了,为什么老是每根k线都有信号
以下后台模型使用的目的:用这个模型在后台补充图表模型不能防止秒杀的漏洞的(轮询1秒)
超级止损d:=TENTERPRICE -DYNAINFO( 7)>8 and tholding2>0;
超级止损k:=DYNAINFO( 7)-TENTERPRICE>4 and tholding2<0;
if 超级止损d and tholding2>0 then
begin
tsell(超级止损d,0, MKT);
end
if 超级止损k and tholding2<0 then
begin
tsellshort (超级止损k,0,mkt);
end
//开盘时的资产值
xx:=if(date<>ref(date,1),tasset,0);
期初权益:=valuewhen(xx>0,xx);
当天盈亏:=tasset-期初权益;
if 当天盈亏>25000 and tholding2>0 then
begin
tsell(1,0, MKT);
end
if 当天盈亏>25000 and tholding2<0 then
begin
tsellshort(1,0,mkt);
end
你的XX 取的有问题,tasset是真实帐户的资产,跟你那根K线没有关系
要判断权益的变化应该在开盘的时候用全局变量记录一次资产,然后再调用TASSET来运算判断变化量有多少
或者用TACCOUNT( 4)函数计算浮动盈亏看看
比较可靠的方法楼主可以试试金字塔自带的持仓监控止损功能
这段程序想实现多空区别对待,各位讲的好像都不能实现。另外监控也出现以外,不知道怎么回事?