飞狐终极三明治2号副图、源码
本人经过N年学习、开发指标积累起来的一个综合性副图公式
里面有别人的基础公式,还有自己的多年的理念的结晶(比如我原先经典的十倍股指标:落井下石的未公开部分变种、军师与将军的变种指标就包含在这里)。今日心情好,特此奉上!
当年历时N个月的开发,好多功能现在自己都模糊~·呵~~
此公式本人曾经的爱不释手,是我的核心指标之一,如同落井下石一样。
N年前就发不过“三明治1号”,那个很简单;这次发得由于具备秒杀一切副图指标的潜质,就叫做:”终极三明治2号“吧 呵呵!
主要用途:中长线寻找底部区域、跟踪趋势。
原理和功能:乖离率、长期趋势追踪、中长线底部判断、顶部判断、主力控盘程度判断等。
所包含的别人的基础公式(大概的名字,不准确):乖离率和追踪、峰回路转。
所包含的我的指标:落井下石变种(醍醐灌顶)、军师和将军变种,以及各种信号的制作,优化,匹配。
简要用法:
1、黄色直方图:是一般性乖离率超跌区域,中长线买点必在其中。发出信号就是提示和预警准备买;如果是新股或者比较强悍的股票,可能发不出红色信号,那么以此作为买入信号。
2、红色直方图:强烈的乖离率超跌区域,中长线买点必然在其中。
3、娃娃脸和灰色柱子:柳暗花明信号。对中长线买点的二次确认。(我的实盘的指标都是N次确认型的,成功率颇高)
4、红色三角形:军师信号的连续识别,对中长线买点的三次确认。(不知道啥是军师信号,参照我的指标:《军师与将军》)
5、黄色三角形:趋势向上的连续统计,按天计算。
6、黄色三角形上方的曲线:落井下石指标的醍醐灌顶信号,预示顶部的来临。白色是一般性顶部,红色是强烈超买的顶部。
7、蓝色直方图:主力控盘拉升程度。
8、白线:乖离率曲线。0轴以下是弱势区域,买点都在0轴下方。
凡我发指标,必属精品!!!
源码(飞狐only):
{终极三明治2号 Designed and Modified by 老大7777 Published at 2012.10.3}
input:x(50,1,111);
input:y(1,1,111);
控盘筹码:if((0.1-winner(c/1.1))*100<0,(0.1-winner(c/1.1))*200,0),coloryellow,linethick0,colorblue;
stickline(控盘筹码<0,0,控盘筹码,1,0),colorblue;
-120,colorgray;
乖离率:(c-ma(c,250))/ma(c,250)*100;
n1:=barslast(cross(c,MA(c,250)));
n2:=barslast(cross(MA(c,250),c));
长期趋势:if(n1<n2,n1+1,0);
长涨幅:(c-ref(c,长期趋势))/ref(c,长期趋势)*100,colorgreen,linethick0;
n3:=barslast(cross(c,MA(c,20)));
n4:=barslast(cross(MA(c,20),c));
{落井下石}
醍醐灌顶:=if(c/llv(c,500)>8 or c/llv(c,1000)>20.5 and c>ema(c,60) and c>ema(c,437),1,0),colorgreen,linethick0;
stickline(醍醐灌顶,长涨幅,长涨幅*0.93,5,0),colorwhite;
醍醐灌顶1:=if(c/llv(c,1900)>20.5 or c/llv(c,1000)>20.5 and c>ema(c,60) and c>ema(c,437),1,0),colorgreen,linethick0;
stickline(醍醐灌顶1,长涨幅,长涨幅*0.94,3,0),colorred;
////////////////
买入区域:if((乖离率<-26 and ema(c,37)<ref(ema(c,37),43) and c<ema(c,57) and c<ema(c,199)) or 乖离率<-35,1,0),colorred,linethick0;
stickline(买入区域,-乖离率*乖离率/7,0,3,0),coloryellow;
stickline(乖离率<-35,-乖离率*乖离率/7,0,3,0),colorred;
0,colorblue,linethick1;
股龄:(BARSCOUNT(close)),colorwhite,linethick0;
买入求和:if(股龄<300,sum(买入区域,70),sum(买入区域,233)),colorgreen,linethick0;
{军师}
{成本}
a1:=cost(95);
a2:=cost(85);
a3:=cost(75);
a4:=cost(65);
a5:=cost(55);
a6:=cost(45);
a9:=cost(15);
a10:=cost(10);
a11:=cost(8);
a12:=cost(6);
a13:=cost(4);
a14:=cost(2);
b1:=ma(a1,x);
b2:=ma(a2,x);
b3:=ma(a3,x);
b4:=ma(a4,x);
b5:=ma(a5,x);
b6:=ma(a6,x);
b9:=ma(a9,x);
b10:=ma(a10,x);
b11:=ma(a11,x);
b12:=ma(a12,x);
b13:=ma(a13,x);
b14:=ma(a14,x);
dis1:=a1-a14;
dis2:=a2-a13;
dis3:=a3-a12;
dis4:=a4-a11;
dis5:=a5-a10;
dis6:=a6-a9;
dis0:=(a1+a2+a3+a4+a5+a6)/6;
dis00:=ma(dis0,49),linethick3,colorblue;
向下:=if(dis00<ref(dis00,Y),1,0);
一直向上:=if(count(向下,60)<30,1,0);
红色将军:=if(b14>=ref(b14,y)and b13 >= ref(b13,y) and b12 >= ref(b12,y) and b11 >= ref(b11,y) and b10 >= ref(b10,y) and 一直向上,1,0);
绿色军师:=if(b1<=ref(b1,Y) and b14>=ref(b14,Y) and b13>ref(b13,Y) and b12>ref(b12,Y) and b11>ref(b11,Y)and count(红色将军,70)<35,1,0);
副军师在此:=if(绿色军师 and count(绿色军师,50)<=1,1,0);
黄色军师:=if(b1<=ref(b1,Y) and b14>=ref(b14,Y) and b13>ref(b13,Y) and b12>ref(b12,Y) and b11>ref(b11,Y)and count(红色将军,70)<35 and count(红色将军,210)<40 and(c/hhv(c,500)<0.65 or c/hhv(c,1000)<0.65 or c/hhv(c,1500)<0.65 or c/hhv(c,2000)<0.65),1,0);
军师在此:=if(黄色军师 and count(黄色军师,50)<=1,1,0);
副军师统计:=count(绿色军师,160);
副军师统计:if(副军师统计>0 and 绿色军师=1,副军师统计,0),colorgray,linethick0;
军师统计:=count(黄色军师,160);
军师统计:if(军师统计>0 and 黄色军师=1,军师统计,0),colorgray,linethick0;
partline(军师统计>0 or 副军师统计>0,副军师统计*2),colorred,linethick2;
{峰回路转}
DRAWTEXT(ISLASTBAR,1.3,'胜算:83%;'),colorFF00FF;
CHECK1:=CHECKUSER(1);
VAR2:=REF(CLOSE,1);
VAR3:=(SMA(MAX(CLOSE-VAR2,0),6,1))/(SMA(ABS(CLOSE-VAR2),6,1))*100;
VAR4:=(SMA(MAX(CLOSE-VAR2,0),12,1))/(SMA(ABS(CLOSE-VAR2),12,1))*100;
VAR5:=(BARSLAST(VAR4<20))<=3 AND CROSS(VAR3,VAR4);
VAR6:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100<-12.5;
VAR7:=LLV(LOW,5);
VAR8:=HHV(HIGH,5);
VAR9:=EMA((CLOSE-VAR7)/(VAR8-VAR7)*100,4);
VARA:=EMA(0.667*REF(VAR9,1)+0.333*VAR9,2);
VARB:=REF(CLOSE,1);
VARC:=(SMA(MAX(CLOSE-VARB,0),7,1))/(SMA(ABS(CLOSE-VARB),7,1))*100;
VARD:=(SMA(MAX(CLOSE-VARB,0),13,1))/(SMA(ABS(CLOSE-VARB),13,1))*100;
VARE:=(BARSLAST(VARD<20))<=3 AND CROSS(VARC,VARD);
VARF:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100<-12.5;
VAR10:=LLV(LOW,5);
VAR11:=HHV(HIGH,5);
VAR12:=EMA((CLOSE-VAR10)/(VAR11-VAR10)*100,4);
VAR13:=EMA(0.667*REF(VAR12,1)+0.333*VAR12,2);
VAR14:=1;
VAR15:=REF(CLOSE,1);
VAR16:=(SMA(MAX(CLOSE-VAR15,0),7,1))/(SMA(ABS(CLOSE-VAR15),7,1))*100;
VAR17:=(SMA(MAX(CLOSE-VAR15,0),13,1))/(SMA(ABS(CLOSE-VAR15),13,1))*100;
VAR18:=(BARSLAST(VAR17<20))<=3 AND CROSS(VAR16,VAR17);
VAR19:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100<-12.5;
VAR1A:=LLV(LOW,5);
VAR1B:=HHV(HIGH,5);
VAR1C:=EMA((CLOSE-VAR1A)/(VAR1B-VAR1A)*100,4);
VAR1D:=EMA(0.667*REF(VAR1C,1)+0.333*VAR1C,2);
VAR1E:=REF(CLOSE,1);
VAR1F:=(SMA(MAX(CLOSE-VAR1E,0),6,1))/(SMA(ABS(CLOSE-VAR1E),6,1))*100;
VAR20:=(SMA(MAX(CLOSE-VAR1E,0),12,1))/(SMA(ABS(CLOSE-VAR1E),12,1))*100;
VAR21:=(BARSLAST(VAR20<20))<=3 AND CROSS(VAR1F,VAR20);
VAR22:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100<-12.5;
VAR23:=LLV(LOW,5);
VAR24:=HHV(HIGH,5);
VAR25:=EMA((CLOSE-VAR23)/(VAR24-VAR23)*100,4);
VAR26:=EMA(0.667*REF(VAR25,1)+0.333*VAR25,2);
VAR27:=REF(CLOSE,1);
VAR28:=(SMA(MAX(CLOSE-VAR27,0),7,1))/(SMA(ABS(CLOSE-VAR27),7,1))*100;
VAR29:=(SMA(MAX(CLOSE-VAR27,0),13,1))/(SMA(ABS(CLOSE-VAR27),13,1))*100;
VAR2A:=(BARSLAST(VAR29<20))<=3 AND CROSS(VAR28,VAR29);
VAR2B:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100<-12.5;
VAR2C:=LLV(LOW,5);
VAR2D:=HHV(HIGH,5);
VAR2E:=EMA((CLOSE-VAR2C)/(VAR2D-VAR2C)*100,4);
VAR2F:=EMA(0.667*REF(VAR2E,1)+0.333*VAR2E,2);
VAR30:=DMA(EMA(CLOSE,12),SUM(VOL,5)/3/CAPITAL);
VAR31:=(CLOSE-VAR30)/VAR30*100;
柳暗花明:VAR2A AND VAR2B AND CROSS(VAR2E,VAR2F) AND VAR2E<=25 OR VAR21 AND VAR22 AND CROSS(VAR25,VAR26) AND VAR25<=25 OR VAR18 AND VAR19 AND CROSS(VAR1C,VAR1D) AND VAR1C<=25 OR VARE AND VARF AND CROSS(VAR12,VAR13) AND VAR12<=25 OR VAR5 AND VAR6 AND CROSS(VAR9,VARA) AND VAR9<=25 OR REF(VAR31,1)<-35 AND VAR31>REF(VAR31,1) AND REF(VAR31,1)<REF(VAR31,2) AND VAR31-REF(VAR31,1)>2.5,linethick0,colorFF;
DRAWICON(柳暗花明,-280,3);
stickline(柳暗花明,200,0,6,0),colorgray;