编程思路破译 VOLUME赋值:成交量(手),VOLSTICK MAVOL5赋值:VOLUME的5日简单移动平均 MAVOL21赋值:VOLUME的21日简单移动平均 MAVOL65赋值:VOLUME的65日简单移动平均 当满足条件MAVOL5上穿MAVOL21时,在5和8位置之间画柱状线,宽度为2,0不为0则画空心柱.,画白色 周DIF赋值:("平滑异同平均线的DIF[取周线数据]") 周DEA赋值:("平滑异同平均线的DEA[取周线数据]") 周MACD赋值:2*(周DIF-周DEA) DIFF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均 DEA赋值:DIFF的9日指数移动平均,COLORFFFF00 MACD赋值:(DIFF-DEA)*2 输出A1:上次DIFF<1日前的DIFF距今天数,COLOR00FFFF,线宽为1 输出A11:A1*-1,COLOR00FFFF,线宽为1 输出A2:上次DEA<1日前的DEA距今天数,画红色,线宽为1 输出A22:A2*-1,画红色,线宽为1 画带状线 画带状线 当满足条件周MACD>1日前的周MACDAND周MACD>0时,在-5和5位置之间画柱状线,宽度为18,0不为0则画空心柱.,画红色 当满足条件周MACD<1日前的周MACDAND周MACD>0时,在-5和5位置之间画柱状线,宽度为18,0不为0则画空心柱.,画黄色 当满足条件周MACD>1日前的周MACDAND周MACD<0时,在-5和5位置之间画柱状线,宽度为18,0不为0则画空心柱.,画淡红色 当满足条件周MACD<1日前的周MACDAND周MACD<0时,在-5和5位置之间画柱状线,宽度为18,0不为0则画空心柱.,画蓝色 当满足条件MACD>1日前的MACDANDMACD>0时,在-3和3位置之间画柱状线,宽度为3.5,1不为0则画空心柱.,画红色 当满足条件MACD>1日前的MACDANDMACD<0时,在-3和3位置之间画柱状线,宽度为3.5,1不为0则画空心柱.,画淡红色 当满足条件MACD<1日前的MACDANDMACD>0时,在-3和3位置之间画柱状线,宽度为3.5,1不为0则画空心柱.,画黄色 当满足条件MACD<1日前的MACDANDMACD<0时,在-3和3位置之间画柱状线,宽度为3.5,1不为0则画空心柱.,画蓝色 DIIFF赋值:(A1的5日指数移动平均 - A1的10日指数移动平均) DEAA赋值:DIIFF的3日指数移动平均 K线动能赋值:(DIIFF-DEAA),画黄色 当满足条件(K线动能>0)时,在-1和1位置之间画柱状线,宽度为1.5,0不为0则画空心柱.,COLOR0000FF 当满足条件(K线动能<0)时,在-1和1位置之间画柱状线,宽度为1.5,0不为0则画空心柱.,COLOR00FF00 当满足条件DIFF上穿DEA时,在0和0.04位置之间画柱状线,宽度为5,1不为0则画空心柱.,画黄色 当满足条件DIFF上穿DEA时,在0.04和0.08位置之间画柱状线,宽度为5,0不为0则画空心柱.,画红色 当满足条件DIFF上穿DEA时,在0.08和0.12位置之间画柱状线,宽度为5,1不为0则画空心柱.,画黄色 当满足条件DIFF上穿DEA时,在0.12和0.16位置之间画柱状线,宽度为4,1不为0则画空心柱.,画红色 当满足条件DIFF上穿DEA时,在0.16和0.2位置之间画柱状线,宽度为3,1不为0则画空心柱.,画红色 当满足条件DIFF上穿DEA时,在0.2和0.24位置之间画柱状线,宽度为2,0不为0则画空心柱.,画白色 当满足条件DIFF上穿DEAANDDIFF<0时,在A11和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色 当满足条件DIFF上穿DEAANDDIFF>0时,在0和A1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色 当满足条件DEA上穿DIFFANDDIFF<0时,在A11和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色 当满足条件DEA上穿DIFFANDDIFF>0时,在0和A1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色 输出MACD底背离: 当满足条件A1+1日前的收盘价>CLOSEANDDIFF>A1+1日前的DIFFANDCROSS(DIFF,DEA)时,在-25和25位置之间画柱状线,宽度为0.00001,0不为0则画空心柱.,画黄色 当满足条件A1>0ANDA2>0时,在A2和A1位置之间画柱状线,宽度为0.00001,0不为0则画空心柱.,COLORFFFFFF 当满足条件A1>0ANDA2>0时,在A22和A11位置之间画柱状线,宽度为0.00001,0不为0则画空心柱.,COLORFFFFFF 当满足条件A1>0ANDA2>0时,在0和A1位置之间画柱状线,宽度为0.000001,0不为0则画空心柱.,COLORFF00FF 当满足条件A1>0ANDA2>0时,在0和A11位置之间画柱状线,宽度为0.000001,0不为0则画空心柱.,画绿色 当满足条件DIFF上穿DEAANDDIFF<0时,在-5位置书写文字,画青色 当满足条件DIFF上穿DEAANDDIFF<0时,在-12位置书写文字,画青色 当满足条件DIFF上穿DEAANDDIFF>0时,在5位置书写文字,画绿色 当满足条件DIFF上穿DEAANDDIFF>0时,在12位置书写文字,画绿色 当满足条件A2>A1ANDA22<A11ANDA1=0ANDA11=0时,在A2位置书写文字,画绿色 当满足条件A2>A1ANDA22<A11ANDA1=0ANDA11=0时,在0位置书写文字,画绿色 当满足条件A2>A1ANDA22<A11ANDA1=0ANDA11=0时,在A22位置书写文字,画绿色 当满足条件DIFF上穿DEAANDDIFF<0时,在A11和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色 当满足条件DIFF上穿DEAANDDIFF>0时,在0和A1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色 当满足条件DEA上穿DIFFANDDIFF<0时,在A11和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色 当满足条件DEA上穿DIFFANDDIFF>0时,在0和A1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画蓝色 N赋值:5 M1赋值:5 RSV赋值:(收盘价-N日内最低价的最低值)/(N日内最高价的最高值-N日内最低价的最低值)*100 K赋值:RSV的5日[1日权重]移动平均 D赋值:K的M1日[5日权重]移动平均 J赋值:3*K-2*D VARB2赋值:(RSV/2+22)*1 量赋值:成交量(手)的13日指数移动平均 资金赋值:成交额(元)的13日指数移动平均 过滤赋值:((资金 /量) / 100) 提纯赋值:(((收盘价 -过滤) / 过滤) * 100) 黄金赋值:((提纯 < (0))) 低买赋值:如果黄金ANDRSV<VARB2-2,返回50,否则返回0 高卖赋值:如果黄金ANDRSV>VARB2,返回80,否则返回120 上涨分界赋值:25 输出KDJ提前金叉:(上涨分界上穿低买),COLORFF00FF,NODRAW 当满足条件KDJ提前金叉时,在0位置书写文字,COLORFFFFFF 当满足条件1时,在横轴0.05纵轴0.02位置书写文字,画黄色 当满足条件1时,在横轴0.05纵轴0.07位置书写文字,画黄色 程序源码 VOLUME:=VOL,VOLSTICK; MAVOL5:=MA(VOLUME,5); MAVOL21:=MA(VOLUME,21); MAVOL65:=MA(VOLUME,65); STICKLINE(CROSS(MAVOL5,MAVOL21),5,8,2,0),COLORWHITE; 周DIF:=("MACD.DIF#WEEK"); 周DEA:=("MACD.DEA#WEEK"); 周MACD:=2*(周DIF-周DEA); DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIFF,9),COLORFFFF00; MACD:=(DIFF-DEA)*2; A1:BARSLAST(DIFF< REF(DIFF,1)),COLOR00FFFF,LINETHICK1; A11:A1*-1,COLOR00FFFF,LINETHICK1; A2:BARSLAST(DEA< REF(DEA,1)),COLORRED,LINETHICK1; A22:A2*-1,COLORRED,LINETHICK1; DRAWBAND(A2,RGB(150,50,20),A1,RGB(150,100,150)); DRAWBAND(A22,RGB(150,100,150),A11,RGB(150,50,20)); STICKLINE(周MACD>REF(周MACD,1) AND 周MACD>0,-5,5,18,0),COLORRED; STICKLINE(周MACD< REF(周MACD,1) AND 周MACD>0,-5,5,18,0),COLORYELLOW; STICKLINE(周MACD>REF(周MACD,1) AND 周MACD< 0,-5,5,18,0),COLORLIRED; STICKLINE(周MACD< REF(周MACD,1) AND 周MACD< 0,-5,5,18,0),COLORBLUE; STICKLINE(MACD>REF(MACD,1) AND MACD>0,-3,3,3.5,1),COLORRED; STICKLINE(MACD>REF(MACD,1) AND MACD< 0,-3,3,3.5,1),COLORLIRED; STICKLINE(MACD< REF(MACD,1) AND MACD>0,-3,3,3.5,1),COLORYELLOW; STICKLINE(MACD< REF(MACD,1) AND MACD< 0,-3,3,3.5,1),COLORBLUE; DIIFF:=(EMA(A1,5) - EMA(A1,10)); DEAA:=EMA(DIIFF,3); K线动能:=(DIIFF-DEAA),COLORYELLOW; STICKLINE((K线动能 > 0),-1,1,1.5,0),COLOR0000FF; STICKLINE((K线动能 < 0),-1,1,1.5,0),COLOR00FF00; STICKLINE(CROSS(DIFF,DEA),0,0.04,5,1),COLORYELLOW; STICKLINE(CROSS(DIFF,DEA),0.04,0.08,5,0),COLORRED; STICKLINE(CROSS(DIFF,DEA),0.08,0.12,5,1),COLORYELLOW; STICKLINE(CROSS(DIFF,DEA),0.12,0.16,4,1),COLORRED; STICKLINE(CROSS(DIFF,DEA),0.16,0.2,3,1),COLORRED; STICKLINE(CROSS(DIFF,DEA),0.2,0.24,2,0),COLORWHITE; STICKLINE(CROSS(DIFF,DEA) AND DIFF< 0,A11,0,2,0),COLORRED; STICKLINE(CROSS(DIFF,DEA) AND DIFF>0,0,A1,2,0),COLORRED; STICKLINE(CROSS(DEA,DIFF) AND DIFF< 0,A11,0,2,0),COLORBLUE; STICKLINE(CROSS(DEA,DIFF) AND DIFF>0,0,A1,2,0),COLORBLUE; MACD底背离: STICKLINE(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),-25,25,0.00001,0),COLORYELLOW; STICKLINE(A1>0 AND A2>0,A2,A1,0.00001,0),COLORFFFFFF; STICKLINE(A1>0 AND A2>0,A22,A11,0.00001,0),COLORFFFFFF; STICKLINE(A1>0 AND A2>0,0,A1,0.000001,0),COLORFF00FF; STICKLINE(A1>0 AND A2>0,0,A11,0.000001,0),COLORGREEN; DRAWTEXT(CROSS(DIFF,DEA) AND DIFF< 0,-5,'〇'),COLORCYAN; DRAWTEXT(CROSS(DIFF,DEA) AND DIFF< 0,-12,'〇'),COLORCYAN; DRAWTEXT(CROSS(DIFF,DEA) AND DIFF>0,5,'〇'),COLORGREEN; DRAWTEXT(CROSS(DIFF,DEA) AND DIFF>0,12,'〇'),COLORGREEN; DRAWTEXT(A2>A1 AND A22< A11 AND A1=0 AND A11=0,A2,'∈'),COLORGREEN; DRAWTEXT(A2>A1 AND A22< A11 AND A1=0 AND A11=0,0,'∈'),COLORGREEN; DRAWTEXT(A2>A1 AND A22< A11 AND A1=0 AND A11=0,A22,'∈'),COLORGREEN; STICKLINE(CROSS(DIFF,DEA) AND DIFF< 0,A11,0,2,0),COLORRED; STICKLINE(CROSS(DIFF,DEA) AND DIFF>0,0,A1,2,0),COLORRED; STICKLINE(CROSS(DEA,DIFF) AND DIFF< 0,A11,0,2,0),COLORBLUE; STICKLINE(CROSS(DEA,DIFF) AND DIFF>0,0,A1,2,0),COLORBLUE; N:=5; M1:=5; RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:=SMA(RSV,5,1); D:=SMA(K,M1,5); J:=3*K-2*D; VARB2:=(RSV/2+22)*1; 量:=EMA(VOL,13); 资金:=EMA(AMOUNT,13); 过滤:=((资金 /量) / 100); 提纯:=(((CLOSE -过滤) / 过滤) * 100); 黄金:=((提纯 < (0))); 低买:=IF(黄金 AND RSV< VARB2-2,50,0); 高卖:=IF(黄金 AND RSV>VARB2,80,120); 上涨分界:=25; KDJ提前金叉:(CROSS(上涨分界,低买)),COLORFF00FF,NODRAW; DRAWTEXT(KDJ提前金叉,0,'⊙'),COLORFFFFFF; DRAWTEXT_FIX(1,0.05,0.02,0,'【大池不红君莫入,大池变黄君莫贪】'),COLORYELLOW; DRAWTEXT_FIX(1,0.05,0.07,0,'【中池变黄小池绿,如在鱼尾逃命急】'),COLORYELLOW; 该公式包含未来函数:#WEEK 注: 馆内各种公式为学习编程而保存,实战使用前一定要看其中是否有未来函数并自己亲自测试成功率,决不能依据公式名称的描述和形容去投资,据此入市造成投资损失由投资者自己承担。 发文不易,如获益,欢迎赞赏,赞赏必复! |
|
来自: 追梦文库 > 《牛妖庄股黑马主力机构》