逻辑混乱
if sk then
begin
sell(holding>0,0,thisclose); 没有开多信号怎么平仓
buyshort(holding<=0,1,thisclose); //只有开空何用
end
if sk then
begin
sellshort(holding<0,0,thisclose);
buy(holding>=0,1,thisclose);
end
那么这样呢?没有开空信号怎么平仓?只有开多何用?
老师,你上面的理解是不正确的。因为这样是有信号的。
而
if sk then 就没有信号。我是文华老手,却是金字塔新手,这应该是个简单的起步问题,还请老师耐心解答!因为这个公式里在文华是都有信号的 |
就你所说的,
Z:=(H+L)/2;
A:=O-L;
B:=H-O;
SK:=C<Z AND A>B;
if sk then
begin
sell(holding>0,0,thisclose);
buyshort(holding<=0,1,thisclose);
end
我测试了下,结果显示----只有开空信号
按照你的语句,正常的很,因为还没写上平空语句
再添加对应的平空开多语句,就全了
如果你是文华老手,那么请将文华的bk改成enterlong等信号即可。
Z:=(H+L)/2;
A:=O-L;
B:=H-O;
SK:=C<Z AND A>B;
if sk then
begin
sell(holding>0,0,thisclose);
buyshort(holding<=0,1,thisclose);
end
我测试了下,结果显示----只有开空信号
老师,如果有开空信号那就对了,但我测试了没有任何信号啊,我写这个极为简单的程序就是为了测试平台,看看机理。
请问是哪里出错了呢?我的版本是海通期货1.99版
老师我是从ENTERLONG 过来的,到了BUY 以后要TBUY的,所以还请解答。如果能像你说的,只有开空信号,那就对了,应该是连续的开空信号
非常感谢wattwei网友的回答,
Z:=(H+L)/2;
A:=O-L;
B:=H-O;
SK1:=C<Z&&A>B;
SK1,SPK;
NOFILTER; //文华
应该等同于金字塔
Z:=(H+L)/2;
A:=O-L;
B:=H-O;
SK:=C<Z AND A>B;
if sk then
begin
sell(holding>0,0,thisclose);
buyshort(holding<=0,1,thisclose);
end
但金字塔的却没有信号