求高手帮忙将通达信一个指标公式改写成条件选股公式以及预警条件(提示突袭和全仓杀各一个)感激不尽!

F:=100*(C-REF(C,1))/REF(C,1);
今小昨:=IF(C<REF(O,1) AND F<0,1,0);
S1:=今小昨;
今小前:=IF(C<REF(O,2) AND F<0,1,0),LINETHICK0;
S2:=今小前;
A1:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,3) ,REF(ZIG(3 ,3),1));
A2:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,5) ,REF(ZIG(3 ,5),1));
A3:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1));
STICKLINE(A1 AND A2 ,0,3,3,0)COLORGREEN;
STICKLINE(A1 AND A2 ,0,1,3,0)COLORBLUE;
STICKLINE(A1 AND A2 AND A3,0,5,3,0)COLORYELLOW;
STICKLINE(A1 AND A2 AND A3,0,3,3,0)COLORFF00FF;
STICKLINE(A1 AND A2 AND A3,0,1,3,0)COLORBLUE;
DRAWTEXT(A3=1,3.8,'☆全仓杀入'),COLORYELLOW;
智勇出击: ZIG(3,6)>REF(ZIG(3,6),1)AND REF(ZIG(3,6),1)<REF(ZIG
(3,6),2),COLORWHITE,LINETHICK2;
DRAWTEXT(智勇出击=1,0.8,'突袭!'),COLORWHITE;
小获且退: ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG
(3,10),2),COLORYELLOW,LINETHICK2;
DRAWTEXT(小获且退=1,1.3,'撤退!'),COLORYELLOW;
VAR3:=PEAKBARS(3,15,1)<10;
VAR5:=IF(VAR3=1,2,0);
顶:= IF(VAR5=2,2,0);
大胜且归:IF(顶>REF(顶,1),2,0),COLORRED,LINETHICK2;
DRAWTEXT(大胜且归=2,2,'将大跌逢高清跌完再买!'),COLORGREEN;
VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;
VAR400:=EMA(VAR300,5);
操盘:=3*VAR300-2*VAR400;
A4:=CROSS(操盘,VAR300) AND VAR300<2.1 AND C>O;
DRAWTEXT(A4,0.2.1,'关注'),COLORYELLOW;
选底:TROUGHBARS(3,15,1)<4,NODRAW;
DRAWTEXT(FILTER(选底=1,3),0.2,'准备抄底'),COLOR00FF00;
出★逢低买:CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1)) ;
DRAWTEXT(出★逢低买>0,2,'☆逢低买');

第1个回答  2012-02-12
F:=100*(C-REF(C,1))/REF(C,1);
今小昨:=IF(C<REF(O,1) AND F<0,1,0);
S1:=今小昨;
今小前:=IF(C<REF(O,2) AND F<0,1,0);
S2:=今小前;
A3:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1));
全仓杀:A3;

突袭:ZIG(3,6)>REF(ZIG(3,6),1)AND REF(ZIG(3,6),1)<REF(ZIG(3,6),2);
{两个选股全是用未来函数选的,建议谨慎使用,只可用做辅助}追问

未来函数?请赐教一二,不胜感激!

追答

请看ZIG函数的原理:
之字转向.
用法:
ZIG(K,N),当价格变化量超过N%时转向,K表示0:开盘价,1:最高价,2:最低价,3:收盘价,其余:数组信息
例如:ZIG(3,5)表示收盘价的5%的ZIG转向

本回答被提问者采纳
第2个回答  2012-02-12

太准确了,有未来呀,建议不要用

追问

请详述一二,为何建议不要用?多谢

第3个回答  2012-02-12
{1.}F:=100*(C-REF(C,1))/REF(C,1);
今小昨:=IF(C<REF(O,1) AND F<0,1,0); S1:=今小昨;
今小前:=IF(C<REF(O,2) AND F<0,1,0),LINETHICK0; S2:=今小前;
A3:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1
AND CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1));
全仓:=DRAWTEXT(A3=1,3.8,'☆全仓杀入');
智勇出击:=ZIG(3,6)>REF(ZIG(3,6),1)AND REF(ZIG(3,6),1)<REF(ZIG(3,6),2);
突袭:=智勇出击=1,0.8;
XG: 突袭;
{2.}F:=100*(C-REF(C,1))/REF(C,1);
今小昨:=IF(C<REF(O,1) AND F<0,1,0); S1:=今小昨;
今小前:=IF(C<REF(O,2) AND F<0,1,0),LINETHICK0; S2:=今小前;
A3:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1
AND CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1));
全仓:=DRAWTEXT(A3=1,3.8,'☆全仓杀入');
XG:全仓;
公式含有未来函数。{个人看法,仅供参考。}追问

未来函数不太理解,请赐教?多谢

第4个回答  2012-02-12
F:=100*(C-REF(C,1))/REF(C,1);
今小昨:=IF(C<REF(O,1) AND F<0,1,0);
S1:=今小昨;
今小前:=IF(C<REF(O,2) AND F<0,1,0),LINETHICK0;
S2:=今小前;
A1:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,3) ,REF(ZIG(3 ,3),1));
A2:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,5) ,REF(ZIG(3 ,5),1));
A3:=S1=0 AND REF(S1,1)=1 AND S2=0 AND REF(S2,1)=1 AND CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1));

智勇出击:= ZIG(3,6)>REF(ZIG(3,6),1)AND REF(ZIG(3,6),1)<REF(ZIG
(3,6),2),COLORWHITE,LINETHICK2;

XG:A3=1 AND 智勇出击=1;
第5个回答  2012-02-25
有未来函数,是马后炮,明天就不同。
相似回答