您现在的位置:程序化交易>> 股票公式>> 同花顺>> 同花顺公式>>正文内容

同花顺艺术通道主图公式代码源码[同花顺公式]

相关标签: expma金叉选股公式 、 通达信expma指标公式 、 expma四条线指标详解 、 expma指标的参数设置 、 通达信怎么添加expma 、 expma主图指标公式 、

 

 

原理解析:

DRAWGBKLAST(收盘价>0,STRIP(自定色,自定色,0))
输出//重心:(2*收盘价+最高价+最低价)/4的2日加权移动平均,COLOR00FFFF,线宽为0
输出UPPERS: 重心*(1+2.382/100),COLOR990099,LAYER0
输出LOWERS: 重心*(1-2.382/100),COLORFF0000,LAYER0
VAR2赋值:重心*成交量(手)
VAR3赋值:(VAR2的3日指数移动平均/成交量(手)的3日指数移动平均+VAR2的8日指数移动平均/成交量(手)的8日指数移动平均+VAR2的13日指数移动平均/成交量(手)的13日指数移动平均+VAR2的21日指数移动平均/成交量(手)的21日指数移动平均)/4
UP赋值:VAR3*1.0809
DN赋值:VAR3*0.9191
 
VAR4赋值:重心的19日指数移动平均
LUP赋值:VAR4*1.119的3日指数移动平均
LDN赋值:VAR4*0.881的3日指数移动平均
UPK赋值:UP-UPPERS
FILLRGN(UPPERS,UPPERS+UPK, UP>UPPERS,自定色),LAYER7
FILLRGN(UPPERS,UPPERS+UPK*0.8, UP>UPPERS,自定色),LAYER6
FILLRGN(UPPERS,UPPERS+UPK*0.6, UP>UPPERS,自定色),LAYER5
FILLRGN(UPPERS,UPPERS+UPK*0.5, UP>UPPERS,自定色),LAYER4
FILLRGN(UPPERS,UPPERS+UPK*0.4, UP>UPPERS,自定色),LAYER3
FILLRGN(UPPERS,UPPERS+UPK*0.2, UP>UPPERS,自定色),LAYER2
UPL赋值:LUP-UP
FILLRGN(UP,UP+UPL, UP<LUP,自定色),LAYER7
FILLRGN(UP,UP+UPL*0.8, UP<LUP,自定色),LAYER6
FILLRGN(UP,UP+UPL*0.6, UP<LUP,自定色),LAYER5
FILLRGN(UP,UP+UPL*0.5, UP<LUP,自定色),LAYER4
FILLRGN(UP,UP+UPL*0.4, UP<LUP,自定色),LAYER3
FILLRGN(UP,UP+UPL*0.2, UP<LUP,自定色),LAYER2
FILLRGN(UPPERS,LOWERS, LOWERS<UPPERS,自定色),LAYER7
UPD赋值:LOWERS-DN
FILLRGN(LOWERS,LOWERS-UPD, LOWERS>DN,自定色),LAYER7
FILLRGN(LOWERS,LOWERS-UPD*0.8, LOWERS>DN,自定色),LAYER6
FILLRGN(LOWERS,LOWERS-UPD*0.6, LOWERS>DN,自定色),LAYER5
FILLRGN(LOWERS,LOWERS-UPD*0.4, LOWERS>DN,自定色),LAYER4
FILLRGN(LOWERS,LOWERS-UPD*0.2, LOWERS>DN,自定色),LAYER3
FILLRGN(DN,DN-UPL, DN>LDN,自定色),LAYER7
UPL赋值:DN-LDN
FILLRGN(DN,DN-UPL*0.8, DN>LDN,自定色),LAYER6
FILLRGN(DN,DN-UPL*0.6, DN>LDN,自定色),LAYER5
FILLRGN(DN,DN-UPL*0.4, DN>LDN,自定色),LAYER4
FILLRGN(DN,DN-UPL*0.2, DN>LDN,自定色),LAYER3
输出//MA5:重心的5日加权移动平均,COLOR00FF00,DOTLINE,LAYER0
PARTLINE(MA5 ,(MA5>1日前的MA5),自定色 ),线宽为2,LAYER0
//当满足条件收盘价>OPENORCLOSE=OPENANDCLOSE>1日前的收盘价时,在最低价和最高价位置之间画柱状线,宽度为0.1,0不为0则画空心柱.,画红色,LAYER0
当满足条件收盘价>OPENORCLOSE=OPENANDCLOSE>1日前的收盘价时,在开盘价和收盘价位置之间画柱状线,宽度为0,0不为0则画空心柱.,画红色,LAYER0
当满足条件收盘价<OPENORCLOSE=OPENANDCLOSE<=1日前的收盘价时,在最低价和最高价位置之间画柱状线,宽度为0.1,0不为0则画空心柱.,画青色,LAYER0
当满足条件收盘价<OPENORCLOSE=OPENANDCLOSE<=1日前的收盘价时,在开盘价和收盘价位置之间画柱状线,宽度为0,0不为0则画空心柱.,画青色,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为8,0不为0则画空心柱.,COLOR008800,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为7,0不为0则画空心柱.,COLOR009900,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为6,0不为0则画空心柱.,COLOR00AA00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为5,0不为0则画空心柱.,COLOR00BB00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为4,0不为0则画空心柱.,COLOR00CC00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为3,0不为0则画空心柱.,COLOR00DD00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR00EE00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLOR00FF00,LAYER0
当满足条件开盘价>=收盘价时,在收盘价和开盘价位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLOR00FF00,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为8,0不为0则画空心柱. ,COLOR000066,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为7,0不为0则画空心柱. ,COLOR000088,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为6,0不为0则画空心柱. ,COLOR0000AA,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为5,0不为0则画空心柱. ,COLOR0000BB,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为4,0不为0则画空心柱. ,COLOR0000CC,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为3,0不为0则画空心柱. ,COLOR0000DD,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为2,0不为0则画空心柱. ,COLOR0000EE,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为1,0不为0则画空心柱. ,COLOR0000FF,LAYER0
当满足条件收阳线时,在收盘价和开盘价位置之间画柱状线,宽度为0,0不为0则画空心柱. ,COLOR0000FF,LAYER0
 

源码:

 

 

DRAWGBKLAST(C>0,STRIP(RGB(0,0,160),RGB(0,0,0),0));
//{内通道}
重心:WMA((2*C+H+L)/4,2),COLOR00FFFF,LINETHICK0;
UPPERS: 重心*(1+2.382/100),COLOR990099,LAYER0;
LOWERS: 重心*(1-2.382/100),COLORFF0000,LAYER0;
//{中通道}
VAR2:=重心*VOL;
Var3:=(EMA(Var2,3)/EMA(VOL,3)+EMA(Var2,8)/EMA(VOL,8)+EMA(Var2,13)/EMA(VOL,13)+EMA(Var2,21)/EMA(VOL,21))/4;
UP:=Var3*1.0809;
DN:=Var3*0.9191;;
//{外通道}
VAR4:=EMA(重心,19);
LUP:=EMA(VAR4*1.119,3);
LDN:=EMA(VAR4*0.881,3);
UPK:=UP-UPPERS;
FILLRGN(UPPERS,UPPERS+UPK, UP>UPPERS,RGB(230,0,50)),LAYER7;
FILLRGN(UPPERS,UPPERS+UPK*0.8, UP>UPPERS,RGB(220,0,180)),LAYER6;
FILLRGN(UPPERS,UPPERS+UPK*0.6, UP>UPPERS,RGB(200,0,150)),LAYER5;
FILLRGN(UPPERS,UPPERS+UPK*0.5, UP>UPPERS,RGB(180,0,100)),LAYER4;
FILLRGN(UPPERS,UPPERS+UPK*0.4, UP>UPPERS,RGB(150,0,180)),LAYER3;
FILLRGN(UPPERS,UPPERS+UPK*0.2, UP>UPPERS,RGB(120,0,50)),LAYER2;
UPL:=LUP-UP;
FILLRGN(UP,UP+UPL, UP<LUP,RGB(80,0,80)),LAYER7;
FILLRGN(UP,UP+UPL*0.8, UP<LUP,RGB(100,0,120)),LAYER6;
FILLRGN(UP,UP+UPL*0.6, UP<LUP,RGB(120,0,150)),LAYER5;
FILLRGN(UP,UP+UPL*0.5, UP<LUP,RGB(150,0,180)),LAYER4;
FILLRGN(UP,UP+UPL*0.4, UP<LUP,RGB(180,0,220)),LAYER3;
FILLRGN(UP,UP+UPL*0.2, UP<LUP,RGB(200,0,255)),LAYER2;
FILLRGN(UPPERS,LOWERS, LOWERS<UPPERS,RGB(40,30,20)),LAYER7;
UPD:=LOWERS-DN;
FILLRGN(LOWERS,LOWERS-UPD, LOWERS>DN,RGB(0,230,30)),LAYER7;
FILLRGN(LOWERS,LOWERS-UPD*0.8, LOWERS>DN,RGB(0,200,55)),LAYER6;
FILLRGN(LOWERS,LOWERS-UPD*0.6, LOWERS>DN,RGB(0,150,100)),LAYER5;
FILLRGN(LOWERS,LOWERS-UPD*0.4, LOWERS>DN,RGB(0,100,100)),LAYER4;
FILLRGN(LOWERS,LOWERS-UPD*0.2, LOWERS>DN,RGB(0,80,80)),LAYER3;
FILLRGN(DN,DN-UPL, DN>LDN,RGB(0,80,50)),LAYER7;
UPL:=DN-LDN;
FILLRGN(DN,DN-UPL*0.8, DN>LDN,RGB(0,100,80)),LAYER6;
FILLRGN(DN,DN-UPL*0.6, DN>LDN,RGB(0,120,100)),LAYER5;
FILLRGN(DN,DN-UPL*0.4, DN>LDN,RGB(0,150,150)),LAYER4;
FILLRGN(DN,DN-UPL*0.2, DN>LDN,RGB(0,180,180)),LAYER3;
//{红股.绿币的趋势线}
MA5:WMA(重心,5),COLOR00FF00,DOTLINE,LAYER0;
PARTLINE(MA5 ,(MA5>REF(MA5,1)),RGB(255,100,0) ),linethick2,LAYER0;
//{K线}
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND CLOSE>REF(CLOSE,1),LOW,HIGH,0.1,0),colorred,LAYER0;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND CLOSE>REF(CLOSE,1),OPEN,CLOSE,0,0),colorred,LAYER0;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND CLOSE<=REF(CLOSE,1),LOW,HIGH,0.1,0),colorcyan,LAYER0;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND CLOSE<=REF(CLOSE,1),OPEN,CLOSE,0,0),colorcyan,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,8,0 ),COLOR008800,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLOR009900,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLOR00AA00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLOR00BB00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLOR00CC00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLOR00DD00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00EE00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLOR00FF00,LAYER0;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00FF00,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0) ,COLOR000066,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000088,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR0000AA,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR0000BB,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR0000CC,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000DD,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000EE,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLOR0000FF,LAYER0;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLOR0000FF,LAYER0;{来源:www.cxh99.com 程序化交易}

 

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

 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 1145508240  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!

 


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

相关文章

    没有相关内容