Fromula1的公式如下:variable:ss=1;
variable:n=0;
if todaybar=1 then ss:=1;
if todaybar=1 then n:=0;
n1:=todaybar;
dm:=4-INTPART(LOG(C));
jsj:=ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm);
cc:=c;
if cross(cc,jsj) or cross(jsj,cc) then n:=n+1;
if cross(n=4,0.5) then ss:=2;
if cross(n=6,0.5) then ss:=3;
if cross(cc,jsj) then begin
buy(holding=0,ss,marketr);
end
if cross(jsj,cc) then begin
buyshort(holding=0,ss,marketr);
end
if c<jsj-5 then sell(1,0,marketr);
if c>jsj+5 then sellshort(1,0,marketr);
if time0>=timetot0(closetime(0))-5*60 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end
fromula3的公式如下:
n1:=todaybar;
dm:=4-INTPART(LOG(C));
jsj:=ROUNDS(IF(sum(vol,n1)=0,C,sum(C*vol,n1)/sum(vol,n1)),2+dm);
cc:=c;
if cross(cc,jsj) then begin
buy(holding=0,1,marketr);
end
if cross(jsj,cc) then begin
buyshort(holding=0,1,marketr);
end
if c<jsj-5 then sell(1,0,marketr);
if c>jsj+5 then sellshort(1,0,marketr);
if time0>=timetot0(closetime(0))-5*60 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end
我在开盘前做了图表化的分时图启动!
开盘不久就开了很多的仓,但价格都是0。也就是说其实没有一个开仓成功。但都出了开仓的指令。这是什么原因?
我是期货上的夜盘交易:21:00开仓
但还有一个问题,程序中是一次性开一手,为什么有时会一次开3手进去。还是因为闪烁的问题吗?
有没有什么办法解决闪烁的问题,让开仓不能这样的开。
我明白了,这个3手,应该是第三次上下穿越,才开了3手。
能不能把分时图的上下穿越做一个定义。
有时侯,行情会在一分钟时间,连续的在分时图和结算价格线上来回的上下十几次。可不可以定义一个时间
范围,在一分钟的时间内两回上下穿1次以上为的都为1次。
这样是不是可以必开不必要的市场短期的毛刺问题。