TSELLHOLDINGEX( , , )
有这样的函数,可以设置参数,
你看看后台交易函数列表里的解释
ma5:ma(c,5);
ma10:ma(c,10);
sp:=cross (ma5,ma10);
bp:=cross (ma10,ma5);
long:= tholding<=0 and sp;
if long then begin
tsellshort(1,0,0,0,mkt,'12202822');
tbuy(1,1,0,0,mkt,'12202822');
end
short:= tholding>=0 and bp;
if short then begin
tsell(1,0,0,0,mkt,'12202822');
tbuyshort(1,1,0,0,mkt,'12202822');
end
他们是顺序依次调用的,不会混的。
你试试用DEBUGOUT函数调试一下输出,看看效果
ma5:ma(c,5); long:= tholding<=0 and sp; short:= tholding>=0 and bp; if short then begin |
ma42:ma(c,60);
long1:= tholding<0 and c>ma42;
long2:= tholding=0 and c>ma42 and ma42>ref(ma42,1);
tsellshort(long1,0,0,0,mkt,'800794');
tbuy(long2,1,0,0,mkt,'800794');
short1:= tholding>0 and c<ma42;
short2:= tholding=0 and c<ma42 and ma42<ref(ma42,1);
tsell(short1,0,0,0,mkt,'800794');
tbuyshort(short2,1,0,0,mkt,'800794');
请帮我看一下,这个程序在后台会预警账户不会开仓,错在哪啦
那要怎么改呢