如何表示下列:
前5中只有1K为反向(且该K实体不大于1),也可5K都为顺向(同为阳或同为阴)
且为阳时每1K收盘大于上1K收盘超过0.4(不含反向K)
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);
谢谢
1.如何在上述条件上加上:符合该各条件的第一K必需为开仓后(或平仓后)最高点(或低点)的下1K
2.如何表达:该条件4K内有效
还有什么 条件一起讲,
写代码不是你认为的在原有的基础上修修改改,思路不一样,有时候要重写
不好意思
暂时就这些了
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周期之内计算其他信息?
2.什么叫有效?4周期内条件成立?在成立的后4周期之内计算其他信息?
4周期内在原开平条件的基础上点减1点,超过4周期不减
例如:原条件为开后最高点跌6点平多
4周期内出现上述条件改为跌5点平,超过4周期维持6点平
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);