Rss & SiteMap

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

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

标题:平仓反手不在同一K?

1楼
系统使用者 发表于:2017/5/16 14:10:43
if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin
   sellshort(1,ss,LIMITR,O);
   buy(holding=0,ss,LIMITR,O);
end
多止:valuewhen(enterbars=1,llv(fl,2)),NODRAW;
if enterbars>1 and min(o,c)<=多止-2*MINDIFF then sell(1,ss,marketr);
if holding>0 and ((enterbars>1 and pdd=-1) or (enterbars>15 and aspect=1)) then sell(1,ss,marketr);


if ref((tmpk=-1 or (count(bi=1,2)=1 and aq1>=1)) and (gpk1 or gpk2),1) then begin
   sell(1,ss,LIMITR,O);
   buyshort(holding=0,ss,LIMITR,O);
end 
空止:valuewhen(enterbars=1,hhv(fh,2)),NODRAW;
if enterbars>1 and max(o,c)>=空止+2*MINDIFF then sellshort(1,ss,marketr);
if holding<0 and ((enterbars>1 and pkk=1) or (enterbars>15 and aspect=0)) then sellshort(1,ss,marketr); 

请帮忙看看
2楼
wenarm 发表于:2017/5/16 14:36:58
具体说明下你的问题
3楼
系统使用者 发表于:2017/5/16 16:59:55
反手的,平与开不在同一个K上

[此贴子已经被作者于2017/5/16 17:01:44编辑过]
4楼
系统使用者 发表于:2017/5/16 17:07:35
平仓在前一K线,开仓在次K上 。上面语言哪里出问题?
5楼
wenarm 发表于:2017/5/16 17:19:37
if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin
   sellshort(1,ss,LIMITR,O);
   buy(holding=0,ss,LIMITR,O);
end
平仓反手在图表中,是同时进行的,也就是说在执行sellshort和buy是使用的同一个holding的状态值,所以在平仓后就会造成buy(holding=0,...)条件不满足,。也就是你看到的现象
你可以改成
 sellshort(1,holding,LIMITR,O);
   buy(1,ss,LIMITR,O);
6楼
系统使用者 发表于:2017/5/17 11:53:17
sellshort(1,holding,LIMITR,O);
   buy(1,ss,LIMITR,O);
这样会出现连续开多
7楼
pyd 发表于:2017/5/17 12:06:44

加上holding=0

buy(1 and holding=0,ss,LIMITR,O);

8楼
wenarm 发表于:2017/5/17 12:24:36

抱歉前面5楼的解释不对,把实际下单的状态和图表混了。你贴出的完整的平仓反手条件。

sellshort(1,holding,LIMITR,O);

   buy(holding=0,ss,LIMITR,O);
或者在
if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) and holding<=0 then begin
共8 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.