1,自动持仓同步周期和公式信号检测模式2者不要重复
2,上面是指自动持仓同步选择固定轮询模式的话,同步时间不要低于10s。频繁同步可能会导致反复开仓等情况造成不必然的损失
3,分笔周期即为tick周期,你清楚您要了解那方面的内容
此主题相关图片如下:捕获1.jpg
所以我们选择了放大周期,但是放大周期以后仍然出现上面情况,有开仓信号不开仓,或者即使偶尔开了,但是有平仓信号又不平。最后实在是没办法了,就选择了持仓同步,结果持仓同步又出现了问题。
我们用的是分笔周期的close作为判断价格,在程序中,我把close存到一个数组里面调用,这样算是跨周期引用吗?理想的状态时,分笔周期下,一达到交易条件就进行交易,但实际会出现很多问题,信号变化太快,金字塔也交易不了,有没有一些能控制信号稳定的办法?谢谢,下面是我程序的一个框架:
// 做多情况
// 多开:
if holding<=0 and 多开条件 then
begin
if holding<0 then
sellshort(holding<0 ,holding,market);
buy(holding=0 ,1,limit,close);
x:=close; //做为记录开仓价格的一个变量,其实从多平条件设置上close>x一定满足的,我们只是担心信号不稳定,而导致实际平仓价不合理
end
//多平:
if holding>0 and 多平条件 then
sell(holding>0 and close>x,holding,limit,close);
//做空情况
// 空开:
if 空开条件 and holding<=0 then
begin
if holding>0 then
sell(holding>0 ,holding,market);
buyshort(holding=0,1,limit,close);
y:=close;
end
//空平:
if holding<0 and close<y and 空平条件 then
begin
sellshort(holding<0 and close<y,holding,limit,close);
end
end
//当前持仓:=holding;
当前持仓:holding,colorgray,linethick0;
当前资产:asset,noaxis,colorgray;
可用现金:cash(0),linethick0;
1,关键在你开仓条件,您这种情况一般都出在代码问题上。分笔周期交易是没有问题的,图表分析处理的时候勾选上高频
2,仔细分析下你的开仓条件,平仓条件