我想在发出信号的当根K线最后一秒开平仓,当日14点58分平仓。我使用5,15分钟周期做日内的,请问老师这么表达对吗?
zq:=15;
tq:=1;
opentm:=openminutes(dynainfo(207));
lastopentm:=if(date<>ref(date,1),0,ref(openminutes(time),1));
abb:=(mod(currenttime,100)>=60-tq and islastbar and (opentm-lastopentm=zq-1 or time=091500 or time=093000 or time=094500 or time=100000 or time=101500 or time=104500 or time=110000 or time=111500 or time=113000 or time=134500 or time=140000 or time=141500 or time=143000 or time=144500 or time=150000)) or not(islastbar);
ENTERLONG:c>ma(c,60) and time<141300 and abb,TFILTER;
EXITLONG:c<ma(c,60) and abb or time>=145800 and abb,TFILTER;
ENTERSHORT:c<ma(c,60) and time<141300 and abb,TFILTER;
EXITSHORT:c>ma(c,60) and time<141300 and abb or time>=145800 and abb,TFILTER;
谢谢!
启动程序化界面“走完一根K线以后”后面有个按钮,可以设置成提前1秒下单,即可!
如果不设置这里,默认是下根K线一开始来给你下单的
2楼说的功能,需要专业版本.
http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=9006&page=0&star=1该帖子里说的方法,标准版既可实现.
TIME是取的周期时间,5分钟和15分钟周期是,是看不到145800 OR 141300这两个时间的
想收盘前2分钟直接平仓,可使用"交易--下单设置--止损止赢"里,勾选'收盘前 分钟...平仓'
zq:=15;
tq:=1;
opentm:=openminutes(dynainfo(207));
lastopentm:=if(date<>ref(date,1),0,ref(openminutes(time),1));
abb:=(mod(currenttime,100)>=60-tq and islastbar and (opentm-lastopentm=zq-1 or time=091500 or time=093000 or time=094500 or time=100000 or time=101500 or time=104500 or time=110000 or time=111500 or time=113000 or time=134500 or time=140000 or time=141500 or time=143000 or time=144500 or time=150000)) or not(islastbar);
ENTERLONG:c>ma(c,60) and time<141500 and abb,TFILTER;
EXITLONG:c<ma(c,60) and time<141500 and abb ,TFILTER;
ENTERSHORT:c<ma(c,60) and time<141500 and abb,TFILTER;
EXITSHORT:c>ma(c,60) and time<141500 and abb ,TFILTER;
当根K线结束前1秒开平仓这么写对吗?谢谢!
开仓里你加个 time<141500 是为了限制开仓时间.
平仓里你也加这个条件,那这几个时间上的就都不会平仓了time=141500 or time=143000 or time=144500 or time=150000
您可以仔细想想,在您的开平仓语句中,加了and time<141500 后,会有什么样的可能.再决定加不加这样一个时间限制