黄金分割线+ 斐波那契周期主图指标公式源码[通达信公式]
相关标签:
1-黄金分割点 0.618 能运用到不同行业各个领域,足以说明他的强大之处,
在指标中的用法我就不赘述了,大家动动手指搜搜,论坛里百度上比比皆是。
2-本指标以指定周期的最高和最低点,用黄金分割的方式画点标值,
红竖线表示最低点上升分割和相对数值,绿竖线表示最高点下跌分割和相对数值。
再以当前屏(主图)的高低值加以黄金分割(黄色横线),在横向黄金分割点标百分百。
3-指标不但可以观察对应的高低幅度和周期,十字光标下更可以查看每个K线下的高低幅度和周期等数值。
4-指标涵盖了我其它指标的精髓要意,如 《九天尺》 《目标预测》 《区间统计》等。
5-高低点用参数调节,可以调到自己想要的位置。
原理解析:
来源:程序化99( WWW.CXH99.COM )
源码:
{高点 1 9999 50
低点 1 9999 30 }GD:=CONST(FINDHIGH(H,0,高点*10,1));
DD:=CONST(FINDLOW(L,0,低点*10,1));
GT:=CONST(BARSLAST(GD=H))+1;
DT:=CONST(BARSLAST(DD=L))+1;
SH:=CONST(IF(GT=1,H,REF(H,GT-1)));
SL:=CONST(IF(DT=1,L,REF(L,DT-1)));
CC:=IF(DT>GT,DT,GT);
CD:=INTPART(CC-(DT+GT)/2);
CG:=IF(高点>CD,CD/2,高点);
下跌周期:BARSLAST(GD=H),COLORWHITE,NODRAW;
下跌幅:IF(CURRBARSCOUNT<=GT,C/SH*100-100,DRAWNULL),NODRAW,COLORGREEN;
下跌均价:IF(CURRBARSCOUNT<=GT,SUM(AMOUNT,GT)/SUM(V,GT)/100,DRAWNULL),NODRAW,COLORLIGRAY;
跌换手%:IF(CURRBARSCOUNT<=GT,SUM(HSL.HSL,GT),DRAWNULL),COLORCYAN,NODRAW;
上涨周期:IF(CURRBARSCOUNT<=DT,BARSLAST(DD=L),DRAWNULL),COLORWHITE,NODRAW;
上涨幅:IF(CURRBARSCOUNT<=DT,C/SL*100-100,DRAWNULL),NODRAW,COLORRED;
上涨均价:IF(CURRBARSCOUNT<=DT,SUM(AMOUNT,DT)/SUM(V,DT)/100,DRAWNULL),NODRAW,COLORLIGRAY;
涨换手%:IF(CURRBARSCOUNT<=DT,SUM(HSL.HSL,DT),DRAWNULL),COLORLIMAGENTA,NODRAW;
星期:=VARCAT(VARCAT('(',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五','')))))),')');
日期:=VARCAT('-',VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VAR2STR(YEAR,0),'年'),VAR2STR(MONTH,0)),'月'),VAR2STR(DAY,0)),'日'),星期));
{自动黄金分割 普通等系坐标}
DRAWRECTREL(990,1,382,1,RGB(250,250,0));
DRAWTEXT_FIX(C>0,0.382,0.00,0,'100%'),COLOR00CCCC;
DRAWRECTREL(990,188,382,188,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.189,0,'19.1%'),COLOR00CCCC;
DRAWRECTREL(990,375,382,375,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.376,0,'38.2%'),COLOR00CCCC;
DRAWRECTREL(990,491,382,491,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.492,0,'50.0%'),COLOR00CCCC;
DRAWRECTREL(990,607,382,607,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.608,0,'61.8%'),COLOR00CCCC;
DRAWRECTREL(990,794,382,794,RGB(200,200,0));
DRAWTEXT_FIX(C>0,0.382,0.795,0,'80.9%'),COLOR00CCCC;
DRAWRECTREL(990,982,382,982,RGB(250,250,0));
DRAWTEXT_FIX(C>0,0.382,0.936,0,'BASE'),COLOR00CCCC;
DRAWRECTREL(990,232,382,232,RGB(100,100,0));
DRAWRECTREL(990,144.6,382,144.6,RGB(100,100,0));
DRAWRECTREL(990,750,382,750,RGB(100,100,0));
DRAWRECTREL(990,839,382,839,RGB(100,100,0));
DRAWTEXT_FIX(C>0,0.01,0.01,0,'云枫添外 2016/10/10 绘'),COLORYELLOW;
{斐波那契周期}
DRAWTEXT(CURRBARSCOUNT=GT-2 ,L,'3'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-4 ,L,'5'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-7 ,L,'8'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-12 ,L,'13'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-20 ,L,'21'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-33 ,L,'34 '),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-54 ,L,'55'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-88 ,L,'89'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-143 ,L,'144'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-232 ,L,'233'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=GT-376 ,L,'377'),COLOR00FF00;
DRAWTEXT(CURRBARSCOUNT=DT-2,H,'3'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-4,H,'5'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-7,H,'8'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-12,H,'13'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-20,H,'21'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-33,H,'34'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-54,H,'55'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-88,H,'89'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-143,H,'144'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-232,H,'233'),DRAWABOVE,COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT-376,H,'377'),DRAWABOVE,COLORRED;
{幅度尺}
STICKLINE(CURRBARSCOUNT=DT,SL*20,SL,0,-1),COLORRED;
STICKLINE(CURRBARSCOUNT=GT,SH,SH-SH*0.9,0,-1),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT ,(SL+SL*1.2)/2,日期),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=GT ,GD*0.97,日期),COLORYELLOW;
{下跌尺}
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.14.6,STRCAT('-14.6% ',CON2STR(SH-SH*0.146,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.191,STRCAT('-19.1% ',CON2STR(SH-SH*0.191,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.236,STRCAT('-23.6% ',CON2STR(SH-SH*0.236,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.382,STRCAT('-38.2% ',CON2STR(SH-SH*0.382,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.5,STRCAT('-50.0% ',CON2STR(SH-SH*0.5,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.618,STRCAT('-61.8% ',CON2STR(SH-SH*0.618,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.764,STRCAT('-76.4% ',CON2STR(SH-SH*0.764,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.809,STRCAT('-80.9% ',CON2STR(SH-SH*0.809,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.854,STRCAT('-85.4% ',CON2STR(SH-SH*0.854,2))),COLORGREEN;
{上升尺}
DRAWTEXT(CURRBARSCOUNT=DT,SL*1.191,STRCAT('-19.1% ',CON2STR(SL*1.191,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*1.382,STRCAT('-38.2% ',CON2STR(SL*1.382,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*1.5,STRCAT('-50.0% ',CON2STR(SL*1.5,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*1.618,STRCAT('-61.8% ',CON2STR(SL*1.618,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*1.809,STRCAT('-80.9% ',CON2STR(SL*1.809,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2,STRCAT('-100% ',CON2STR(SL*2,2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*1.191,STRCAT('-138.2% ',CON2STR(SL*2*1.191,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*1.382,STRCAT('-176.4% ',CON2STR(SL*2*1.382,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*1.5,STRCAT('-200.0% ',CON2STR(SL*2*1.5,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*1.618,STRCAT('-223.6% ',CON2STR(SL*2*1.618,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*1.809,STRCAT('-261.8% ',CON2STR(SL*2*1.809,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2,STRCAT('-300.0% ',CON2STR(SL*2*2,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2.191,STRCAT('-338.2% ',CON2STR(SL*2*2.191,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2.382,STRCAT('-376.4% ',CON2STR(SL*2*2.382,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2.5,STRCAT('-400.0% ',CON2STR(SL*2*2.5,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2.618,STRCAT('-423.6% ',CON2STR(SL*2*2.618,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*2.809,STRCAT('-461.8% ',CON2STR(SL*22.809,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3,STRCAT('-500.0% ',CON2STR(SL*2*3,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3.191,STRCAT('-538.2% ',CON2STR(SL*2*3.191,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3.382,STRCAT('-576.4% ',CON2STR(SL*2*3.382,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3.5,STRCAT('-600.0% ',CON2STR(SL*2*3.5,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3.618,STRCAT('-623.6% ',CON2STR(SL*2*3.618,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*3.809,STRCAT('-661.8% ',CON2STR(SL*2*3.809,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4,STRCAT('-700.0% ',CON2STR(SL*2*4,2))),COLORLIMAGENTA;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4.191,STRCAT('-738.2% ',CON2STR(SL*2*4.191,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4.382,STRCAT('-776.4% ',CON2STR(SL*2*4.382,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4.5,STRCAT('-800.0% ',CON2STR(SL*2*4.5,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4.618,STRCAT('-823.6% ',CON2STR(SL*2*4.618,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*4.809,STRCAT('-861.8% ',CON2STR(SL*2*4.809,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=DT,SL*2*5,STRCAT('-900.0% ',CON2STR(SL*2*5,2))),COLORGREENDRAWTEXT_FIX(C>O,0.01,0.9,0,' WWW.CXH99.COM '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容