Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共8 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]请问老师提前平仓的问题

1楼
战争魔鬼 发表于:2012/1/8 11:58:32

我想在发出信号的当根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;

谢谢!

2楼
董小球 发表于:2012/1/9 9:01:45

启动程序化界面“走完一根K线以后”后面有个按钮,可以设置成提前1秒下单,即可!

如果不设置这里,默认是下根K线一开始来给你下单的

3楼
fly 发表于:2012/1/9 9:14:52

2楼说的功能,需要专业版本.

 

http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=9006&page=0&star=1该帖子里说的方法,标准版既可实现.

 

4楼
战争魔鬼 发表于:2012/1/9 9:23:36
请告诉我我写的对吗,我就是参照这个帖子编的。
5楼
fly 发表于:2012/1/9 10:59:19

TIME是取的周期时间,5分钟和15分钟周期是,是看不到145800 OR 141300这两个时间的

 

想收盘前2分钟直接平仓,可使用"交易--下单设置--止损止赢"里,勾选'收盘前 分钟...平仓'

6楼
战争魔鬼 发表于:2012/1/9 11:31:29

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秒开平仓这么写对吗?谢谢!

7楼
fly 发表于:2012/1/9 13:35:25

开仓里你加个 time<141500 是为了限制开仓时间.

平仓里你也加这个条件,那这几个时间上的就都不会平仓了time=141500 or time=143000 or time=144500 or time=150000

 

您可以仔细想想,在您的开平仓语句中,加了and time<141500  后,会有什么样的可能.再决定加不加这样一个时间限制

8楼
wd369 发表于:2012/1/9 16:06:40

 

代码中预设的zq:=2;//N分钟周期,3分钟就填3 ,5分钟就填5

 

建议: 可以利用datatype动态设置. 例子: if datetype=2 then  zq:=5 //5分钟就填5


共8 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02344 s, 2 queries.