测试结果是只有一笔交易?
开多条件:=kj10>0 and ref(kj10,1)<0;//kj10是一个被赋予了2和-2的一组数据。
开空条件:=kj10<0 and ref(kj10,1)>0;
//交易系统
if (开多条件 or 开空条件) then begin
平空:SELL(开多条件 and holding<0,10,thisclose);
开多:buy(开多条件 and holding=0,10,thisclose);
平多:sellshort(开空条件 and holding>0,10,thisCLOSE);
开空:buyshort(开空条件 and holding=0,10,thisclose);
end
你没有分清平多是sell,平空是sellshort
开多条件:=kj10>0 and ref(kj10,1)<0;//kj10是一个被赋予了2和-2的一组数据。
开空条件:=kj10<0 and ref(kj10,1)>0;
//交易系统
if (开多条件 or 开空条件) then begin
平空:SELLshort(开多条件 and holding<0,10,thisclose);
开多:buy(开多条件 and holding=0,10,thisclose);
平多:sell(开空条件 and holding>0,10,thisCLOSE);
开空:buyshort(开空条件 and holding=0,10,thisclose);
end
[此贴子已经被作者于2017-2-17 9:58:32编辑过]