z7c9的,是序列模式的。
请教leevolvo版主
为何我下面这公式,KS的输出值,一直是0?什么地方编写错误了?
(按设计,光标在K线上来回拖动,KS的数值应会变动)5分钟周期
aa:=ema(c,5) ;
bb:=ema(c,10) ;
dc:=cross(aa,bb) ;
kc:=cross(bb,aa) ;
variable: kuisun=0;
//平多
if kc and holding>0 then
begin
sell( 1 ,0 , LIMITR , close ) ,ORDERQUEUE ;
if c<enterprice then kuisun=kuisun+1 ;
end
//平空
if dc and holding<0 then
begin
sellshort( 1 , 0 , LIMITR , close ) ,ORDERQUEUE ;
if c>enterprice then kuisun=kuisun+1 ;
end
//开多
if c>o and kuisun<3 then
begin
buy(dc and holding=0 , 1 , market) ,ORDERQUEUE ;
end
else
begin
buy(dc and holding=0 , 1 , LIMITR, close ) ,ORDERQUEUE ;
end
//开空
if c<o and kuisun<3 then
begin
buyshort(kc and holding=0 , 1 , market) ,ORDERQUEUE ;
end
else
begin
buyshort(kc and holding=0 , 1 , LIMITR, close) ,ORDERQUEUE ;
end
if time=150500 then kuisun:=0;//收盘的同时,赋值为0
ks: kuisun ;
[此贴子已经被作者于2011-1-27 23:55:30编辑过]