养家操盘通达信公式 主图 源码附图
平空开多:=CROSS(MACD,0);
平多开空:=CROSS(0,MACD);
BUYSHORT_BUY(平空开多,LOW);
SELL_SELLSHORT(平多开空,HIGH);
AUTOFILTER;
{智能交易}
VAR1:=(C+H+O+L)/4;
TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR:=MA(TR1,13);
VAR71:=REF(CLOSE,1)-REF(ATR,1);
LSX:=HHV(VAR1,13),LINETHICK1,COLORLIBLUE;
智能交易:HHV(VAR1,13)*0.95,DOTLINE,COLORWHITE ;
A:=AMOUNT/V/100;
VARA:=EMA((((A-EMA(A,13))/EMA(A,13))*(0-100)),5);
QQ:=EMA(((VARA/10)+EMA(A,13)),0);
行情线:=MA(A,1);
重心:=(C+0.618*REF(C,1)+0.382*REF(C,1)+0.236*REF(C,3)+0.146*REF(C,4))/2.382;
【操盘线】:EMA(((SLOPE(C,22)*20)+C),55),COLORYELLOW,LINETHICK4;
【黄金线】:IF(重心>=【操盘线】,【操盘线】,DRAWNULL),COLORRED,LINETHICK2;
【空仓线】:IF(重心<【操盘线】,【操盘线】,DRAWNULL),COLORCYAN,LINETHICK2;
DRAWTEXT(ISLASTBAR,【操盘线】,'【操盘线】'),COLORRED;
{引:EMA(CLOSE,2),LINETHICK1,COLORMAGENTA;
探:MA(CLOSE,5),LINETHICK1;}
变:EMA(CLOSE,5),LINETHICK1,COLORYELLOW;
金:IF(变>REF(变,1),变,DRAWNULL),COLORRED,LINETHICK1;
空:IF(变<REF(变,1),变,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(ISLASTBAR,变,'【雷达线】'),COLORRED;
{顶底信号}
DA:=(EMA(H,1)+EMA(L,1)+EMA(H,1)+EMA(H,1))/4;
DB:=EMA(REF(HHV(H,25),1),2),COLORGREEN,LINETHICK1;
{DRAWTEXT(CROSS(DB,DA),DB,'←险'),COLORGREEN,LINETHICK1;}
DRAWTEXT(CROSS(DA,【操盘线】),【操盘线】,'B'),COLORWHITE,LINETHICK1;
{涨跌停显示}
涨停:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(O,1)),1,0);
STICKLINE(涨停,O,C,1,0),COLORYELLOW;
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF<-9.9,O,C,1,0),COLORBLUE;
{民间操手专用经典主图均线指标2}
VAR3:=LLV(HIGH,240);
VAR4:=100*(CLOSE-VAR3)/VAR3;
VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
VAR7:=0;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
买1:=VAR10;
买2:=(VAR11+VAR13+VAR15+VAR17);
卖1:=(VAR12+VAR14+VAR16+VAR18);
B:IF(买1>0 OR 买2>0,LOW*0.99,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
S:IF(卖1>0,HIGH*1.01,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN;
VAR100:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));
VAR200:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));
VAR300:=(100 - MA(((100 * (HHV(HIGH,5) - CLOSE)) / (HHV(HIGH,5) - LLV(LOW,5))),34));
F:IF(CROSS(VAR200,MA(VAR300,5)),LOW * 0.98,DRAWNULL),CROSSDOT,LINETHICK3,COLORFF00FF;
DRAWTEXT(CROSS(S,卖1),S,'←逃'),COLORWHITE,LINETHICK1;
DRAWTEXT(CROSS(B,买1),B,'←准备'),COLORRED,LINETHICK1;
{价:}
{JC1:=(REF(C,3)+REF(C,5)+REF(C,7)+REF(C,8)+REF(C,13)+REF(C,21))/6;
参考价1:SMA(JC1,5,1),CIRCLEDOT,COLORGREEN;
IF(C>=参考价1,参考价1,DRAWNULL),CIRCLEDOT,COLOR0000FF;}
PH:=TROUGHBARS(2,5,1);
LL:=HHV(H,PH);
TJ1:=LL=HIGH AND LL<REF(LL,1);{//=1}
TS:=SUMBARS(TJ1,2);
TJ:=PEAKBARS(2,5,1)=1 AND TS>=PH;
DRAWICON(TJ,HIGH*1.01+0.02,2);
警告灯:IF(TJ,HIGH*1.008,DRAWNULL),CROSSDOT,LINETHICK2,COLORCYAN;
PL:=BARSLAST(TJ);
支撑:IF(BARSLAST(TJ1),
REF(LOW,BARSLAST(TJ1)),DRAWNULL),COLOREA91B5;
压力:IF(BARSLAST(TJ),REF(HIGH,PL),DRAWNULL),COLORYELLOW;
TJ_2:=LOW>REF(REF(LOW,TS),PL);
DRAWTEXT(ISLASTBAR,压力,'压力'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,支撑,'支撑'),COLOREA91B5;
{DRAWICON(COUNT(TJ_2,PL+1)=1,HIGH*1.005,2);{//向下的箭头表示出局点}
{DRAWICON(BARSLAST(TJ1),REF(LOW*0.995,BARSLAST(TJ1)),1);};
帮派资金:=SIGNALS_USER(509,0);
帮派:=ROUND(ABS(帮派资金-INTPART(SIGNALS_USER(509,0)))*100);
DRAWTEXT(帮派==10,H*1.01, VARCAT(' ↙ 温州帮 / ',VAR2STR(帮派资金,0)) ),COLORYELLOW;
DRAWTEXT(帮派==20,H*1.01, VARCAT(' ↙ 杭州帮 / ',VAR2STR(帮派资金,0))), COLORYELLOW;
DRAWTEXT(帮派==30,H*1.01, VARCAT(' ↙ 深圳帮 / ',VAR2STR(帮派资金,0))), COLORYELLOW;
DRAWTEXT(帮派==40,H*1.01, VARCAT(' ↙ 宁波帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==50,H*1.01, VARCAT(' ↙ 上海帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==60,H*1.01, VARCAT(' ↙ 山东帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==70,H*1.01, VARCAT(' ↙ 苏州帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==80,H*1.01, VARCAT(' ↙ 浙江帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==90,H*1.01, VARCAT(' ↙ 成都系/ ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==100,H*1.01, VARCAT(' ↙ 山东系/ ',VAR2STR(帮派资金,0))),COLORYELLOW;
DRAWTEXT(帮派==110,H*1.01, VARCAT(' ↙ 养家系',VAR2STR(帮派资金,0))),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
平空开多赋值:MACD上穿0
平多开空赋值:0上穿MACD
BUYSHORT_BUY(平空开多,最低价)
SELL_SELLSHORT(平多开空,最高价)
AUTOFILTER
{智能交易}
VAR1赋值:(C+H+O+L)/4
TR1赋值:MAX(MAX((最高价-最低价),1日前的CLOSE-最高价的绝对值),ABS(1日前的CLOSE-最低价))
ATR赋值:TR1的13日简单移动平均
VAR71赋值:1日前的CLOSE-1日前的ATR
LSX赋值:13日内VAR1最高值,LINETHICK1,COLORLIBLUE
输出智能交易:13日内VAR1最高值*0.95,DOTLINE,画白色
A赋值:AMOUNT/V/100
VARA赋值:EMA((((A-EMA(A,13))/EMA(A,13))*(0-100)),5)
QQ赋值:EMA(((VARA/10)+EMA(A,13)),0)
行情线赋值:A的1日简单移动平均
重心赋值:(C+0.618*1日前的C+0.382*1日前的C+0.236*3日前的C+0.146*4日前的C)/2.382
输出【操盘线】:EMA(((SLOPE(C,22)*20)+C),55),COLORYELLOW,LINETHICK4
如果重心>=【操盘线】返回【操盘线】否则返回DRAWNULL
如果重心<【操盘线】返回【操盘线】否则返回DRAWNULL
当满足条件ISLASTBAR时,在【操盘线】和'【操盘线】'位置书写文字
输出{引:CLOSE的2日指数移动平均,LINETHICK1,COLORMAGENTA
输出探:CLOSE的5日简单移动平均,LINETHICK1
输出}
变:CLOSE的5日指数移动平均,LINETHICK1,COLORYELLOW
输出金:IF(变>1日前的变,变,DRAWNULL),画红色,LINETHICK1
输出空:IF(变<1日前的变,变,DRAWNULL),画绿色,LINETHICK1
当满足条件ISLASTBAR时,在变和'【雷达线】'位置书写文字
{顶底信号}
DA赋值:(H的1日指数移动平均+L的1日指数移动平均+H的1日指数移动平均+H的1日指数移动平均)/4
DB赋值:EMA(REF(25日内H最高值,1),2),画绿色,LINETHICK1
{DRAWTEXT(DB上穿DA,DB,'←险'),画绿色,LINETHICK1
}
DRAWTEXT(DA上穿【操盘线】,【操盘线】,'B'),画白色,LINETHICK1
{涨跌停显示}
涨停赋值:IF((C-1日前的C)*100/1日前的C>=(10-0.01*100/1日前的O),1,0)
当满足条件涨停时,在O和C之间画柱状线
ZDF赋值:(C-1日前的C)/1日前的C*100
当满足条件ZDF<-9.9时,在O和C之间画柱状线
{民间操手专用经典主图均线指标2}
VAR3:=240日内最高价最低值
VAR4:=100*(CLOSE-VAR3)/VAR3
VAR5:=(CLOSE-528日内最低价最低值)/(528日内最高价最高值-528日内最低价最低值)*100
VAR6:=(CLOSE-530日内CLOSE最低值)/(530日内CLOSE最高值-530日内CLOSE最低值)*100
VAR7:=0
VAR8:=SMA(CLOSE-1日前的CLOSE和0较大值,34,1)/SMA(CLOSE-1日前的CLOSE的绝对值,7,1)*100
VAR9:=SMA(CLOSE-1日前的CLOSE和0较大值,13,1)/SMA(CLOSE-1日前的CLOSE的绝对值,13,1)*100
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND 最高价>最低价+0.04,4,0)
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3)
VAR12:=ZIG(3,6)[=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3)]
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3)
VAR14:=ZIG(3,22)[=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3)]
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3)
VAR16:=ZIG(3,51)[=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3)]
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3)
VAR18:=ZIG(3,72)[=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3)]
VAR19:=CLOSE的2日指数移动平均-CLOSE的150日指数移动平均
买1赋值:VAR10
买2赋值:(VAR11+VAR13+VAR15+VAR17)
卖1赋值:(VAR12+VAR14+VAR16+VAR18)
如果买1>0 OR 买2>0返回最低价*0.99否则返回DRAWNULL
如果卖1>0返回最高价*1.01否则返回DRAWNULL
VAR100:=(100 - ((90 * (20日内最高价最高值 - CLOSE)) / (20日内最高价最高值 - 20日内最低价最低值)))
VAR200:=(100 - ((90 * (20日内最高价最高值 - CLOSE)) / (20日内最高价最高值 - 20日内最低价最低值)))
VAR300:=(100 - MA(((100 * (5日内最高价最高值 - CLOSE)) / (5日内最高价最高值 - 5日内最低价最低值)),34))
输出F:IF(CROSS(VAR200,VAR300的5日简单移动平均),最低价 * 0.98,DRAWNULL),CROSSDOT, 线宽为3,COLORFF00FF
DRAWTEXT(S上穿卖1,S,'←逃'),画白色,LINETHICK1
DRAWTEXT(B上穿买1,B,'←准备'),画红色,LINETHICK1
{价:}
{JC1:=(3日前的C+5日前的C+7日前的C+8日前的C+13日前的C+21日前的C)/6
JC1的5日[1日权重]移动平均
如果C>=参考价1返回参考价1否则返回DRAWNULL
}
PH赋值:TROUGHBARS(2,5,1)
LL赋值:PH日内H最高值
TJ1赋值:LL=最高价 AND LL<1日前的LL
{//=1}
TS赋值:TJ1累加至2的天数
TJ赋值:PEAKBARS(2,5,1)=1 AND TS>=PH
当满足条件TJ时,在最高价*1.01+0.02和2之间画图标
如果TJ返回最高价*1.008否则返回DRAWNULL
PL赋值:上次TJ距今天数
输出支撑:IF(上次TJ1距今天数,
REF(最低价,上次TJ1距今天数),DRAWNULL),COLOREA91B5
输出压力:IF(上次TJ距今天数,PL日前的最高价,DRAWNULL),COLORYELLOW
TJ_2:=最低价>TS日前的最低价,PL)
当满足条件ISLASTBAR时,在压力和'压力'位置书写文字
当满足条件ISLASTBAR时,在支撑和'支撑'位置书写文字
{DRAWICON(统计PL+1日满足TJ_2的天数=1,最高价*1.005,2)
{//向下的箭头表示出局点}
{DRAWICON(上次TJ1距今天数,REF(最低价*0.995,上次TJ1距今天数),1)
}
帮派资金赋值:SIGNALS_USER(509,0)
帮派赋值:ROUND(帮派资金-INTPART(SIGNALS_USER(509,0的绝对值))*100)
DRAWTEXT(帮派==10,H*1.01, VARCAT(' ↙ 温州帮 / ',VAR2STR(帮派资金,0)) ),COLORYELLOW
DRAWTEXT(帮派==20,H*1.01, VARCAT(' ↙ 杭州帮 / ',VAR2STR(帮派资金,0))), COLORYELLOW
DRAWTEXT(帮派==30,H*1.01, VARCAT(' ↙ 深圳帮 / ',VAR2STR(帮派资金,0))), COLORYELLOW
DRAWTEXT(帮派==40,H*1.01, VARCAT(' ↙ 宁波帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==50,H*1.01, VARCAT(' ↙ 上海帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==60,H*1.01, VARCAT(' ↙ 山东帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==70,H*1.01, VARCAT(' ↙ 苏州帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==80,H*1.01, VARCAT(' ↙ 浙江帮 / ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==90,H*1.01, VARCAT(' ↙ 成都系/ ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==100,H*1.01, VARCAT(' ↙ 山东系/ ',VAR2STR(帮派资金,0))),COLORYELLOW
DRAWTEXT(帮派==110,H*1.01, VARCAT(' ↙ 养家系',VAR2STR(帮派资金,0))),COLORYELLOW