您现在的位置:程序化交易>> 股票公式>> 通达信>> 通达信公式>>正文内容

通达信双龙出海升级版主图指标公式源码[通达信公式]

通达信双龙出海升级版主图指标公式源码首先,定义V1为收盘价与20日均线的相对偏离程度。
然后,定义V2和V3为收盘价的动态移动平均线,分别加减7%作为托压线。
然后,计算托压线在日期轴上的位置,并用紫色和绿色粗实线显示在主图上。
接着,定义cxh1到cxh19为九转十八转形态的判断条件,即根据连续K线之间的涨跌关系来判断是否出现九转或十八转。
然后,在主图上用黄色图标标记出九转形态(即由下跌趋势转为上升趋势)。
最后,在主图上用绿色图标标记出十八转形态(即由上升趋势转为下跌趋势)。
操作建议如下:
 
当股价突破托压线,并且出现九转形态时,表示股价开始进入上升通道,可以考虑买入或持股待涨。
当股价跌破托压线,并且出现十八转形态时,表示股价开始进入下降通道,可以考虑卖出或观望止损。
 
 
V1:=ABS((2*C+H+L)/4-MA(C,20))/MA(C,20);
V2:=(1-7/100)*(DMA(C,V1));
V3:=(1+7/100)*(DMA(C,V1));
V5:=MA((L+H+C)/3,5);
托:REFDATE(V2,DATE),LINETHICK2,COLORCC66FF;
压:REFDATE(V3,DATE),LINETHICK2,COLORGREEN;
cxh1:=C>REF(C,1) AND C>REF(C,2);
cxh2:=REF(cxh1,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh3:=REF(cxh2,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh4:=REF(cxh3,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh5:=REF(cxh4,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh6:=REF(cxh5,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh7:=REF(cxh6,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh8:=REF(cxh7,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh9:=REF(cxh8,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxhA:=REF(cxh9,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxhB:=REF(cxhA,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxhC:=REF(cxhB,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxhD:=C<REF(C,1) AND C<REF(C,2);
cxhE:=REF(cxhD,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxhF:=REF(cxhE,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh10:=REF(cxhF,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh11:=REF(cxh10,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh12:=REF(cxh11,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh13:=REF(cxh12,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh14:=REF(cxh13,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh15:=REF(cxh14,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh16:=REF(cxh15,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh17:=REF(cxh16,1) AND C<=REF(C,1) AND C>=REF(C,2);
cxh18:=REF(cxh17,1) AND C>=REF(C,1) AND C<=REF(C,2);
cxh19:=REF(cxhD OR cxhE OR cxhF OR cxh10 OR cxh11 OR cxh12 OR cxh13 ORcxh14 OR cxh15 OR cxh16 OR cxh17 OR cxh18,1) AND cxh1;
DRAWICON(cxh19,L*0.98,38),COLORYELLOW;
cxh1A:=REF(cxh1 OR cxh2 OR cxh3 OR cxh4 OR cxh5 OR cxh6 OR cxh7 ORcxh8 OR cxh9 OR cxhA OR cxhB OR cxhC,1) AND cxhD;
DRAWICON(cxh1A,H*1.01,39),COLOR00FF00{98FD};
MA3:MA(CLOSE,3);
MA5:MA(CLOSE,5),COLORWHITE;
MA10:=MA(CLOSE,10),NODRAW;
MA30:MA(CLOSE,34),NODRAW;
五日乖离率:=(CLOSE-MA5)/MA5*100;
BB5:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416;
IF(BB5>30 AND MA5>REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORRED;
BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;
IF(BB5<0 AND MA5<REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORGREEN;
DD5:=MA5<REF(MA5,1);
IF(DD5,MA5,DRAWNULL),COLOR00FF00;
X:=(3*C+LOW+OPEN+H)/6;
海平面:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+REF(X,20))/210,COLORFFFF00,LINETHICK2;
{用法:黄托底买进,绿压顶买出。}DD:=海平面<REF(海平面,1);
IF(DD,海平面,DRAWNULL),COLORBLUE,LINETHICK2;
A:=(MA5>海平面);
IF(A,海平面,DRAWNULL),COLORYELLOW,POINTDOT;
A1:=(MA5<海平面);
IF(A1,海平面,DRAWNULL),COLORWHITE;
A2:=3*EMA((CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,5)-2*EMA((CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,5);
A4:=(HHV(HIGH,34)-C)/(HHV(HIGH,34)-LLV(LOW,34))*100;
A5:=EMA(C,12)-EMA(C,26);
A6:=EMA(A5,9);
A7:=(A5<-0.1 AND A5>A6);
龙王:IF(A7,LLV(LOW,21),DRAWNULL)COLORRED,CIRCLEDOT;
CYS:=(EMA((C-V2)/V2,1)*100);
AA:=CYS;
MIDD:=MA(CYS,20);
CC:=MIDD+0.85*STD(CYS,10);
TM6:=AA>CC;
IF(TM6,MA5,DRAWNULL),COLORRED,LINETHICK1;
A0:=(LOW+HIGH+C*2)/4;
工作:=EMA(A0,14)COLORYELLOW,LINETHICK1;
度假:=EMA(A0,25)COLORYELLOW,LINETHICK1;
A1X:=(工作-REF(工作,1))/REF(工作,1)*100;
A2X:=(度假-REF(度假,1))/REF(度假,1)*100;
G:=BARSLAST(CROSS(A1X,0));
{KDJ}RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
金叉:=CROSS(J,D);
死叉:=CROSS(D,J);
买1:=(cxh14 OR cxh15) AND cxh11;
买2:=(cxh14 OR cxh15) AND cxh4;
买3:=(cxh14 OR cxh15) AND cxh2;
买4:=(cxh2 AND cxh11) OR (cxh4 AND cxh11);
买5:=(金叉 AND cxh4) OR (金叉 AND cxh2) OR (金叉 AND cxh11);
{涨停}STICKLINE(C>REF(C,1)*1.0985 AND C=H,C,O,4,-1),COLOR00FFFF;
{跌停}STICKLINE(C<REF(C,1)*0.9015 AND C=L,C,O,4,-1),COLORGREEN;
{蓝}STICKLINE(O>=C,C,O,3,0),COLORFF7700;
STICKLINE(O>=C,C,O,2.2,0),COLORFF9900;
STICKLINE(O>=C,C,O,1.5,0),COLORFFBB00;
STICKLINE(O>=C,C,O,0.5,0),COLORCYAN;
{程序化交易 WWW.CXH99.COM }
 

 

{程序化交易 www.cxh99.com }

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容