上涨趋势画线公式 指标 选股 源码[大智慧公式]
这个指标的具体思路是利用多个移动平均线和MACD指标来判断股票的趋势和买卖信号。其中,cxh6和cxh9分别是最大和最小的移动平均线,cxh10和cxh11分别是MACD的快线和慢线。1
一个可能的操作建议是:
当股价上穿cxh6并且cxh10上穿cxh11时,表示股票处于上涨趋势,可以考虑买入或持有。
当股价下穿cxh9并且cxh10下穿cxh11时,表示股票处于下跌趋势,可以考虑卖出或空仓。
当股价在cxh6和cxh9之间波动时,表示股票处于震荡区间,可以考虑观望或短线操作。
input: k(2,0,2),n(10,1,255),p1(3,1,255);
BBI:(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,pointdot,COLORFFFFFF;
BBI2:BBI+3*STD(BBI,10),pointdot,COLORmagenta;
BBI3:BBI-3*STD(BBI,10),pointdot,COLORblue;
B1:=MA(C,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1) ;
SMA2:=MA(B2,3) ;
FILLRGN(b2,sma2,b2>sma2),colorred;
FILLRGN(b2,sma2,b2<sma2),COLORGREEN;{http://www.cxh99.com}
cxh9Q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3))
or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1)
or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
红持:cxh9Q,color0000ff,LINETHICK0;
cxhaQ:=c=hhv(c,4) and ref(c,1)=llv(c,4);
粉变:cxhaQ,colorff99ff,LINETHICK0;
cxhbQ:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3))
or ref(c,1)=llv(c,4) and c<ref(c,2)
or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c<ref(c,1)
or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
灰跌:cxhbQ,color888888,LINETHICK0;
cxhcQ:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
绿买:cxhcQ,color00ff00,LINETHICK0;
cxhdQ:=ref(c,1)=hhv(c,4) and c<ref(c,2)
or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3)
or ref(c,3)=hhv(c,4) and ref(c,1)>ref(c,2))
and ref(c,2)>=ref(c,4) and c<ref(c,1);
蓝抛:cxhdQ,colorff9900,LINETHICK0;
if DATATYPE>1 then begin;
xxx1:=(CLOSE+LOW+H)/3;
xxx2:EMA(xxx1,6),colorFFFFFF,linethick1;
xxx3:EMA(xxx2,5),color00FFFF,linethick1;
cxh1111:=BACKSET(REF(H,2)=HHV(H,5),3);
cxh2222:=CROSS(cxh1111,0.9);
cxh3333:=BACKSET(REF(L,2)=LLV(L,5),3);
cxh4444:=CROSS(cxh3333,0.9);
压力: REF(H,BARSLAST(cxh2222)), POINTDOT,ColorEA91B5;
STICKLINE(C,REF(H,BARSLAST(cxh2222)),REF(H,BARSLAST(cxh2222)),5,0),ColorEA91B5;
支撑: REF(L,BARSLAST(cxh4444)), POINTDOT,Color00b4ff;
STICKLINE(C,REF(L,BARSLAST(cxh4444)),REF(L,BARSLAST(cxh4444)),5,0),Color00b4ff;
下档线:=(((C - LLV(L,13)) / (HHV(H,13) - LLV(L,13))) * 100);
aRSV:=SMA(下档线,3,1);
aK:=SMA(aRSV,3,1);
aD:=((3 * aRSV) - (2 * aK));
aJ12:=(((C - LLV(L,55)) / (HHV(H,55) - LLV(L,55))) * 100);
aRSV24:=SMA(aJ12,3,1);
aK24:=SMA(aRSV24,3,1);
aD24:=((3 * aRSV24) - (2 * aK24));
撑压位:=IF(CROSS(aD24,aD),H,REF(H,BARSLAST(CROSS(aD24,aD)))){,LINETHICK2,COLORFFFFFF};
底:=LLV(H,30){,COLOR00FF00,LINETHICK2};
STICKLINE(BARSTATUS=2 ,撑压位,撑压位,30,1),LINETHICK1,COLORFFFFFF;
DRAWTEXT(BARSTATUS=2 ,撑压位,' 撑压'),COLORFFFFFF,VALIGN1;
STICKLINE(BARSTATUS=2 ,底,底,30,1),COLOR00FF00,LINETHICK1;
DRAWTEXT(BARSTATUS=2 ,底,' 底线'),COLOR00FF00,VALIGN0;
END;
STICKLINE(C>O,O,L,0.5,0 ),COLOR0000FF;
STICKLINE(C>O,C,H,0.5 ,0 ),COLOR0000FF;
STICKLINE(O>=C,C,L,0.5 ,0 ),COLOR00FF00;
STICKLINE(O>=C,O,H,0.5 ,0 ),COLOR00FF00;
STICKLINE(O>=C ,C ,O,7,0 ),COLORff7700;
STICKLINE(O>=C ,C ,O,6,0 ),COLORff9900;
STICKLINE(O>=C ,C ,O,5,0 ),COLORffbb00;
STICKLINE(O>=C ,C ,O,4,0 ),COLORffcc00;
STICKLINE(O>=C ,C ,O,3,0 ),COLORffdd00;
STICKLINE(O>=C ,C ,O,2,0 ),COLORffee00;
STICKLINE(O>=C ,C ,O,1,0 ),COLORffFF00;
STICKLINE(C>O,C,O,7,0) ,COLOR000055;
STICKLINE(C>O,C,O,6,0) ,COLOR000066;
STICKLINE(C>O,C,O,5,0) ,COLOR000077;
STICKLINE(C>O,C,O,4,0) ,COLOR000099;
STICKLINE(C>O,C,O,3,0) ,COLOR0000bb;
STICKLINE(C>O,C,O,2,0) ,COLOR0000dd;
STICKLINE(C>O,C,O,1,0) ,COLOR0000ff;
stickline(cxh9Q,c,(o+c)/2,7,0),color000077;
stickline(cxh9Q,c,(o+c)/2,6,0),color000088;
stickline(cxh9Q,c,(o+c)/2,5,0),color0000aa;
stickline(cxh9Q,c,(o+c)/2,4,0),color0000cc;
stickline(cxh9Q,c,(o+c)/2,2,0),color0000ff;
stickline(cxh9Q,c,(o+c)/2,0,0),COLORffffff;
stickline(cxhaQ,c,(o+c)/2,7,0),colorff11ff;
stickline(cxhaQ,c,(o+c)/2,6,0),colorff33ff;
stickline(cxhaQ,c,(o+c)/2,5,0),colorff55ff;
stickline(cxhaQ,c,(o+c)/2,4,0),colorff77ff;
stickline(cxhaQ,c,(o+c)/2,3,0),colorff99ff;
stickline(cxhaQ,c,(o+c)/2,2,0),colorffbbff;
stickline(cxhaQ,c,(o+c)/2,1,0),colorffddff;
stickline(cxhbQ,c,(o+c)/2,7,0),color333333;
stickline(cxhbQ,c,(o+c)/2,6,0),color555555;
stickline(cxhbQ,c,(o+c)/2,5,0),color777777;
stickline(cxhbQ,c,(o+c)/2,4,0),color999999;
stickline(cxhbQ,c,(o+c)/2,3,0),colorbbbbbb;
stickline(cxhbQ,c,(o+c)/2,2,0),colordddddd;
stickline(cxhbQ,c,(o+c)/2,1,0),colorffffff;
stickline(cxhcQ,o,(o+c)/2,7,0),color003300;
stickline(cxhcQ,o,(o+c)/2,6,0),color005500;
stickline(cxhcQ,o,(o+c)/2,5,0),color007700;
stickline(cxhcQ,o,(o+c)/2,4,0),color009900;
stickline(cxhcQ,o,(o+c)/2,3,0),color00bb00;
stickline(cxhcQ,o,(o+c)/2,2,0),color00dd00;
stickline(cxhcQ,o,(o+c)/2,1,0),color00ff00;
stickline(cxhdQ,o,(o+c)/2,7,0),colorff1100;
stickline(cxhdQ,o,(o+c)/2,6,0),colorff3300;
stickline(cxhdQ,o,(o+c)/2,5,0),colorff5500;
stickline(cxhdQ,o,(o+c)/2,4,0),colorff7700;
stickline(cxhdQ,o,(o+c)/2,3,0),colorff9900;
stickline(cxhdQ,o,(o+c)/2,2,0),colorffbb00;
stickline(cxhdQ,o,(o+c)/2,1,0),colorffdd00;
V7:=BARSTATUS=2;
V8:=(REF(H,n) = HHV(H,((2 * n) + 1)));
V9:=FILTER(V8,n);
VA:=BACKSET(V9,(n + 1));
VB:=FILTER(VA,n);
VC:=(VB OR V7);
VD:=(REF(L,n) = LLV(L,((2 * n) + 1)));
VE:=FILTER(VD,n);
VF:=BACKSET(VE,(n + 1));
V10:=FILTER(VF,n);
V11:=(V10 AND NOT(VB));
V12:=BACKSET(VC,(REF(BARSLAST(V11),1) + 1));
V13:=(V12 > REF(V12,1));
V14:=BACKSET(V13,2);
V15:=(V14 > REF(V14,1));
V16:=BACKSET((V15 AND (COUNT(VC,(REF(BARSLAST(V11),1) + 2)) = 0)),(REF(BARSLAST(V11),1) + 2));
V17:=(V16 > REF(V16,1));
V18:=BACKSET((V17 AND (COUNT(VC,(REF(BARSLAST(V11),1) + 2)) = 0)),(REF(BARSLAST(V11),1) + 2));
V19:=(V18 > REF(V18,1));
V1A:=IF(VC,COUNT(V11,(REF(BARSLAST(VC),1) + 1)),0);
V1B:=IF(((V1A = 1) AND VC),BARSLAST(V15),0);
V1C:=IF((VC AND (REF(L,BARSLAST(V15)) >= REF(L,BARSLAST(V17)))),BARSLAST(V17),BARSLAST(V15));
V1D:=IF(((V1A = 2) AND VC),V1C,0);
V1E:=IF(((V1A >= 3) AND VC),IF((VC AND (REF(L,V1C) >= REF(L,BARSLAST(V19)))),BARSLAST(V19),V1C),0);
V1F:=((V1B + V1D) + V1E);<{程序化交易 www.cxh99.com }
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容