以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请教一下  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=69638)

--  作者:aliyun
--  发布时间:2014/9/5 13:24:13
--  请教一下

如何表示下列:

前5中只有1K为反向(且该K实体不大于1),也可5K都为顺向(同为阳或同为阴)

且为阳时每1K收盘大于上1K收盘超过0.4(不含反向K)


--  作者:jinzhe
--  发布时间:2014/9/5 13:33:58
--  

nn1:=ref(sumbars(c<o,1),1);

nn2:=ref(sumbars(c>o,1),1);

ref(count(c>o,5),1)=4 and ref(count(c<o,5),1)=1 and ref(ref(abs(c-o)<=1,nn1),1) or

ref(count(c>o,5),1)=1 and ref(count(c<o,5),1)=4 and ref(ref(abs(c-o)<=1,nn2),1) or

ref(all(c<o,5),1) or

ref(all(c>o,5),1) and ref(all(close>ref(close,1)>0.4,5),1);


--  作者:aliyun
--  发布时间:2014/9/5 14:06:51
--  

谢谢

1.如何在上述条件上加上:符合该各条件的第一K必需为开仓后(或平仓后)最高点(或低点)的下1K

2.如何表达:该条件4K内有效


--  作者:jinzhe
--  发布时间:2014/9/5 14:09:18
--  

还有什么 条件一起讲,

写代码不是你认为的在原有的基础上修修改改,思路不一样,有时候要重写


--  作者:aliyun
--  发布时间:2014/9/5 14:13:26
--  

不好意思

暂时就这些了


--  作者:jinzhe
--  发布时间:2014/9/5 14:56:10
--  

nn1:=ref(sumbars(c<o,1),1);

nn2:=ref(sumbars(c>o,1),1);

cond:=ref(count(c>o,5),1)=4 and ref(count(c<o,5),1)=1 and ref(ref(abs(c-o)<=1,nn1),1) or

ref(count(c>o,5),1)=1 and ref(count(c<o,5),1)=4 and ref(ref(abs(c-o)<=1,nn2),1) or

ref(all(c<o,5),1) or

ref(all(c>o,5),1) and ref(all(close>ref(close,1)>0.4,5),1);

 

1.cond and ref(h=hhv(h,enterbars+1),1) or cond and ref(h=hhv(h,eixtbars+1),1)  or cond and ref(l=llv(l,enterbars+1),1) or cond and ref(l=llv(l,exitbars+1),1)

 

2.什么叫有效?4周期内条件成立?在成立的后4周期之内计算其他信息?


--  作者:aliyun
--  发布时间:2014/9/5 15:02:32
--  

2.什么叫有效?4周期内条件成立?在成立的后4周期之内计算其他信息?

 

4周期内在原开平条件的基础上点减1点,超过4周期不减


--  作者:jinzhe
--  发布时间:2014/9/5 15:15:40
--  
什么东西减一?
--  作者:aliyun
--  发布时间:2014/9/5 15:23:42
--  

例如:原条件为开后最高点跌6点平多

4周期内出现上述条件改为跌5点平,超过4周期维持6点平


--  作者:jinzhe
--  发布时间:2014/9/5 15:43:17
--  

nn1:=ref(sumbars(c<o,1),1);

nn2:=ref(sumbars(c>o,1),1);

cond:=ref(count(c>o,5),1)=4 and ref(count(c<o,5),1)=1 and ref(ref(abs(c-o)<=1,nn1),1) or

ref(count(c>o,5),1)=1 and ref(count(c<o,5),1)=4 and ref(ref(abs(c-o)<=1,nn2),1) or

ref(all(c<o,5),1) or

ref(all(c>o,5),1) and ref(all(close>ref(close,1)>0.4,5),1);

 

cc:=cond and ref(h=hhv(h,enterbars+1),1) or cond and ref(h=hhv(h,eixtbars+1),1)  or cond and ref(l=llv(l,enterbars+1),1) or cond and ref(l=llv(l,exitbars+1),1);

if barslast(cc)+1<=4 and l<=hhv(h,enterbars+1)-5 then sell(1,0,market);