跟庄建仓B通达信公式 副图 源码附图
A1:=CAPITAL;
A2:=(((H + L) + O) + C) / 4;
A3:=(((INDEXH + INDEXL) + INDEXO) + INDEXC) / 4;
A4:=(A2 - (REF(A2,1))) / (REF(A2,1));
A5:=(A3 - (REF(A3,1))) / (REF(A3,1));
A6:=(((SUM(A4,10)) + (SUM(A5,10))) / 10) * 1000;
A7:=IF(((A6 > 0) AND (A6 < 75)),A6,(IF((A6 > 75),75,0)));
A8:=IF(((A6 < 0) AND (A6 > -75)),REVERSE(A6),(IF((A6 < -75),75,0)));
STICKLINE(A8,150,(150 - A8),3,1),COLOR825200;
STICKLINE(A7,150,(150 - A7),3,1),COLOR7A67CF;
{A9:=(VOL * (((A2 * 2) - HIGH) - LOW)) / (HIGH - LOW);
A10:=IF(((HIGH = LOW) AND (A2 < (REF(A2,1)))),(-1 * VOL),VOL);
A11:=IF((HIGH = LOW),A10,A9);
A12:=SUM(A11,11);
A13:=(A12 / (A1 * 11)) * 10000;
A14:=IF(((A13 < 150) AND (A13 > -150)),A13,150);
A15:=IF((A14 > 0),A14,0);
A16:=IF((A14 < 0),REVERSE(A14),0);
STICKLINE((A14 > 0),0,A15,3,1),COLORYELLOW;
STICKLINE((A14 < 0),0,A16,3,0),COLOR2E9F15;}
A17:=(SUM((A2 * VOL),16)) / (SUM(VOL,16));
A18:=(SUM((A2 * VOL),11)) / (SUM(VOL,11));
A19:=(SUM((A2 * VOL),6)) / (SUM(VOL,6));
A20:=((SUM((A2 * VOL),7)) - (A2 * VOL)) / ((SUM(VOL,7)) - VOL);
A21:=((A18 - A17) / A2) * 1000;
A22:=IF((A21 > 50),50,(IF((A21 < -50),-50,A21)));
A23:=((A19 - A18) / A2) * 1000;
A24:=IF((A23 > 50),50,(IF((A23 < -50),-50,A23)));
A25:=((((A19 - A20) / A20) * 5) / 4) * 1000;
A26:=IF((A25 > 50),50,(IF((A25 < -50),-50,A25)));
A27:=(A22 + A24) + A26;
红柱线:IF((A27 > 0),A27,0),COLOR003ADB,LINETHICK2;
兰柱线:IF((A27 < 0),REVERSE(A27),0),COLORE99A2C,LINETHICK2;
{A28:=IF((兰柱线 < 150),兰柱线,(IF((兰柱线 = 150),65,0)));
A29:=IF((兰柱线 = 150),60,0);
A30:=IF((红柱线 < 150),红柱线,(IF((红柱线 = 150),65,0)));
A31:=IF((红柱线 = 150),60,0);
A32:=(((红柱线 > (REF(红柱线,1))) AND (红柱线 > 49)) AND (CLOSE < (REF(CLOSE,1)))) AND ((OPEN < (REF(CLOSE,1))) OR ((OPEN = (REF(CLOSE,1))) AND ((HIGH / (REF(CLOSE,1))) < 1.02)));
DRAWICON(A32,90,9),COLORGREEN;}
{超跌短线买点:(兰柱线 = 150) AND ((CLOSE < OPEN) OR (CLOSE > OPEN)),COLORRED;
A33:=SUMBARS(VOL,(A1 * 0.8));
A34:=IF((A33 < 9),9,A33);
A35:=HHV(A2,A34);
A36:=LLV(A2,A34);
A37:=IF((A35 = A36),0,((100 * (A2 - A36)) / (A35 - A36)));}
{中趋势线:(1.5 * (SUM(A37,6))) / 6,LINETHICK2,COLORRED;
长趋势线:(SUM(中趋势线,6)) / 6,LINETHICK2,COLORGREEN;}
{A38:=((HIGH - A2) > (A2 - LOW)) OR ((HIGH = LOW) AND (LOW < (REF(CLOSE,1))));
A39:=FILTER(A38,5);}
A40:=EMA((((CLOSE - (LLV(LOW,25))) / ((HHV(HIGH,25)) - (LLV(LOW,25)))) * 4),4);
{DRAWTEXT((FILTER((A40 > 3.6),10)),155,'考虑出货'),COLORGREEN;}
{DRAWTEXT((FILTER((A40 < 0.25),5)),30,'考虑买入'),COLORRED;
A42:=(EMA((((CLOSE - (LLV(LOW,33))) / ((HHV(HIGH,21)) - (LLV(LOW,33)))) * 100),20)) * 0.998;
A43:=EMA(((0.667 * (REF(A42,1))) + (0.333 * A42)),1);
STICKLINE((A43 < 20),20,(20 + 20),4,0),COLORMAGENTA;
DRAWTEXT((超跌短线买点 = 1),60,'超跌短线买点'),COLORWHITE;
DRAWTEXT((A32 = 1),60,'超强短线买点'),COLORYELLOW;
买方能量:(A15),COLORYELLOW,LINETHICK1;};
{新加}
MACD:="MACD.MACD"(12,26,9)*25;
STICKLINE((MACD>0),MACD,0,3,1),COLOR003ADB,LINETHICK2;
STICKLINE((MACD < 0),MACD,0,3,1),COLORE99A2C,LINETHICK2;
STICKLINE(( "MACD.MACD"(12,26,9)>"MACD.DIF"(12,26,9) AND MACD < 0 ),MACD,0,3,1),COLORFF00FF,LINETHICK2;
DIF负:IF("MACD.DIF"(12,26,9)<0,兰柱线,DRAWNULL),COLORGREEN,LINETHICK2;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
A1赋值:当前流通股本
A2赋值:(((H + L) + O) + C) / 4
A3赋值:(((INDEXH + INDEXL) + INDEXO) + INDEXC) / 4
A4赋值:(A2 - (1日前的A2)) / (1日前的A2)
A5赋值:(A3 - (1日前的A3)) / (1日前的A3)
A6赋值:(((10的A4日累和) + (10的A5日累和)) / 10) * 1000
A7赋值:IF(((A6 > 0) AND (A6 < 75)),A6,(IF((A6 > 75),75,0)))
A8赋值:IF(((A6 < 0) AND (A6 > -75)),A6的相反数,(IF((A6 < -75),75,0)))
STICKLINE(A8,150,(150 - A8),3,1),COLOR825200
STICKLINE(A7,150,(150 - A7),3,1),COLOR7A67CF
{A9赋值:(成交量 * (((A2 * 2) - 最高价) - 最低价)) / (最高价 - 最低价)
A10:=IF(((最高价 = 最低价) AND (A2 < (1日前的A2))),(-1 * 成交量),成交量)
A11:=IF((最高价 = 最低价),A10,A9)
A12:=11的A11日累和
A13:=(A12 / (A1 * 11)) * 10000
A14:=IF(((A13 < 150) AND (A13 > -150)),A13,150)
A15:=IF((A14 > 0),A14,0)
A16:=IF((A14 < 0),A14的相反数,0)
STICKLINE((A14 > 0),0,A15,3,1),画黄色
STICKLINE((A14 < 0),0,A16,3,0),COLOR2E9F15
}
A17:=(SUM((A2 * 成交量),16)) / (SUM(成交量,16))
A18:=(SUM((A2 * 成交量),11)) / (SUM(成交量,11))
A19:=(SUM((A2 * 成交量),6)) / (SUM(成交量,6))
A20:=((SUM((A2 * 成交量),7)) - (A2 * 成交量)) / ((SUM(成交量,7)) - 成交量)
A21:=((A18 - A17) / A2) * 1000
A22:=IF((A21 > 50),50,(IF((A21 < -50),-50,A21)))
A23:=((A19 - A18) / A2) * 1000
A24:=IF((A23 > 50),50,(IF((A23 < -50),-50,A23)))
A25:=((((A19 - A20) / A20) * 5) / 4) * 1000
A26:=IF((A25 > 50),50,(IF((A25 < -50),-50,A25)))
A27:=(A22 + A24) + A26
输出
红柱线:IF((A27 > 0),A27,0),COLOR003ADB, 线宽为2
输出
兰柱线:IF((A27 < 0),A27的相反数,0),COLORE99A2C, 线宽为2
{A28赋值:IF((兰柱线 < 150),兰柱线,(IF((兰柱线 = 150),65,0)))
A29:=IF((兰柱线 = 150),60,0)
A30:=IF((红柱线 < 150),红柱线,(IF((红柱线 = 150),65,0)))
A31:=IF((红柱线 = 150),60,0)
A32:=(((红柱线 > (1日前的红柱线)) AND (红柱线 > 49)) AND (收盘价 < (1日前的收盘价))) AND ((开盘价 < (1日前的收盘价)) OR ((开盘价 = (1日前的收盘价)) AND ((最高价 / (1日前的收盘价)) < 1.02)))
当满足条件A32时,在90和9之间画图标
输出}
{超跌短线买点:(兰柱线 = 150) AND ((收盘价 < 开盘价) OR (收盘价 > 开盘价)),画红色
A33:=SUMBARS(成交量,(A1 * 0.8))
A34:=IF((A33 < 9),9,A33)
A35:=A34日内A2最高值
A36:=A34日内A2最低值
A37:=IF((A35 = A36),0,((100 * (A2 - A36)) / (A35 - A36)))
输出}
{中趋势线:(1.5 * (6的A37日累和)) / 6, 线宽为2,画红色
输出
长趋势线:(6的中趋势线日累和) / 6, 线宽为2,画绿色
}
{A38赋值:((最高价 - A2) > (A2 - 最低价)) OR ((最高价 = 最低价) AND (最低价 < (1日前的收盘价)))
A39:=A38的5过滤
}
A40:=EMA((((收盘价 - (25日内最低价最低值)) / ((25日内最高价最高值) - (25日内最低价最低值))) * 4),4)
{DRAWTEXT((FILTER((A40 > 3.6),10)),155,'考虑出货'),画绿色
}
{DRAWTEXT((FILTER((A40 < 0.25),5)),30,'考虑买入'),画红色
A42:=(EMA((((收盘价 - (33日内最低价最低值)) / ((21日内最高价最高值) - (33日内最低价最低值))) * 100),20)) * 0.998
A43:=EMA(((0.667 * (1日前的A42)) + (0.333 * A42)),1)
STICKLINE((A43 < 20),20,(20 + 20),4,0),画洋红色
DRAWTEXT((超跌短线买点 = 1),60,'超跌短线买点'),画白色
DRAWTEXT((A32 = 1),60,'超强短线买点'),画黄色
输出
买方能量:(A15),画黄色,LINETHICK1
}
{新加}
MACD赋值:"MACD.MACD"(12,26,9)*25
STICKLINE((MACD>0),MACD,0,3,1),COLOR003ADB, 线宽为2
STICKLINE((MACD < 0),MACD,0,3,1),COLORE99A2C, 线宽为2
STICKLINE(( "MACD.MACD"(12,26,9)>"MACD.DIF"(12,26,9) AND MACD < 0 ),MACD,0,3,1),COLORFF00FF, 线宽为2
输出
DIF负:IF("MACD.DIF"(12,26,9)<0,兰柱线,DRAWNULL),画绿色, 线宽为2