通达信多头排列公式,要求改成“可以随机允许其中一条均线低于前一条均线”(如MA30<MA20,但其他不变)
原公式:MA(C,5)>=MA(C,10)ANDMA(C,10)>=MA(C,20)ANDMA(C,20)>=MA(C,30)ANDMA(C,30)>=MA(C,60)A...
原公式:MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
展开
3个回答
展开全部
{低前线}
TD5:=MA(C,5)<MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD10:=MA(C,5)>=MA(C,10) AND MA(C,10)<MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD20:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)<MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD60:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)<MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD90:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)<MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD120:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)<MA(C,120) AND MA(C,120)>=MA(C,250);
TD250:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)<MA(C,250);
XG:TD5 OR TD10 OR TD20 OR TD60 OR TD90 OR TD120 OR TD250;
TD5:=MA(C,5)<MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD10:=MA(C,5)>=MA(C,10) AND MA(C,10)<MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD20:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)<MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD60:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)<MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD90:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)<MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250);
TD120:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)<MA(C,120) AND MA(C,120)>=MA(C,250);
TD250:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)<MA(C,250);
XG:TD5 OR TD10 OR TD20 OR TD60 OR TD90 OR TD120 OR TD250;
更多追问追答
追问
兄弟,可否作小改善一下。
您公式中筛选出来的个股,基本符合要求,但有这样的情况,如其他均线均多头排列,只有MA250除外,但MA250有可能不仅在MA120以上,还在MA90\MA60\MA30等之上。
我想看您能否将公式改善一下,使例外的那条均线,仅仅只高于最相邻的那条均线,如刚刚那种情况,MA250只高于MA120,而不会再高于其他均线。其他均线仍为多头排列。
谢谢!改善后,会加分。
追答
对,再加一条线试试;哈,看到眼花缭乱:
{低前线}
TD5:=MA(C,5)=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250); TD10:=MA(C,5)>=MA(C,10) AND MA(C,10)=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250); TD20:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250); TD60:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)>=MA(C,250); TD90:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)=MA(C,120) AND MA(C,120)>=MA(C,250); TD120:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)=MA(C,250); TD250:=MA(C,5)>=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND MA(C,30)>=MA(C,60) AND MA(C,60)>=MA(C,90) AND MA(C,90)>=MA(C,120) AND MA(C,120)=MA(C,10) AND MA(C,10)>=MA(C,20) AND MA(C,20)>=MA(C,30) AND (MA(C,250)>MA(C,30) OR MA(C,250)>MA(C,60) OR MA(C,250)>MA(C,90) OR MA(C,250)>MA(C,120));
XG:TD5 OR TD10 OR TD20 OR TD60 OR TD90 OR TD120 OR TD250 OR TD250A;
展开全部
(MA(C,5)>=MA(C,10) + MA(C,10)>=MA(C,20) + MA(C,20)>=MA(C,30) + MA(C,30)>=MA(C,60) + MA(C,60)>=MA(C,90) + MA(C,90)>=MA(C,120) + MA(C,120)>=MA(C,250)) >=9;
这个没试过,手边没电脑。
或者,下面这个应该行。
TT1=if(ma(c,5)>=ma(c,10),1,0);
.
.
.
TT7=if(ma(c,120)>=ma(c,250),1,0);
(tt1+tt2+tt3+tt4+tt5+tt6+tt7)>=9;
这个没试过,手边没电脑。
或者,下面这个应该行。
TT1=if(ma(c,5)>=ma(c,10),1,0);
.
.
.
TT7=if(ma(c,120)>=ma(c,250),1,0);
(tt1+tt2+tt3+tt4+tt5+tt6+tt7)>=9;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可以做,不过要10多组代码的老兄!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询