macd背弛通达信指标公式源码

合集下载

自动画MACD背离线通达信指标公式源码

自动画MACD背离线通达信指标公式源码

自动画MACD背离的指标:一共两个指标,一个是通达信用的,一个是大智慧用的{通达信自动划MACD指标背离线}DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); STICKLINE(底背离,0,0.1,8,0),COLORRED;DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF); DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;{大智慧自动划MACD指标背离线(适用于大智慧新一代)}DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;A:=SUMBARS(CROSS(DEA,DIF),2);B:=SUMBARS(CROSS(DEA,DIF),1);E:=REF(DIF,LLVBARS(DIF,A))<REF(DIF,LLVBARS(DIF,B)) AND LLVBARS(DIF,B)<LLVBARS(DIF,A) ANDCROSS(DIF,DEA);F:=COUNT(BACKSET(E,LLVBARS(DIF,A)+1),LLVBARS(DIF,A)+1)=1; G:=COUNT(BACKSET(E,LLVBARS(DIF,B)+1),LLVBARS(DIF,B)+1)=1; DRAWLINE(F,DIF,G,DIF,0),COLOERED;。

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

好厉害的MACD背离(通达信副图指标)DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4; DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;。

MACD背离自动画线通达信指标公式源码

MACD背离自动画线通达信指标公式源码

MACD背离自动画线通达信指标公式源码MACD(Moving Average Convergence Divergence)是一种常用的股票技术指标,用于分析股票的趋势和交易信号。

MACD背离是一种常见的技术分析方法,用于判断趋势的反转点,即价格走势与MACD指标走势不一致的情况。

下面是使用通达信编写MACD背离自动画线指标的源码。

```c/*MACD背离自动画线指标*功能:自动识别MACD背离点并在图表中标注出来*/#include "stdafx.h"#include "stdio.h"#include "string.h"#include "windows.h"//确定最低点、最高点时使用的价格周期数#define MIN_PRICE_DURATION 9#define MAX_PRICE_DURATION 10/**输入参数:*MACD:一个包含MACD数据的数组* price:一个包含价格数据的数组*返回值:*0:没有背离*1:向上背离*-1:向下背离*/int CheckDivergence(float *MACD, float *price) int i, j, k;int start, end;int low_index, high_index;float min_price, max_price;int MACD_bottom, MACD_top;int price_bottom, price_top;float MACD_bottom_value, MACD_top_value;float price_bottom_value, price_top_value;/**阶段1:寻找MACD底背离*/start = MAX_PRICE_DURATION + 1;end = start + MIN_PRICE_DURATION;low_index = -1;high_index = -1;min_price = price[start];max_price = price[start];for (i = start; i < end; i++)//查找最低点if (price[i] < min_price)low_index = i;min_price = price[i];}//查找最高点if (price[i] > max_price)high_index = i;max_price = price[i];}}//无法找到底背离点if (low_index == -1 , high_index == -1)}MACD_bottom = 0;price_bottom = 0;//寻找MACD底背离for (i = start; i < end; i++)if (i == low_index)//找到最低点对应的MACD数值MACD_bottom = i;MACD_bottom_value = MACD[i];}if (i == high_index)//找到最高点对应的MACD数值price_bottom = i;price_bottom_value = price[i];}}//如果最低点出现在最高点之后,则没有底背离if (MACD_bottom > price_bottom)}/**阶段2:寻找MACD顶背离*/start = MAX_PRICE_DURATION + 1; end = start + MIN_PRICE_DURATION; low_index = -1;high_index = -1;min_price = price[start];max_price = price[start];for (i = start; i < end; i++)//查找最低点if (price[i] < min_price)low_index = i;min_price = price[i];}//查找最高点if (price[i] > max_price)max_price = price[i];}}//无法找到顶背离点if (low_index == -1 , high_index == -1) return 0;}MACD_top = 0;price_top = 0;//寻找MACD顶背离for (i = start; i < end; i++)if (i == low_index)//找到最低点对应的MACD数值MACD_top = i;MACD_top_value = MACD[i];}if (i == high_index)//找到最高点对应的MACD数值price_top_value = price[i];}}//如果最高点出现在最低点之后,则没有顶背离if (MACD_top > price_top)return 0;}//判断背离类型if (price_bottom_value < price_top_value && MACD_bottom_value > MACD_top_value)return 1; // 向上背离}if (price_bottom_value > price_top_value && MACD_bottom_value < MACD_top_value)return -1; // 向下背离}return 0;int mainfloat MACD[100] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 4.0, 3.0, 2.0, 1.0};float price[100] = {1.0, 2.0, 3.0, 4.0, 3.0, 2.0, 1.0, 0.0, -1.0, -2.0};int result = CheckDivergence(MACD, price);printf("Result: %d\n", result);return 0;```该源码实现了一个简单的MACD背离自动画线指标。

MACD顶底背离通达信指标公式源码

MACD顶底背离通达信指标公式源码

MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码
软件介绍
本公式在日线,小时线,半小时线等周期中根据MACD红柱的缩小都能及时给我们的操作做出风险提示,尤其是在短周期中提示更有效。

此公式不是万能的,还需要结合其他操盘指标才更有效。

DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
H1:=REF(MACD,1)&lt;0 AND MACD&gt;0,NODRAW;
H1T:=BARSLAST(H1)+1,NODRAW;
H2:=IF(MACD&gt;0,H1T,0),NODRAW;
H3:=HHV(MACD,H2),NODRAW;
L1:=REF(MACD,1)&gt;0 AND MACD&lt;0,NODRAW;
L1T:=BARSLAST(L1)+1,NODRAW;
HJ:=(H1T+L1T),NODRAW;
H4:=REF(H3,HJ),NODRAW;
顶背离:H3&lt;H4 AND C&gt;REF(C,HJ) AND MACD&gt;0 AND MACD&lt;REF(MACD,1),COLORGREEN,NODRAW; STICKLINE(顶背离,0,MACD,2,0),COLORGREEN;
下载地址。

通达信指标公式源码MACD、KDJ、RSI三合一

通达信指标公式源码MACD、KDJ、RSI三合一

DIFF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIFF,9),COLORYELLOW;MACD:2*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1)); B3:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1)); D3:=REF(C,C3+1)<C ANDREF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));{MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;}MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;{STICKLINE(B1>0,-0.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;}STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) ANDMACD>0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORCYAN; STICKLINE(MACD>=REF(MACD,1) ANDMACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED; NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA; VARA1:=(DVOL/C)/2,NODRAW;VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA3:=SUM(IF(VARA1>100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA4:=SUM(IF(VARA1<100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA5:=SUM(IF(VARA1<100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA6:=VARA2+VARA3+VARA4+VARA5;机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;主力差:=机买-机卖,LINETHICK2,NODRAW;强度:主力差-REF(主力差,1),NODRAW,COLORYELLOW;STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;N:=7{2,100};M:=5{2,100};VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;B:=SMA(VAR1,N,1);VAR2:=SMA(B,M,1);短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;DRAWICON(短买,0,1);。

MACD双背离通达信指标公式源码

MACD双背离通达信指标公式源码

macd双背离DIFF: EMA(CLOSE,12) - EMA(CLOSE,26);DEA: EMA(DIFF,9);MACD: 2*(DIFF-DEA),COLORSTICK;JC:=DEA-DIFF;绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);本次最低价:=LLV(L,BARSLAST(JC<0));本次最高价:=HHV(H,BARSLAST(JC>0));X1:=IF (MACD<0,BARSLAST(CROSS(DIFF,DEA)),0);前次绿柱面积:=REF(绿柱面积,X1+1);前次最低价:=REF(本次最低价,X1+1);Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)<ABS(前次绿柱面积)AND 本次最低价<前次最低价),1,0);RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价AND ABS(绿柱面积)<ABS(前次绿柱面积) AND ABS(MACD)<ABS(REF(MACD,1)); 底背驰:= IF (CROSS(DIFF,DEA),REF(Y1,1),0);DRAWTEXT(底背驰,-0.01,'积底'),COLORRED;{DRAWBAND(DIFF,RGB(200,50,55),DEA,RGB(50,100,10));}X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);前次红柱面积:=REF(红柱面积,X2+1);前次最高价:=REF(本次最高价,X2+1);Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积AND 本次最高价>前次最高价),1,0); RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价AND ABS(红柱面积)<ABS(前次红柱面积) AND ABS(MACD)<ABS(REF(MACD,1));顶背驰:= IF (CROSS(DEA,DIFF),REF(Y2,1),0);DRAWTEXT(顶背驰,0.01,'积顶'),COLORGREEN;A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));底背离:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) ANDCROSS(DIFF,DEA);DRAWTEXT(底背离,DEA,' 线底'),COLORRED;A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A22+1)<CLOSE AND REF(DIFF,A22+1)>DIFF ANDCROSS(DEA,DIFF);DRAWTEXT(顶背离,DEA,'线顶'),COLORGREEN;A1:=DIFF<0 AND DEA<0;A2:=A1>REF(A1,1);A3:=BARSLAST(A2);。

MACD背离自动画线通达信指标公式源码

MACD背离自动画线通达信指标公式源码

DIF:MACD.DIF(12,26,9),LINETHICK2;DEA:MACD.DEA(12,26,9);MACD:(DIF-DEA)*2,COLORSTICK;DRAWICON(REF(DIF,1)>REF(DIF,2) AND DIF<REF(DIF,1) AND DIF>0 AND DIF>DEA,DIF*1.1,2),COLORGREEN;DRAWICON(CROSS(DEA,DIF) AND DIF>0,DIF,37),COLORGREEN;DRAWICON(REF(DIF,1)<REF(DIF,2) AND DIF>REF(DIF,1) AND DIF<0 AND DIF<DEA,DIF*1.1,1),COLORRED;DRAWICON(CROSS(DIF,DEA) AND DIF<0,DIF,36),COLORRED;XA_1:=MACD<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);STICKLINE(XA_1,0,MACD,0.3,0),COLORRED;XA_2:=MACD>0 AND MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2) AND REF(MACD,2)>REF(MACD,3) AND REF(MACD,3)>REF(MACD,4);STICKLINE(XA_2,0,MACD,0.3,0),COLORGREEN;XA_3:=100-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))-50;XA_4:=EMA(XA_3,3);NOTEXTLU:IF(XA_4>24.99,DIF,DRAWNULL),COLORRED,LINETHICK2;NOTEXTLU2:IF(XA_4<(-40.009998),DIF,DRAWNULL),COLORGREEN,LINETHICK2; NOTEXT0:0,DOTLINE,COLORLIGRAY;XA_5:=IF(PERIOD=0,0.7,IF(PERIOD=1,1.2,IF(PERIOD=2,2,IF(PERIOD=3,2.5,IF(PERIOD =4,3,IF(PERIOD=5,5.5,IF(PERIOD=6,6,IF(PERIOD=7,7,IF(PERIOD=8,3.5,4)))))))));XA_6:=BARSLAST(CROSS(MACD,0));XA_7:=REF(XA_6,1)>0 AND XA_6=0;XA_8:=BARSLAST(XA_7);XA_9:=REF(XA_6,XA_8+1);XA_10:=HHVBARS(MACD,XA_8+XA_9);XA_11:=IF(XA_10>XA_8,REF(MACD,XA_10),0);XA_12:=IF(XA_10>XA_8,REF(HIGH,XA_10),0);XA_13:=IF(REF(HIGH,1)=HHV(HIGH,XA_8+XA_9),REF(HIGH,1),0);XA_14:=(XA_13-XA_12)/XA_12*100;XA_15:=COUNT(CROSS(0,MACD),XA_8+XA_9);XA_16:=MACD>0 AND MACD<XA_11 AND HIGH=HHV(HIGH,XA_8+XA_9) AND XA_11>0 AND XA_15=1;XA_17:=REF(XA_16,1) AND HIGH<REF(HIGH,1) AND MACD>0 AND XA_11>0;XA_18:=LLVBARS(MACD,XA_8+XA_9);XA_19:=IF(XA_18>XA_8,REF(MACD,XA_18),0);XA_20:=IF(XA_18>XA_8,REF(LOW,XA_18),0);XA_21:=IF(REF(LOW,1)=LLV(LOW,XA_8+XA_9),REF(LOW,1),0);XA_22:=(XA_20-XA_21)/XA_20*100;XA_23:=COUNT(CROSS(MACD,0),XA_8+XA_9);XA_24:=MACD<0 AND MACD>XA_19 AND LOW=LLV(LOW,XA_8+XA_9) AND XA_19<0 AND COUNT(CROSS(MACD,0),XA_8+XA_9)<=3;XA_25:=REF(XA_24,1) AND LOW>REF(LOW,1) AND MACD<0 AND XA_19<0;前高:IF(XA_17,XA_12,DRAWNULL),NODRAW,COLOR7FFF00;现高:IF(XA_17,XA_13,DRAWNULL),NODRAW,COLORGREEN;幅度_顶:IF(XA_17,XA_14,DRAWNULL),NODRAW,COLORYELLOW;原低:IF(XA_25,XA_20,DRAWNULL),NODRAW,COLORLIMAGENTA;现低:IF(XA_25,XA_21,DRAWNULL),NODRAW,COLORRED;幅度_底:IF(XA_25,XA_22,0),NODRAW,COLORYELLOW;DRAWICON(XA_25,MACD,26);DRAWICON(XA_17,MACD,27);XA_26:=BACKSET(XA_17,XA_10+1);XA_27:=BACKSET(XA_25,XA_18+1);NOTEXTMACDL:DRAWLINE(REF(XA_27,1)=0 AND XA_27=1 AND MACD<0,MACD,XA_25,MACD,0),COLORRED;NOTEXTMACDH:DRAWLINE(REF(XA_26,1)=0 AND XA_26=1 AND MACD>0,MACD,XA_17,MACD,0),COLORGREEN;涨家数:INDEXADV,NODRAW,COLORRED;跌家数:INDEXDEC,NODRAW,COLORGREEN;正量能:涨家数/(涨家数+跌家数)*100,NODRAW,COLORMAGENTA;负量能:跌家数/(涨家数+跌家数)*100,NODRAW,COLORYELLOW;。

买入信号奇准的MACD指标通达信指标公式源码

买入信号奇准的MACD指标通达信指标公式源码

买入信号奇准的MACD指标通达信指标公式源码MACD指标又称为移动平均收敛差异指标,是一种趋势跟踪指标,用于分析股票或其他金融资产的价格动态。

它是由两条线组成的,分别是DIF线和DEA线,同时还有一个柱状图。

下面是通达信指标公式源码:```python/*定义变量*/period1 = 12period2 = 26period3 = 9/*计算EMA移动平均线*/ema1 = EMA(CLOSE, period1) //收盘价的12日指数移动平均线ema2 = EMA(CLOSE, period2) //收盘价的26日指数移动平均线dif = ema1 - ema2 //DIF线/*计算DEA移动平均线*/dea = EMA(dif, period3) //DIF线的9日指数移动平均线/*计算MACD柱状图*/macd = (dif - dea) * 2 //柱状图/*绘制DIF线、DEA线和MACD柱状图*/Plot(dif, "DIF", color=red)Plot(dea, "DEA", color=blue)Plot(macd, "MACD", color=black, style=histogram)```以上是MACD指标的通达信指标公式源码。

其中,period1表示DIF 线的计算周期,通常为12日;period2表示DEA线的计算周期,通常为26日;period3表示MACD柱状图的计算周期,通常为9日。

根据MACD指标的分析方法,一般当DIF线向上突破DEA线时,形成金叉信号,意味着股票价格可能上涨,这时候可以考虑买入;相反,当DIF线向下突破DEA线时,形成死叉信号,意味着股票价格可能下跌,这时候可以考虑卖出。

此外,MACD柱状图的变化也可以用来判断股票的买卖信号。

需要注意的是,以上源码仅提供了MACD指标的计算和绘制部分,具体的买入或卖出策略需要根据个人的投资策略和风险偏好进行进一步的判断和调整。

通达信MACD顶底背离副图指标公式源码

通达信MACD顶底背离副图指标公式源码
来自: > 配色: 字号: 大 中 小 |阅: 转: | 分享 献花( 0 ) ( ) 类似文章
通达信MACD顶底背离副图指标公式源码
{MACD顶底背离}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK;
B3:=REF(C,A3+1)>C AND REF('RSI.RSI1'(6,12,24),A3+1)<'RSI.RSI1'(6,12,24) ANDCROSS('RSI.RSI1'(6,12,24),'RSI.RSI2'(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1>0,0பைடு நூலகம்1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;

通达信指标公式源码 顶底背离MACD副图指标

通达信指标公式源码 顶底背离MACD副图指标

VAR1:=EMA(SLOPE(C,21)+C,55);VAR2:=EMA(SLOPE(O,21)+O,55);VAR3:=EMA(SLOPE(H,21)+H,55);VAR4:=EMA(SLOPE(L,21)+L,55);VAR5:=EMA(C,3);VAR6:=EMA(O,3);VAR7:=EMA(H,3);VAR8:=EMA(L,3);VAR9:=VAR1-VAR5,LINETHICK2;VAR10:=VAR2-VAR6,LINETHICK2;VAR11:=VAR3-VAR7,LINETHICK2;VAR12:=VAR4-VAR8,LINETHICK2;ZJC:=REVERSE(VAR9);ZJO:=REVERSE(VAR10);ZJH:=REVERSE(VAR11);ZJL:=REVERSE(VAR12);DIF:EMA(ZJC*5,12)-EMA(ZJC*5,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORMAGENTA;STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORLIGREEN; STICKLINE(ZJC> ZJO,ZJH,ZJL,0.0,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,2.1,0),COLORAA00AA;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.9,0),COLORCC11CC;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.6,0),COLORFF22FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.2,0),COLORFF44FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.7,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.2,0),COLORFF99FF;STICKLINE(ZJC<=ZJO,ZJL,ZJC,0.0,0),COLORGREEN;STICKLINE(ZJC<=ZJO,ZJO,ZJC,2.1,0),COLOR005500;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.9,0),COLOR007700;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.6,0),COLOR009900;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.2,0),COLOR00BB00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.7,0),COLOR00DD00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.2,0),COLOR44FF00;ZTB:=(C-REF(C,1))/REF(C,1)*100>9.9;DRAWTEXT(ZTB,IF(ZJC<0,ZJC*0.9,ZJC*1.1),'涨停板')COLORYELLOW; STICKLINE(ZTB,ZJC,ZJO,2.1,0),COLOR006666;STICKLINE(ZTB,ZJC,ZJO,1.9,0),COLOR008888;STICKLINE(ZTB,ZJC,ZJO,1.6,0),COLOR00AAAA;STICKLINE(ZTB,ZJC,ZJO,1.2,0),COLOR00CCCC;STICKLINE(ZTB,ZJC,ZJO,0.7,0),COLOR00EEEE;STICKLINE(ZTB,ZJC,ZJO,0.2,0),COLOR33FFFF;DTB:=(C-REF(C,1))/REF(C,1)*100<-9.9;DRAWTEXT(DTB,IF(ZJC>0,ZJC*0.9,ZJC*1.1),'跌停板')COLORFF8800; STICKLINE(DTB,ZJO,ZJC,2.1,0),COLORFF0000;{蓝色}STICKLINE(DTB,ZJO,ZJC,1.9,0),COLORFF2200;STICKLINE(DTB,ZJO,ZJC,1.6,0),COLORFF4400;STICKLINE(DTB,ZJO,ZJC,1.2,0),COLORFF6600;STICKLINE(DTB,ZJO,ZJC,0.7,0),COLORFF8800;STICKLINE(DTB,ZJO,ZJC,0.2,0),COLORFFAA00;。

MACD背离自动画线通达信指标公式源码

MACD背离自动画线通达信指标公式源码

MACD背离自动画线通达信指标公式源码通达信(MetaStock)是一种常用的股票分析软件,提供了丰富的指标库。

在通达信中编写指标公式可以使用通达信自带的公式语言-支持C语言语法。

为了实现MACD背离自动画线指标,我们首先要计算MACD指标的数值,并判断是否出现背离。

接下来,我们可以使用通达信的画线函数实现在背离点位置上自动画线。

下面是该指标的示例源码:```javascript/*时间:2024-01-01*/#include "stdio.h"#include "stdlib.h"#include "string.h"#include "windows.h"/*定义MACD指标相应变量*/double EMA_SHORT;double EMA_LONG;double DIFF;double DEA;double MACD;/*初始化操作,在指标开始计算之前调用*/void InitEMA_SHORT=0;EMA_LONG=0;DIFF=0;DEA=0;MACD=0;/*计算MACD指标的数值*/void CalculateMACD(double close[], int n, int shortPeriod, int longPeriod, int signalPeriod)double EMA_SHORT_SMOOTH = 2.0 / (shortPeriod + 1);double EMA_LONG_SMOOTH = 2.0 / (longPeriod + 1);//计算短期EMAdouble emaShortPrev = close[0];for (int i = 0; i < shortPeriod; i++)emaShortPrev = emaShortPrev * (1 - EMA_SHORT_SMOOTH) +close[i] * EMA_SHORT_SMOOTH;}//计算长期EMAdouble emaLongPrev = close[0];for (int i = 0; i < longPeriod; i++)emaLongPrev = emaLongPrev * (1 - EMA_LONG_SMOOTH) + close[i] * EMA_LONG_SMOOTH;}//计算DIFF和DEADIFF = emaShortPrev - emaLongPrev;DEA=0;double DEA_SMOOTH = 2.0 / (signalPeriod + 1);for (int i = 0; i < signalPeriod; i++)DEA=DEA*(1-DEA_SMOOTH)+DIFF*DEA_SMOOTH;}//计算MACDMACD=(DIFF-DEA)*2;/*判断是否出现背离*/int IsDivergence(double close[], int n, int direction)for (int i = 2; i < n; i++)double prevClose1 = close[i - 2];double prevClose2 = close[i - 1];double currentClose = close[i];if (direction == 1) // 上涨背离:前两个低点价格下降,当前高点价格上升if (prevClose1 > prevClose2 && prevClose2 > currentClose) return i;}}else if (direction == -1) // 下跌背离:前两个高点价格上升,当前低点价格下降if (prevClose1 < prevClose2 && prevClose2 < currentClose)return i;}}}return -1;/*自动画线函数,在背离位置上自动画线*/void AutoDrawLine(int barIndex, int direction)//自动画线的相关处理,这里仅做示例printf("在第 %d 根K线上画上涨背离线。

特殊MACD源码通达信指标公式源码

特殊MACD源码通达信指标公式源码

DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MYY:=EMA(CLOSE,3)-EMA(CLOSE,3);YMM:=EMA(MYY,3);MACD:(DIF-DEA)*2,COLORSTICK;IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;MACD2:=MACD;获利比:WINNER(C),NODRAW;STICKLINE((MACD2>=0),0,MACD2,0,1),COLORRED;STICKLINE(((MACD2>=0) AND (MACD2 <REF(MACD2,1))),0,MACD2,0,0),COLORMAGENTA;STICKLINE((MACD2<0),0,MACD2,0,0),COLORGREEN;STICKLINE(((MACD2<0) AND (MACD2 > REF(MACD2,1))),0,MACD2,0,1),COLORWHITE; DRAWICON(LONGCROSS(CLOSE,MA(CLOSE,5),17),MACD2,1);DRAWICON(LONGCROSS(MA(CLOSE,5),CLOSE,17),MACD2,2);DRAWICON(CROSS(DIF,DEA) AND DIF<=0.2,LLV(DIF,1),29);DRAWICON(CROSS(DIF>=0,DIF<DEA),DIF,1);低位反转:=MACD<0 AND MACD>REF(MACD ,1) AND REF(MACD ,1)<REF(MACD ,2)AND REF(MACD ,2)<REF(MACD ,3)AND REF(MACD ,3)<REF(MACD ,4);STICKLINE(低位反转,0,MACD,0.3,0),COLORRED;高位反转:=MACD>0 AND MACD<REF(MACD ,1) AND REF(MACD ,1)>REF(MACD ,2)AND REF(MACD ,2)>REF(MACD ,3)AND REF(MACD ,3)>REF(MACD ,4);STICKLINE(高位反转,0,MACD,0.3,0),COLORGREEN;低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; DRAWICON(二次金叉,0,25);三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1; DRAWICON(三次金叉,0,26);A1:=IF(MACD2>0,1,-1);TJ:=MACD2>0;T:=MACD2<0;DRAWTEXT(BARSLAST(TJ)=1,MACD2,'1'),COLORYELLOW;DRAWTEXT(BARSLAST(TJ)=2,MACD2,'2'),COLORYELLOW;DRAWTEXT(BARSLAST(TJ)=3,MACD2,'3'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=5,MACD2,'5'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=8,MACD2,'8'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=13,MACD2,'13'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=21,MACD2,'21'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=34,MACD2,'34'),COLORYELLOW; DRAWTEXT(BARSLAST(TJ)=55,MACD2,'55'),COLORYELLOW; DRAWTEXT(BARSLAST(T)=1,MACD2,'1'),COLORGREEN; DRAWTEXT(BARSLAST(T)=2,MACD2,'2'),COLORGREEN; DRAWTEXT(BARSLAST(T)=3,MACD2,'3'),COLORGREEN; DRAWTEXT(BARSLAST(T)=5,MACD2,'5'),COLORGREEN; DRAWTEXT(BARSLAST(T)=8,MACD2,'8'),COLORGREEN; DRAWTEXT(BARSLAST(T)=13,MACD2,'13'),COLORGREEN; DRAWTEXT(BARSLAST(T)=21,MACD2,'21'),COLORGREEN; DRAWTEXT(BARSLAST(T)=34,MACD2,'34'),COLORGREEN; DRAWTEXT(BARSLAST(T)=55,MACD2,'55'),COLORGREEN;涨家数:INDEXADV,NODRAW,COLORRED;跌家数:INDEXDEC,NODRAW,COLORGREEN;正量能:涨家数/(涨家数+跌家数)*100,NODRAW,COLORMAGENTA; 负量能:跌家数/(涨家数+跌家数)*100,NODRAW,COLORYELLOW; 高开:=O>REF(H,1);隔空高开:高开,NODRAW;低开:=O<REF(L,1);隔空低开:低开,NODRAW;。

通达信指标公式源码 MACD主图 主图源码

通达信指标公式源码 MACD主图 主图源码

{色MACD主图}高1:=REF(HHV(H,150),3);低1:=REF(LLV(L,150),3);H3:=高1-(高1-低1)*0.5;中轴:REFDATE(H3,DATE),POINTDOT,COLORLIGRAY,LINETHICK3;B1:=EMA(C,12);B2:=EMA(C,26);B3:=B1-B2;WDIF:EMA(EMA(EMA(C,3),3),3)+B3,COLORRED,LINETHICK2;WDEA:EMA(WDIF,9),COLORGREEN,LINETHICK2;MACD:2*(WDIF-WDEA),NODRAW ;STICKLINE(MACD>0,中轴,中轴+MACD,0,1),COLORRED;STICKLINE(MACD<0,中轴,中轴+MACD,0,1),COLORLIBLUE;STICKLINE(MACD<REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR00BBFF;STICKLINE(MACD>=REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR0011BB;STICKLINE(MACD>REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORBB11BB;STICKLINE(MACD<=REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORFFBB11;{量价异动}短线:MA(C,5),NODRAW;中线:((MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4+EXPMA( CLOSE,10))/2,NODRAW;密码线:((EMA(C,6)+EMA(C,18)+EMA(C,54)+EMA(C,162))/4+EXPMA(CLOSE,24)+ MA(C,25))/3,NODRAW;神奇线:(MA(C,35)+EXPMA(CLOSE,50))/2,NODRAW;阳涨幅:=4.0;阳倍量:=2.0;单阳收:=C;单阳开:=O;单阳:=单阳收>=REF(C,1)*(1+阳涨幅/100)AND VOL>REF(VOL,1)*阳倍量; DRAWTEXT(CURRBARSCOUNT<100 AND 单阳,L*0.98,'准备'),COLOR00FFFF; 高不破价:=REF(C,BARSLAST(单阳));低不破价:=REF(L,BARSLAST(单阳));F1:=C/REF(C,1)>1.098;强势:=COUNT(单阳,5) AND C>高不破价*0.98;A111:=REF(C/REF(C,1),BARSLAST(单阳));主升浪:=强势>0 AND C/REF(C,1)>A111 AND C>MA(C,60) ;JCCOUNT:=COUNT(单阳,11);上升中继:=单阳AND COUNT(JCCOUNT=2,11);DRAWTEXT(上升中继>0 ,L*0.9,'高度关注'),COLOR00FFFF;主升浪1:=上升中继AND F1;DRAWTEXT(主升浪>0 ,L*0.98,'主升浪'),COLOR00FFFF;拉升:=COUNT(单阳,4) AND O/REF(C,1)>1.017 AND C>=O AND C>MA(C,60) ; DRAWTEXT(拉升>0 ,L*0.9,'拉升'),COLOR00FFFF;单阳不破:=CURRBARSCOUNT<100 AND BARSLAST(单阳)<11 AND(LLV(L,BARSLAST(单阳))>低不破价OR LLV(L,BARSLAST(单阳))=低不破价); {金叉共振}市场成本:DMA(AMOUNT/V/100,V/CAPITAL),COLORRED,NODRAW; DRAWICON(CROSS(C,市场成本),L-0.20,1);{1号图标显示红脸} {PARTLINE(市场成本,市场成本>REF(市场成本,1),RGB(255,0,0),NOT(市场成本<REF(市场成本,1)),RGB(0,0,255),1,RGB(0,0,255)),LINETHICK2;}DIFF:=EMA(CLOSE,2) - EMA(CLOSE,60);DEA:=EMA(DIFF,8);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B01:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B02:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B03:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));DRAWICON(B01>0,L-0.20,5);DRAWTEXT(B01,L-0.30,'MACD底背'),COLORWHITE;DRAWICON(B02>0,L-0.20,4);DRAWTEXT(B02,L-0.30,'KDJ底背'),COLORFF00FF;DRAWICON(B03>0,L-0.20,3);DRAWTEXT(B03,L-0.30,'RSI底背'),COLORYELLOW;DRAWICON(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.20,6);DRAWTEXT(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.30,'金叉共振'),COLOR0099FF; STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;{F10}DRAWTEXT_FIX(1,0.7,0,0,'所属板块:'),COLORFF6000;DRAWTEXT_FIX(1,0.77,0,0,HYBLOCK),COLORRED;DRAWTEXT_FIX(1,0.835,0,0,DYBLOCK),COLORYELLOW;总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿'); 全流通:=STRCAT(' 全流通:',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');上市日期:=STRCAT(' 上市日期: ',CON2STR(FINANCE(42),0));股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值),上市日期));{}市盈率:=STRCAT('市盈率: ',CON2STR(C/FINANCE(33),2));市销率:=STRCAT(' 市销率: ',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));市净率:=STRCAT(' 市净率: ',CON2STR(C/FINANCE(34),2));净资收益率:=STRCAT(' 净资收益率:',CON2STR(FINANCE(33)/FINANCE(34)*100,2));毛利率:=STRCAT(' 毛利率:',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));净利润率:=STRCAT(' 净利润率',CON2STR(FINANCE(30)/FINANCE(20)*100,2));主营利润率:=STRCAT(' 主营利润率',CON2STR(FINANCE(23)/FINANCE(20)*100,2));当前业绩:=STRCAT('当前业绩:',STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(市盈率,市销率),市净率),净资收益率),毛利率),净利润率),主营利润率));{}X1:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;X2:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;{盈余公积用资本公积金代替};X3:=FINANCE(23)/FINANCE(10)*3.3;X4:=FINANCE(19)/FINANCE(15)*0.6;{缺长期负债或负债总额}X5:=FINANCE(20)/FINANCE(15)*0.999;Z值:=X1+X2+X3+X4+X5;预警:=IF(Z值<1.2,'重警',IF(Z值>=1.2 AND Z值<2.6,'轻警','无警'));财务预警:=STRCAT('财务预警: ',STRCAT(预警,STRCAT('-Z值: ',CON2STR(Z 值,3))));优质资产率:=STRCAT(' 优质资产率:',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));{理论上越大越好但不同行业有不同标准};现金负债比:=STRCAT(' 现金负债比:',CON2STR(FINANCE(25)/FINANCE(15),3));{缺长期负债或负债总额,理论上越大越好但不同行业有不同标准};财务系数:=STRCAT('风险系数: ',STRCAT(STRCAT(财务预警,优质资产率),现金负债比));{}DRAWTEXT_FIX(ISLASTBAR,0.005,0.01,0,财务系数),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,当前业绩),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.115,0,股本市值),COLORYELLOW;{止损线}{数据自己爱好调整}STICKLINE(ISLASTBAR,HHV(C,5),HHV(C,5),218,1)COLORBLUE; STICKLINE(ISLASTBAR,HHV(C,5)*0.95,HHV(C,5)*0.95,218,1)COLORRED;。

通达信MACD趋势主图指标公式

通达信MACD趋势主图指标公式

通达信MACD趋势主图指标公式DRAWGBK(C>0, RGB(0,0,00),RGB(0,0,0),0,'W20',0);DRAWKLINE(H,O,L,C);QWX1:=HHV(CLOSE,30);QWX2:=LLV(CLOSE,30);QWX3:=CONST((QWX1+QWX2)/2);QWX4:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);QWX5:=CONST((1-7/100)*(DMA(CLOSE,QWX4)));QWX6:=CONST((1+7/100)*(DMA(CLOSE,QWX4)));{KDJ}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;KX:=SMA(RSV,3,1);DX:=SMA(KX,3,1);JX:=3*KX-2*DX;{MACD}DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*2+QWX3,COLORWHITE;DEA:=EMA(DIF,9),COLORYELLOW;MACD:(DIF-DEA)*5+QWX3,COLORYELLOW,LINETHICK2;DRAWBAND(MACD,RGB(120,0,100),QWX3,RGB(60,100,50));DRAWKLINE(HIGH,OPEN,LOW,CLOSE);牛熊线:=(EMA(CLOSE,30)+EMA(CLOSE,72))/2,LINETHICK2,COLORRE D;M5:MA(CLOSE,5),COLORWHITE,DOTLINE;IF(MA(C,5)>=REF(MA(C,5),1),MA(C,5),DRAWNULL),COLORYE LLOW,LINETHICK3;M10:MA(CLOSE,10),COLORYELLOW,DOTLINE;IF(MA(C,10)>=REF(MA(C,10),1),MA(C,10),DRAWNULL),COLO R330099,LINETHICK2;M20:MA(CLOSE,20),COLORFF00FF;IF(MA(C,20)>=REF(MA(C,20),1),MA(C,20),DRAWNULL),COLO RLIMAGENTA,LINETHICK2;M60:MA(CLOSE,60),COLOR6699CC;IF(MA(C,60)>=REF(MA(C,60),1),MA(C,60),DRAWNULL),CIRCL EDOT,LINETHICK2;M120:MA(CLOSE,120),COLORLIBLUE,DOTLINE;M250:MA(CLOSE,250),COLORMAGENTA,DOTLINE;VAR1:=IF(CLOSE>OPEN,CLOSE,OPEN);VAR2:=MEMA(CLOSE,5);VAR3:=ATAN((VAR2/REF(VAR2,1)-1)*100);VAR4:=IF(VAR3>0,VAR3,VAR3);VAR5:=(CLOSE/REF(CLOSE,1)-1)*100;VAR6:=VAR5<1.5 AND VAR5>-1.5;今日之升★:LAST(VAR6,4,1) AND V AR5>2 AND VOL>REF(VOL,1),NODRAW,COLORYELLOW;DRAWTEXT(今日之升★,L/1.01,'★'),COLORYELLOW;强势:IF(VAR4>=REF(VAR4,1) AND VAR4>=0,M10,DRAWNULL),COLORRED,LINETHICK2;整理:IF(VAR4<REF(VAR4,1) AND VAR4>0,M10,DRAWNULL),COLORGREEN,LINETHICK2;支撑:IF(PERIOD=5,IF(BARSLAST(CURRBARSCOUNT=5),QWX5,DRA WNULL),DRAWNULL),COLORCYAN;阻力:IF(PERIOD=5,IF(BARSLAST(CURRBARSCOUNT=5),QWX6,DRA WNULL),DRAWNULL),COLORYELLOW;N:=120;K:=BARSLAST(CURRBARSCOUNT=N);GD:=CONST(IF(ISLASTBAR=1,HHV(H,K),0));{高点}DD:=CONST(IF(ISLASTBAR=1,LLV(L,K),0));{低点}KJ:=GD-DD;{高低点差值=分区高度}GD4:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL);底:IF(CURRBARSCOUNT<=N/30,DD,DRAWNULL),COLORFFF F00;高:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL),COLOR00F FFF;撑:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.191,DRAWNULL), COLOR00FFFF;强: IF(CURRBARSCOUNT<=N/30,DD+KJ*0.382,DRAWNULL),COLOR FF00FF;突破:IF(CURRBARSCOUNT<=N/30,DD+KJ/2,DRAWNULL),COLOR0 000FF;警示:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.618,DRAWNULL),COL OR00FFFF;压力:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.809,DRAWNULL),COL OR00FF00;低涨:IF(CURRBARSCOUNT<=N/30,(C/LLV(LOW,K)-1)*100,DRAWNULL),COLOR0000FF,NODRAW;天数:BARSLAST(L=DD),COLORCYAN,NODRAW;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299,NODRAW;顶点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORRED, DOTLINE;低点:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORYELL OW,DOTLINE;STICKLINE(CCI>=200 AND H>=顶点,O,C,3,0),COLORBLUE;STICKLINE(CCI<=100 AND L<=低点,O,C,3,0),COLORYELLOW;DRAWBAND(高,RGB(200,200,0),压力,RGB(0,0,0));DRAWBAND(压力,RGB(0,190,0),警示,RGB(0,0,0));DRAWBAND(警示,RGB(220,120,0),突破,RGB(0,0,0));DRAWBAND(突破,RGB(120,0,120),强势,RGB(0,0,0));DRAWBAND(强势,RGB(120, 0,0),支撑,RGB(0,0,0));DRAWBAND(支撑,RGB(80,80,80),底,RGB(0,0,0));STICKLINE(CURRBARSCOUNT=N/30,GD,DD,0,0),COLORGRE EN;STICKLINE(CURRBARSCOUNT=1,GD,DD,0,0),COLORGREEN;STICKLINE(CURRBARSCOUNT<=N/30,支撑,支撑,4,0),COLORFF00FF;STICKLINE(CURRBARSCOUNT<=N/30,强势,强势,4,0),COLORFF00FF;STICKLINE(CURRBARSCOUNT<=N/30,突破,突破,4,0),COLORABABAB;STICKLINE(CURRBARSCOUNT<=N/30,警示,警示,4,0),COLOR00FFFF;STICKLINE(CURRBARSCOUNT<=N/30,压力,压力,4,0),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,压力,'0.809'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,警示,'0.618'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,突破,'0.500'),COLORFFFFFF;DRAWTEXT(CURRBARSCOUNT=1,强势,'0.382'),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=1,支撑,'0.191'),COLOR00FFFF;{柱型显示}STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,4,-1),COLOR00FFFF;STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,4,-1),COLORGREEN;{蓝}STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3,0),COLORFF7700;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.2,0),COLORFF990 0;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1.5,0),COLORFFBB0 0;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,0.5,0),COLORCYAN;{红}STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),COLOR000099;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.2,0),COLOR0000CC;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.5,0),COLOR0000FF;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.5,0),COLORCC66FF;{绿}STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,3,0) ,COLOR009900;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,2.2, 0),COLOR00BB00;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,1.5,0),COLOR00DD00;STICKLINE(CROSS(M5,EMA(C,3)),VAR1,(OPEN+CLOSE)/2,0.5, 0),COLOR00FF00;{灰}STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,3,0 ),COLOR999999;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,2.2 ,0),COLORBBBBBB;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,1.5 ,0),COLORDDDDDD;STICKLINE(CROSS(EMA(C,3),M5),OPEN,(OPEN+CLOSE)/2,0.5 ,0),COLORFFFFFF;STICKLINE(CROSS(JX,DX),OPEN,CLOSE,0.5,0),COLORYELLOW;STICKLINE(CROSS(DX,JX),OPEN,CLOSE,0.5,0),{COLOR000099 }COLORBLACK;超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);大宗进:=(超B)+(大B),NODRAW;大宗出:=(超S)+(大S),NODRAW;非大宗进:=(中B)+(小B),NODRAW;非大宗出:=(中S)+(小S),NODRAW;大宗进限制:=IF((超B+大B)=0,0,大宗进);大宗出限制:=IF((超S+大S)=0,0,大宗出);非大宗进限制:=IF(中B+小B=0,0,非大宗进);非大宗出限制:=IF(中S+小S=0,0,非大宗出);主力净流入:=(超B+大B)-(超S+大S),COLORRED,NODRAW;散户净流入:=(中B+小B)-(中S+小S),COLORRED,NODRAW;净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S),COLORRED,NODRAW;大单流入:=(超B+大B)/(超B+大B+超S+大S)*100,NODRAW;大单流入限制:=IF((超B+大B+超S+大S)=0,0,大单流入);大单流出比:=(超S+大S)/(超B+大B+超S+大S)*100,NODRAW;大单流出限制:=IF((超B+大B+超S+大S)=0,0,大单流出比);总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;总流出比:=(超S+大S+中S+小S)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;成交总量:=(超B+大B+中B+小B+超S+大S+中S+小S),NODRAW;机构参与度:=(超B+超S+大B+大S)/成交总量*100,COLORYELLOW,NODRAW;大单强度:=(超B+大B-超S-大S)/成交总量*100,COLORYELLOW,NODRAW;大单强度限制:=IF(大单强度=0,-100,大单强度);大单强度比:=IF(大单强度>=0,(大单强度限制+100)/2,100-ABS((大单强度限制-100)/2)),NODRAW;超单强度:=(超B-超S)/(超B+超S)*100,COLORYELLOW,NODRAW;超单强度限制:=IF(超单强度=0,-100,超单强度);超单强度比:=IF(超单强度>0,(超单强度限制+100)/2,IF(超单强度<0,100-ABS((超单强度限制-100)/2),0)),NODRAW;DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;DRAWRECTREL(0,CONST(950-(ABS(大宗进)*250/DAZHIV))-20,30,950,IF(CONST(大宗进>0),RGB(250,125,0),RGB(25,150,250)));DRAWRECTREL(32,CONST(950-(ABS(大宗出)*250/DAZHIV))-20,62,950,IF(CONST(大宗出>0),RGB(25,150,250),RGB(250,125,0)));DRAWRECTREL(102,CONST(950-(ABS(非大宗进)*250/DAZHIV))-20,132,950,IF(CONST(非大宗进>0),RGB(250,125,0),RGB(25,150,250)));DRAWRECTREL(134,CONST(950-(ABS(非大宗出)*250/DAZHIV))-20,164,950,IF(CONST(非大宗出>0),RGB(25,150,250),RGB(250,125,0)));DRAWRECTREL(204,CONST(950-(ABS(净流入)*250/DAZHIV))-20,234,950,IF(CONST(净流入>0),RGB(200,0,0),RGB(0,125,50)));DRAWTEXT_FIX(1,0.00,0.95,0,STRCAT(STRCAT('主力',CON2STR(主力净流入,0)),'万')),COLORMAGENTA;DRAWTEXT_FIX(1,0.10,0.95,0,STRCAT(STRCAT('散户',CON2STR(散户净流入,0)),'万')),COLORCYAN;DRAWTEXT_FIX(1,0.20,0.95,0,STRCAT(STRCAT('净流入',CON2STR(净流入,0)),'万')),COLORYELLOW;主买A:=ACTINVOL,COLORRED,NODRAW;主卖A:=ACTOUTVOL,COLORGREEN,NODRAW;主买:=主买A*100/(主买A+主卖A),NODRAW,COLORRED;主卖:=主卖A*100/(主买A+主卖A),NODRAW,COLORGREEN;大单买比:=LARGEINTRDVOL*100/(LARGEINTRDVOL+LARGEOUTTRDV OL);大单卖比:=LARGEOUTTRDVOL*100/(LARGEINTRDVOL+LARGEOUTTRD VOL);主力净买量:=(LARGEINTRDVOL-LARGEOUTTRDVOL),COLORYELLOW,NODRAW;主动买卖差:=(ACTINVOL-ACTOUTVOL),COLORMAGENTA,NODRAW;主力资金差:=((L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1)))/10000,COLORCYAN,NODRAW;主力买力度:=LARGEINTRDVOL*100/VOL;主力卖力度:=LARGEOUTTRDVOL*100/VOL;主买力度比:=主力买力度/(主力买力度+主力卖力度)*100,NODRAW;主卖力度比:=主力卖力度/(主力买力度+主力卖力度)*100,NODRAW;力度比限制:=IF((LARGEINTRDVOL+LARGEOUTTRDVOL)=0,0,大单买比);JGV:=(L2_VOL(0,0) - L2_VOL(0,1))*VOL/100000000,COLORRED;DHV:=(L2_VOL(1,0) - L2_VOL(1,1))*VOL/100000000,COLORFF00FF;ZHV:=(L2_VOL(2,0) - L2_VOL(2,1))*VOL/100000000,COLOR00FFFF;SHV:=(L2_VOL(3,0) - L2_VOL(3,1))*VOL/100000000,COLORFFFFFF;NOTEXT大量动向:=MA((JGV+DHV),5),COLORYELLOW;超级大量:=JGV,COLOR0000FF,NODRAW;机构大量:=DHV,COLORMAGENTA,NODRAW;大量博弈:=(JGV+DHV),COLORYELLOW,NODRAW;小量博弈:=(ZHV+SHV),COLORWHITE,NODRAW;大量资金比:=大量博弈/(ABS(JGV)+ABS(DHV)+ABS(ZHV)+ABS(SHV))*100,COLORYELLO W,NODRAW;大量资金比限制:=IF(大量资金比=0,-100,大量资金比);大量强度比:=IF(大量资金比>0,(大量资金比限制+100)/2,IF(大量资金比<0,100-ABS((大量资金比限制-100)/2),0)),COLORGREEN,NODRAW;小量资金比:=小量博弈/(ABS(JGV)+ABS(DHV)+ABS(ZHV)+ABS(SHV))*100,COLORYELLO W,NODRAW;小量强度比:=IF(小量资金比>=0,(小量资金比+100)/2,100-ABS((小量资金比-100)/2)),COLORCYAN,NODRAW;MVR:=REF(MA(V,5),1);FVR:=REF(V,1);PVR:=(MVR+FVR)/2;量能比:=V/(V+PVR)*100/FROMOPEN*240;{量能饱和度}SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));【量能饱和】:=IF(SAT>1,1,SAT)*100,COLORYELLOW,NODRAW;{活跃度}LC:=REF(CLOSE,1);RSI5:=(SMA(MAX(CLOSE-LC,0),3,1))/(SMA(ABS(CLOSE-LC),3,1))*100;WR10:=(HHV(HIGH,3)-CLOSE)/(HHV(HIGH,3)-LLV(LOW,3))*100;活跃度:=(RSI5-WR10),COLORFFFF00,LINETHICK1,NODRAW;活跃度比:=IF(活跃度>=0,(活跃度+100)/2,100-ABS((活跃度-100)/2));DRAWRECTREL(80,0,240,40,RGB(0,75,200));DRAWRECTREL(80,0,160,40,RGB(0,250,50));DRAWRECTREL(80,0,80+CONST(力度比限制*160/100),40,RGB(200,0,50));DRAWTEXT_FIX(1,0.00,0.00,0,STRCAT(STRCAT('买卖力度比',CON2STR(大单买比,2)),'%买')),COLORYELLOW;DRAWTEXT_FIX(1,0.33,0.00,0,STRCAT(STRCAT('',CON2STR(大单卖比,2)),'%卖')),COLORGREEN;DRAWRECTREL(80,50,240,90,RGB(0,100,0));DRAWRECTREL(80,50,160,90,RGB(0,250,50));DRAWRECTREL(80,50,80+CONST(大量强度比*160/100),90,RGB(175,50,250));DRAWTEXT_FIX(1,0.00,0.05,0,STRCAT(STRCAT('大量强度比',CON2STR(大量强度比,2)),'%买')),COLORYELLOW;DRAWRECTREL(330,0,490,40,RGB(0,75,200));DRAWRECTREL(330,0,410,40,RGB(0,250,50));DRAWRECTREL(330,0,330+CONST(主买*160/100),40,RGB(175,50,250));DRAWTEXT_FIX(1,0.25,0.00,0,STRCAT(STRCAT('主动买卖比',CON2STR(主买,2)),' %')),COLORYELLOW;{DRAWTEXT_FIX(1,0.33,0.10,0,STRCAT(STRCAT('',CON2STR(主卖,2)),'%卖')),COLORGREEN;}DRAWRECTREL(330,50,490,90,RGB(0,100,0));DRAWRECTREL(330,50,410,90,RGB(0,250,50));。

通达信MACD背离金叉提示公式源代码

通达信MACD背离金叉提示公式源代码

通达信MACD背离金叉提示公式源代码展开全文DRAWTEXT_FIX(1,0.05,0.0,0,'顶背离绿线跌,底背离红线涨'),COLOR00FFFF,LINETHICK1;DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离, 0.25,'三全项'),COLOR0000FF,LINETHICK2;。

通达信MACD整合指标源码

通达信MACD整合指标源码

MACD整合DRAWGBK(CLOSE>OPEN,RGB(25,25,112),RGB(47,79,79),1,2,1);DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9),COLOR888888;NOTEXT5:IF(DIF>=DEA,DIF,DRAWNULL),COLORRED;NOTEXT6:IF(DIF<DEA,DIF,DRAWNULL),COLORWHITE;XA_1:=BARSLAST(REF(CROSS(DIF,DEA),1));XA_2:=REF(CLOSE,XA_1+1)>CLOSE AND REF(DIF,XA_1+1)<DIF AND CROSS(DIF,DEA); XA_3:=BARSLAST(REF(CROSS(KDJ.K(9,3,3),KDJ.D(9,3,3)),1));XA_4:=BARSLAST(REF(CROSS(DEA,DIF),1));XA_5:=REF(CLOSE,XA_4+1)<CLOSE AND REF(DIF,XA_4+1)>DIF AND CROSS(DEA,DIF);MACD底背:IF(XA_2>0,(-0.1),0),COLORRED;MACD顶背:IF(XA_5>0,0.1,0),COLORGREEN;STICKLINE(XA_2>0,0.5*DIF,0,2,0),COLORRED;STICKLINE(XA_5>0,0.5*DIF,0,2,0),COLORGREEN;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLOR44FF00; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLOR0066FF;XA_6:=13;XA_7:=13;XA_8:=REF(DIF,XA_6)=HHV(DIF,2*XA_6+1);XA_9:=FILTER(XA_8,XA_6);XA_10:=BACKSET(XA_9,XA_6+1);XA_11:=FILTER(XA_10,XA_6);XA_12:=BACKSET(ISLASTBAR,BARSLAST(XA_11)+1);XA_13:=XA_12>REF(XA_12,1);XA_14:=REF(DIF,XA_7)=LLV(DIF,2*XA_7+1);XA_15:=FILTER(XA_14,XA_7);XA_16:=BACKSET(XA_15,XA_7+1);XA_17:=FILTER(XA_16,XA_7);XA_18:=BACKSET(ISLASTBAR,BARSLAST(XA_17)+1);XA_19:=XA_18>REF(XA_18,1);压力线:DRAWLINE(XA_11,DIF,XA_13,DIF,0),DOTLINE,COLORCYAN;支撑线:DRAWLINE(XA_17,DIF,XA_19,DIF,0),DOTLINE,COLOR00AAFF;XA_20:=FILTERX(支撑线>REF(支撑线,1) AND DIF>支撑线AND REF(支撑线,1)=REF(DIF,1), 2);底抬高:DRAWLINE(XA_17,DIF,XA_20,支撑线,0),DOTLINE,COLORYELLOW;XA_21:=INTPART(3*10/5);XA_22:=REF(DIF,XA_21)=HHV(DIF,2*XA_21+1);XA_23:=FILTER(XA_22,XA_21);XA_24:=BACKSET(XA_23,XA_21+1);XA_25:=FILTER(XA_24,XA_21);XA_26:=BACKSET(ISLASTBAR,BARSLAST(XA_25)+1);XA_27:=XA_26>REF(XA_26,1);XA_28:=REF(DIF,XA_21)=LLV(DIF,2*XA_21+1);XA_29:=FILTER(XA_28,XA_21);XA_30:=BACKSET(XA_29,XA_21+1);XA_31:=FILTER(XA_30,XA_21);XA_32:=BACKSET(ISLASTBAR,BARSLAST(XA_31)+1);XA_33:=XA_32>REF(XA_32,1);短压线:DRAWLINE(XA_25,DIF,XA_27,DIF,0),DOTLINE,COLOR99FF00;短撑线:DRAWLINE(XA_31,DIF,XA_33,DIF,0),DOTLINE,COLOR0055FF;XA_34:=LLV(DEA,43);XA_35:=DEA-(DIF-DEA);XA_36:=IF(DIF<XA_34 AND DEA=XA_34,MIN(HHV(XA_34,10),XA_35),XA_34);XA_37:=REF(LOW,1);XA_38:=SMA(ABS(LOW-XA_37),13,1)/SMA(MAX(LOW-XA_37,0),13,1)*100;XA_39:=MA(XA_38,13);XA_40:=LLV(LOW,34);XA_41:=EMA(IF(LOW<=XA_40,XA_39,0),3);XA_42:=SMA(SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,7,1),5,1); XA_43:=SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,8,1)*15-XA_42* 10.38;XA_44:=FILTER(IF(XA_43<=XA_42 AND XA_41>0,XA_41*8,0),5);止跌:DRAWTEXT(XA_44 AND DIF<XA_36,DIF-11.01,101),COLORYELLOW;XA_45:=CROSS(DIF,DEA) AND DIF<(-0.1);STICKLINE(XA_45,0,(-0.18),6,0),COLORYELLOW;DRAWTEXT(XA_45,(-7.05),102),COLORYELLOW;XA_46:=IF(CROSS(0,DEA),1,0);XA_47:=IF(DIF<0 AND CROSS(DIF,DEA),1,0);XA_48:=IF(XA_46,SUM(XA_47,0),0);XA_49:=HHV(XA_48,0);XA_50:=SUM(XA_47,0);XA_51:=XA_50-XA_49=2 AND XA_50>REF(XA_50,1);DRAWTEXT(XA_51,DIF-15.05,103),COLOR0080FF;XA_52:=CROSS(MACD,DIF) AND MACD>=0-0.05 AND MACD<=0.02;DRAWTEXT(XA_52,MACD,104),COLORYELLOW;XA_53:=CROSS(DIF,DEA) AND DIF<(-0.1);XA_54:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));XA_55:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(XA_54=2,21)=1;STICKLINE(XA_55,0,(-0.58),6,0),COLORMAGENTA;DRAWTEXT(XA_55,0.1,105),COLOR5500FF;XA_56:=BARSLAST(REF(CROSS(DIF,DEA),1));XA_57:=REF(CLOSE,XA_56+1)>CLOSE AND DIF>REF(DIF,XA_56+1) AND CROSS(DIF,D EA);DRAWTEXT_FIX(C>O,0.01,0.9,0,' t'),COLORyellow;底背:DRAWLINE(XA_56=0,DIF,XA_57,DIF,0),COLORYELLOW,LINETHICK2;XA_58:=BARSLAST(REF(CROSS(DEA,DIF),1));XA_59:=REF(CLOSE,XA_58+1)<CLOSE AND REF(DIF,XA_58+1)>DIF AND CROSS(DEA,D IF);顶背:DRAWLINE(XA_58=0,DIF,XA_59,DIF,0),COLORGREEN,LINETHICK2;DRAWTEXT(XA_57,DIF-30.5,106),COLOR0055FF;DRAWTEXT(XA_59,DIF*0.5,107),COLOR99FF00;XA_60:=3;XA_61:=EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2;XA_62:=EMA(XA_61,3)+EMA(0,2);XA_63:=REF(XA_61,XA_60)=HHV(XA_61,2*XA_60+1);XA_64:=FILTER(BB,XA_60) AND XA_61=HHV(XA_61,XA_60+1);XA_65:=BARSLAST(REF(XA_64,1));XA_66:=REF(CLOSE,XA_65+1)<CLOSE AND REF(XA_61,XA_65+1)>XA_61 AND XA_64;DRAWTEXT(XA_66,XA_61*1.2,108),COLORGREEN;DRAWICON(XA_66>0,XA_61*1.2,2);XA_67:=REF(XA_61,XA_60)=LLV(XA_61,2*XA_60+1);XA_68:=BACKSET(XA_67,XA_60+1);XA_69:=FILTER(XA_68,XA_60) AND XA_61=LLV(XA_61,XA_60+1);XA_70:=BARSLAST(REF(XA_69,1));XA_71:=REF(CLOSE,XA_70+1)>CLOSE AND REF(XA_61,XA_70+1)<XA_61;XA_72:=HHVBARS(MACD,BARSLAST(MACD<0)+1);XA_73:=CROSS(BACKSET(CROSS(0,MACD),REF(XA_72,1)+2),0.5);XA_74:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(XA_72,1) +2),0.5);XA_75:=DRAWLINE(XA_73,MACD,REF(XA_73,1),REF(MACD,1),1);XA_76:=LLVBARS(MACD,BARSLAST(MACD>0)+1);XA_77:=CROSS(BACKSET(CROSS(MACD,0),REF(XA_76,1)+2),0.5);XA_78:=DRAWLINE(XA_77,MACD,REF(XA_77,1),REF(MACD,1),1);XA_79:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(CLOSE)));XA_80:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),BARSCOUNT(CLOS E)),DRAWNULL);XA_81:=BARSLAST(XA_80);XA_82:=FILTERX(MACD<CONST(LLV(MACD,XA_79+1)),BARSCOUNT(CLOSE));XA_83:=BARSLAST(XA_82);XA_84:=IF(XA_79+1>=1,CONST(LLV(MACD,XA_79+1)),DRAWNULL);XA_85:=CROSS(COUNT(CROSS(MACD>XA_84/2 AND MACD<0,0.5),XA_81)=1,0.5) AND XA_81>=0;XA_86:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,IF (FILTERX(XA_74,BARSCOUNT(CLOSE)),2,DRAWNULL));XA_87:=XA_86=1 OR XA_86=2 AND MACD>0;XA_88:=FILTERX(XA_87,BARSCOUNT(CLOSE));XA_89:=DRAWLINE(XA_88,MACD,REF(XA_88,1),REF(MACD,1),1);XA_90:=CROSS(COUNT(CROSS(MACD<XA_89/2 AND MACD>0,0.5),XA_88)=1,0.5) AND XA_88>=0;STICKLINE(MACD>XA_75,MACD,XA_75,0,0),COLORWHITE;STICKLINE(MACD<0 AND MACD<XA_78 AND XA_78<0,MACD,XA_78,0,0),COLORWHITE; DRAWICON(CROSS(DIF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIF),DEA,2);底:ABS((CROSS(MACD.DIF,MACD.DEA) AND MACD.DEA<=(-0.07))*MACD.DIF)*1.5,COLO RLIMAGENTA;DRAWTEXT(ABS(底)>0,底-25,109),COLORYELLOW;XA_91:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(XA_91,3,1),COLORWHITE;D:SMA(K,3,1),COLOR00DDDD;J:3*K-2*D,COLOR800080;DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;XA_92:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01) /100);XA_93:=IF(CLOSE=INDEXC,XA_92+INDEXC-INDEXL,XA_92+(CLOSE-LOW));XA_94:=IF(CLOSE=INDEXC,INDEXL+INDEXC-XA_92,LOW+(CLOSE-XA_92));今压:REF(XA_93,1),COLORAA11BB,LINETHICK0;今撑:REF(XA_94,1),COLOR009900,LINETHICK0;明压:XA_93,LINETHICK0;明撑:XA_94,LINETHICK0;XA_95:=(HHV(HIGH,9.8)-CLOSE)/(HHV(HIGH,9.8)-LLV(LOW,9.8))*101;XA_96:=SMA(XA_95,3,1);XA_97:=SMA(XA_96,3,1);XA_98:=3*XA_96-2*XA_97;XA_99:=IF(XA_98>=100,100,IF(XA_98<=0,0,XA_98));明天买:IF(XA_99=100,0-10,0),COLOR00CCCC;明天卖:IF(XA_99=0,90,100),COLORGREEN;XA_100:=250;XA_101:=HHV(K,XA_100);XA_102:=HHV(D,XA_100);XA_103:=HHV(J,XA_100);XA_104:=LLV(K,XA_100);XA_105:=LLV(D,XA_100);XA_106:=LLV(J,XA_100);XA_107:=MAX(XA_101,MAX(XA_102,XA_103));XA_108:=MIN(XA_104,MIN(XA_105,XA_106));XA_109:=(XA_107+XA_108)/2;XA_110:=XA_107-XA_108;XA_111:=HHV(DIFF,XA_100);XA_112:=HHV(DEA,XA_100);XA_113:=HHV(MACD,XA_100);XA_114:=LLV(DIFF,XA_100);XA_115:=LLV(DEA,XA_100);XA_116:=LLV(MACD,XA_100);XA_117:=MAX(XA_111,MAX(XA_112,XA_113));XA_118:=MIN(XA_114,MIN(XA_115,XA_116));XA_119:=(XA_117-XA_118)/100;XA_120:=XA_117-XA_118;XA_121:=(0-XA_119)*(XA_110/XA_120)+XA_109;XA_122:=(DIFF-XA_119)*(XA_110/XA_120)+XA_109;XA_123:=(DEA-XA_119)*(XA_110/XA_120)+XA_109;XA_124:=(MACD-XA_119)*(XA_110/XA_120)+XA_109;XA_125:=MACD<REF(MACD,1) AND MACD>0;XA_126:=MACD>=REF(MACD,1) AND MACD>0;XA_127:=MACD>REF(MACD,1) AND MACD<0;XA_128:=MACD<=REF(MACD,1) AND MACD<0;STICKLINE(XA_125,XA_121,XA_124,2.7,0),COLOR00AAFF;STICKLINE(XA_125,XA_121,XA_124,2.6,0),COLOR0066AA;STICKLINE(XA_125,XA_121,XA_124,2.5,0),COLOR0099DD;STICKLINE(XA_125,XA_121,XA_124,1.3,0),COLOR00BBEE;STICKLINE(XA_126,XA_121,XA_124,2.7,0),COLOR0000AA;STICKLINE(XA_126,XA_121,XA_124,2.6,0),COLOR0011BB;STICKLINE(XA_126,XA_121,XA_124,2.5,0),COLOR0022CC;STICKLINE(XA_126,XA_121,XA_124,1.3,0),COLOR0033DD;STICKLINE(XA_127,XA_121,XA_124,2.7,0),COLORAA00BB;STICKLINE(XA_127,XA_121,XA_124,2.6,0),COLORBB1177;STICKLINE(XA_127,XA_121,XA_124,2.5,0),COLORCC2299;STICKLINE(XA_127,XA_121,XA_124,1.3,0),COLORDD33AA;STICKLINE(XA_128,XA_121,XA_124,2.7,0),COLORFF7700;STICKLINE(XA_128,XA_121,XA_124,2.6,0),COLORAA7711;STICKLINE(XA_128,XA_121,XA_124,2.5,0),COLORCC9922;STICKLINE(XA_128,XA_121,XA_124,1.3,0),COLOREEBB33;涨:IF(XA_122>0,XA_122,DRAWNULL),COLOR0055FF;跌:IF(XA_122<0,XA_122,DRAWNULL),COLOR0055FF;涨2:IF(XA_123>0,XA_123,DRAWNULL),COLORGREEN;跌2:IF(XA_123<0,XA_123,DRAWNULL),COLORGREEN;XA_129:=(HIGH+LOW+CLOSE)/3;STICKLINE(DIFF>REF(DIFF,1),20,20,2,0),COLORRED;STICKLINE(DIFF<REF(DIFF,1),20,20,2,0),COLORGREEN;STICKLINE(K>=REF(K,1) OR K>D AND DIFF>REF(DIFF,1),80,80,2,1),COLORRED; STICKLINE(K<REF(K,1),80,80,2,1),COLORGREEN;DRAWTEXT(XA_52,XA_124*0.82,110),COLORYELLOW;XA_130:=EMA(MA(LOW,3)*0.96,30);XA_131:=IF(CROSS(DIFF,DEA) AND XA_130-REF(XA_130,1)>0 AND MACD>=REF(MACD, 1) AND DIFF<=0,1,0);DRAWTEXT(XA_131=1,XA_122*1.68,111),COLORCDFFBB;DRAWTEXT(XA_53,XA_123*0.99,112),COLOR0099DD;XA_132:=BARSLAST(REF(CROSS(DIFF,DEA),1));XA_133:=REF(CLOSE,XA_132+1)>CLOSE AND DIFF>REF(DIFF,XA_132+1) AND CROSS (DIFF,DEA);DRAWTEXT(XA_133,XA_123*0.99-16,113),COLOR0099FF;XA_134:=BARSLAST(REF(CROSS(DEA,DIFF),1));XA_135:=REF(CLOSE,XA_134+1)<CLOSE AND REF(DIFF,XA_134+1)>DIFF AND CROSS (DEA,DIFF);DRAWTEXT(FILTER(XA_135,5),XA_123*1.02,114),COLORDDAAAA;XA_136:=MACD.DIF#WEEK;XA_137:=MACD.DEA#WEEK;XA_138:=FILTER(CROSS(XA_136,XA_137),0);XA_139:=FILTER(CROSS(XA_137,XA_136),0);M周金叉:IF(CROSS(MACD.DIF#WEEK,MACD.DEA#WEEK),(-50),0),COLORRED,LINETHICK 2;DRAWTEXT(XA_138,(-45),115),COLORRED;M周死叉:IF(CROSS(MACD.DEA#WEEK,MACD.DIF#WEEK),(-50),0),COLORGREEN,LINETHIC K2;DRAWTEXT(XA_139,DIF-0.5,116),COLORGREEN;XA_140:=MACD.DIF#MONTH;XA_141:=MACD.DEA#MONTH;XA_142:=FILTER(CROSS(XA_140,XA_141),0);XA_143:=FILTER(CROSS(XA_141,XA_140),0);M月金叉:IF(CROSS(MACD.DIF#MONTH,MACD.DEA#MONTH),(-60),0),COLORYELLOW,LINE THICK2;DRAWTEXT(XA_142,(-35),117),COLORYELLOW;M月死叉:IF(CROSS(MACD.DEA#MONTH,MACD.DIF#MONTH),(-60),0),COLORFF6600,LINET HICK2;DRAWTEXT(XA_143,(-35),118),COLORFF6600;XA_144:=SKDJ.K#WEEK;XA_145:=SKDJ.D#WEEK;XA_146:=FILTER(CROSS(XA_144,XA_145),0);XA_147:=FILTER(CROSS(XA_145,XA_144),0);K周金叉:IF(CROSS(KDJ.K#WEEK,KDJ.D#WEEK),50,0),COLORRED,LINETHICK2; DRAWTEXT(XA_146,50,119),COLORGREEN;K周死叉:IF(CROSS(KDJ.D#WEEK,KDJ.K#WEEK),50,0),COLORGREEN,LINETHICK2; DRAWTEXT(XA_147,50,120),COLORGREEN;XA_148:=KDJ.K#MONTH;XA_149:=KDJ.D#MONTH;XA_150:=FILTER(CROSS(XA_148,XA_149),0);XA_151:=FILTER(CROSS(XA_149,XA_148),0);K月金叉:IF(CROSS(KDJ.K#MONTH,KDJ.D#MONTH),60,0),COLORYELLOW,LINETHICK2; DRAWTEXT(XA_150,60,121),COLORYELLOW;K月死叉:IF(CROSS(KDJ.D#MONTH,KDJ.K#MONTH),60,0),COLORFF6600,LINETHICK2; DRAWTEXT(XA_151,60,122),COLORFF6600;XA_152:=BARSLAST(REF(CROSS(K,D),1));XA_153:=REF(CLOSE,XA_152+1)>CLOSE AND REF(K,XA_150+1)<K AND CROSS(K,D); XA_154:=IF(FILTER(XA_153>0,5),1,0);DRAWTEXT(XA_154=1,D*0.98,123),COLORDDDDDD;XA_155:=BARSLAST(REF(CROSS(D,K),1));XA_156:=REF(CLOSE,XA_155+1)<CLOSE AND REF(K,XA_155+1)>K AND CROSS(D,K); DRAWTEXT(FILTER(XA_156>0,5),D+8,114),COLORFFAA22;XA_157:=MA(CLOSE,80)-MA(CLOSE,13)/3;XA_158:=MA((CLOSE-XA_157)/XA_157,3);XA_159:=CROSS(XA_158,0) AND LOW/REF(HIGH,1)<1.012 AND J<75 AND J>REF(J,1); XA_160:=MA(CLOSE,12);XA_161:=IF(FILTER(MACD>=REF(MACD,5) AND OPEN<=REF(CLOSE,1) AND XA_130-RE F(XA_130,1)>0 AND MACD<=0 AND XA_160-REF(XA_160,1)>=0,3) AND J<80 AND J> REF(J,1) AND D>REF(D,1) AND (DIFF>=REF(DIFF,1) OR DEA>=REF(DEA,1)),1,0); DRAWTEXT(XA_161=1,XA_124*0.98,124),COLOR0099FF;XA_162:=EMA(CLOSE,2)-EMA(OPEN,5);XA_163:=IF(CROSS(XA_162,MACD) AND LOW<=XA_130 AND MACD<=0-0.11 AND (J< 20 OR K<20),1,0);DRAWTEXT(FILTER(XA_163,3),0,125),COLOR00CC00;XA_164:=MA(CLOSE,10);XA_165:=EMA(MA(HIGH,3)*1.05,30);XA_166:=IF(FILTER(0.7*(CROSS(DIFF,DEA) AND CLOSE<XA_165 AND XA_130-REF(XA_ 130,1)>0 AND CROSS(MACD,0) AND MACD>=0 AND DIFF>0 AND XA_164-REF(XA_164, 1)>0 AND VOL>REF(VOL,1))>=0.7 AND (CLOSE<XA_165 AND XA_130-REF(XA_130,1)> 0),5) AND J<80,1,0);DRAWTEXT(XA_166=1,XA_124*0.98,126),COLORCDFFDD;XA_167:=IF(COUNT(XA_158>REF(XA_158,1),3)=3 AND COUNT(XA_158<0,10)=10 AND REF(XA_158,3)=LLV(XA_158,10) AND J<80 AND J>REF(J,1),1,0);DRAWTEXT(XA_167=1,J,127),COLORFF00CC;XA_168:=REF(XA_158,2)=LLV(XA_158,20) AND REF(XA_158,2)<0.071 AND REF(XA_158, 2)<REF(XA_158,1) AND NOT(REF(LOW,1)>REF(HIGH,2) AND LOW>REF(HIGH,1)) AND C LOSE>REF(CLOSE,1) AND J<75 AND J>REF(J,1);DRAWTEXT(XA_159 OR XA_168,D-1,128),COLORCYAN;XA_169:=(INTPART(SMA(XA_91,3,1))+INTPART(SMA(K,3,1)))/2;XA_170:=CROSS(XA_169,50) AND J<95 AND DIFF>REF(DIFF,1) AND LOW<REF(CLOSE, 1);DRAWTEXT(XA_170,D*0.6,129),COLORCYAN;。

MACD交易系统通达信指标公式源码

MACD交易系统通达信指标公式源码

1.股价高于平均线,视为强势;股价低于平均线,视为弱势2.平均线向上涨升,具有助涨力道;平均线向下跌降,具有助跌力道;3.二条以上平均线向上交叉时,买进;4.二条以上平均线向下交叉时,卖出;5.移动平均线的信号经常落后股价,若以EXPMA 、VMA 辅助,可以改善。

总涨跌比:=DYNAINFO(60)/(DYNAINFO(60)+DYNAINFO(61))*100,COLORCYAN,NODRAW; DRAWTEXT_FIX(1,0.2,0.0,0,STRCAT('总涨跌比: ',CON2STR(总涨跌比,2))),COLORCYAN; DRAWTEXT_FIX(ISLASTBAR,0.005,0,0,STRCAT('主营同比:',CON2STR(FINANCE(44),2))),COLORGREEN;DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,STRCAT('利润同比:',CON2STR(FINANCE(43),2))),COLORGREEN;SBL:= STRCAT(STRCAT(STRCAT(HYBLOCK,DYBLOCK),GNBLOCK),ZDBLOCK); DRAWTEXT_FIX(1,0.4,0,0,SBL),COLOR0090FF;DIF:=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);DEA:=EMA(DIF,M);MACD:=2*(DIF-DEA);KK:=IF(DIF>DEA,5,-5);JCSC:=(M-1)/(M+1)*DEA/(1-2/(M+1));{计算出金叉死叉时的DIFF值}DD:=(MACD/2+(DEA*(M-1)/(M+1)))/(1-2/(M+1));{计算出明日MACD=MACD时的DIFF 值}DIF拐头价:(DIF*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*(L ONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1)))COLORGREEN,LINETHICK1,POINTD OT;金死叉价:(JCSC*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*( LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1))),NODRAW;柱变向价:=(DD*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*( LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1))),COLORYELLOW,POINTDOT;黄铢消失见顶:=IF(柱变向价>=DIF拐头价,柱变向价,DRAWNULL),COLORYELLOW,CIRCLEDOT,LINETHICK1;拐头价:IF(DIF拐头价<柱变向价,DIF拐头价,DRAWNULL), COLORRED,LINETHICK4; DRAWNUMBER(DIF<DEA,DIF拐头价,BARSLAST(CROSS(DEA,DIF))+1),COLORCYAN,NODRAW;DRAWNUMBER(DIF>DEA,DIF拐头价,BARSLAST(CROSS(DIF,DEA))+1),COLORWHITE,NODRAW;ZJ:拐头价,COLOR0000FF;HY:=金死叉价,COLORFF00FF;IF(ZJ > REF(ZJ,1),ZJ,DRAWNULL),COLORRED,LINETHICK2;IF(ZJ < REF(ZJ,1),ZJ,DRAWNULL),COLORGREEN,LINETHICK2;IF(HY > REF(HY,1),HY,DRAWNULL),COLORMAGENTA,LINETHICK2,NODRAW;IF(HY < REF(HY,1),HY,DRAWNULL),COLORBLUE,LINETHICK2,NODRAW; STICKLINE(C>ZJ AND C>O,H,C,0,0 ),COLORRED;STICKLINE(C>ZJ AND C>O,L,O,0,0 ),COLORRED;STICKLINE(C>ZJ AND C>O,O,C,2.8,1),COLORRED;STICKLINE(C>ZJ AND C<=O,H,L,0,0 ),COLORRED;STICKLINE(C>ZJ AND C<=O,O,C,2.8,0),COLORRED;STICKLINE(CLOSE = ZJ,H,L,3,0),COLORWHITE;STICKLINE(CLOSE < ZJ,H,L,0,0),COLORYELLOW;STICKLINE(CLOSE < ZJ,O,C,2.5,0),COLORYELLOW;STICKLINE(C<HY AND C>O,H,C,0,0),COLORCYAN;STICKLINE(C<HY AND C>O,O,L,0,0),COLORCYAN;STICKLINE(C<HY AND C>O,O,C,2.8,1),COLORCYAN;STICKLINE(C<HY AND C<=O,H,L,0,0),COLORCYAN;STICKLINE(C<HY AND C<=O,O,C,2.8,0),COLORCYAN;HD0:=CROSS(DIF,DEA);金收:REF(L,BARSLAST(HD0)),COLORYELLOW,DOTLINE;DRAWNUMBER(ISLASTBAR,金收,金收),COLORCYAN;LD0:=CROSS(DEA,DIF);死收:REF(H,BARSLAST(LD0)),COLOR00FF00,DOTLINE;{分时中的收盘标记}IF(HOUR=15,H*1.008,DRAWNULL),POINTDOT,COLORFFFAAA,LINETHICK9; IF(HOUR=15,H*1.008,DRAWNULL),POINTDOT,COLOR000FFF,LINETHICK5; HSL:=V/CAPITAL*100;DRAWNUMBER(CURRBARSCOUNT=1 AND HSL,C,HSL),COLOR00FFFF;分时均价:AMOUNT/VOL/100,COLORWHITE,NODRAW;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档