平仓反手不在同一K? [金字塔]
- 
						咨询内容:
						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);
 请帮忙看看
- 
						金字塔客服:
	
	具体说明下你的问题
	
来源:程序化久久网( WWW.CXH99.COM ) 
- 
						用户回复:
	
	反手的,平与开不在同一个K上
 [此贴子已经被作者于2017/5/16 17:01:44编辑过]
- 
						网友回复:
	
	平仓在前一K线,开仓在次K上 。上面语言哪里出问题?
	
- 网友回复: 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);
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198  进行 有偿 编写!(不贵!点击查看价格!)
                        
相关文章
- 
                        没有相关内容
                       

 
                     会员登录/注册
会员登录/注册