enterprice在固定时间间隔模式下,取的是当根K先的收盘价还是真正的信号出现时的价格,在实盘中好像是当根K线的收盘价,我需要信号出现时的真正开仓价,用什么函数?
图表里面获取不了实际的开仓价,enterprice获取的是信号价格
//交易系统
variable:bj=0;
if bj=0 and holding=0 and 开多条件 then begin
buy(1,1,THISCLOSE);
bj:=1;
end
if bj=0 and holding=0 and 开空条件 then begin
buyshort(1,1,THISCLOSE);
bj:=1;
end
if bj=1 and holding=0 and 开多条件 and exitbars>0 then begin
buy(1,1,THISCLOSE);
end
if bj=1 and holding=0 and 开空条件 and exitbars>0 then begin
buyshort(1,1,THISCLOSE);
end
if 平多条件 and holding>0 and enterbars>0 then sell(1,1,THISCLOSE);
if 平空条件 and holding<0 and enterbars>0 then sellshort(1,1,THISCLOSE);
那么就是获取不了,你用的是thisclose,获取的只能是当根k线的收盘价