9qihuo.com
我们只提供有用的干货

波段顶底画百分比线 (文华财经)

投资者咨询:波段顶底画百分比线 (文华财经)
来源:文华财经  日期:2020-10-25 9:35
 波段顶:IFELSE(PERIOD=9&&A,VALUEWHEN(VAR1,H),NULL),COLORBLACK,NODRAW;
波段底:IFELSE(PERIOD=9&&A,VALUEWHEN(VAR2,L),NULL),COLORRED,NODRAW;

老师好:
   请把上面指标中波段顶和波段底画个百分比线,画最新10根k线,线的左端标注值,左端标注比例。
   
    


                     万分谢谢!

 
技术人员回复
日期:2020-10-25 9:39

请上传全部源码,另外您的百分比线1和0取的数据是哪2个数据,几个百分比?

投资者咨询:波段顶底画百分比线 (文华财经)
来源:文华财经  日期:2020-10-25 9:35
 取波段底的值为第一个取点,波段顶的值为第二个取点,画个百分比线,画最新10根k线,线的左端标注值,左端标注比例。
技术人员回复
日期:2020-10-25 10:28

看下效果:

 

HH:=VALUEWHEN(VAR1,H);
LL:=VALUEWHEN(VAR2,L);

HHH:=REFX1(HH,9999);
LLL:=REFX1(LL,9999);
N:=9;

DRAWSL(ISLASTBAR,LLL,0,-N,0,COLORWHITE),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.191,0,-N,0,COLORGREEN),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.382,0,-N,0,COLORRED),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.5,0,-N,0,COLORYELLOW),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.618,0,-N,0,COLORMAGENTA),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.809,0,-N,0,COLORCYAN),DOT;
DRAWSL(ISLASTBAR,HHH,0,-N,0,COLORWHITE),DOT;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.191,0.191,3,COLORGREEN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.382,0.382,3,COLORRED),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.5,0.5,1,COLORYELLOW),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.618,0.618,3,COLORMAGENTA),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.809,0.809,3,COLORCYAN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL,0,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,HHH,1,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.191,LLL+(HHH-LLL)*0.191,2,COLORGREEN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.382,LLL+(HHH-LLL)*0.382,2,COLORRED),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.5,LLL+(HHH-LLL)*0.5,2,COLORYELLOW),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.618,LLL+(HHH-LLL)*0.618,2,COLORMAGENTA),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.809,LLL+(HHH-LLL)*0.809,2,COLORCYAN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL,LLL,2,COLORWHITE),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),HHH,HHH,2,COLORWHITE),VALIGN1,ALIGN2;

投资者咨询:波段顶底画百分比线 (文华财经)
来源:文华财经  日期:2020-10-25 9:35
 我也想做个这个指标,上面复制进去用不了,说什么没有定义或存在非法字符
技术人员回复
日期:2020-10-27 10:05
 需要您定义下VAR1和VAR2 这里不清楚您1楼的顶底是如何编写的
投资者咨询:波段顶底画百分比线 (文华财经)
来源:文华财经  日期:2020-10-25 9:35
能以文件自带的波段高低点为起始点和终点定义吗
技术人员回复
日期:2020-10-27 10:42

看下这个效果:

 

XXX:=20;
VAR1:=H>=HV(H,XXX) &&H>=REFX1(HHV(H,XXX),XXX);
VAR2:=L<=LV(L,XXX) &&L<=REFX1(LLV(L,XXX),XXX);

DRAWICON(VAR1,H,1),VALIGN2;
DRAWICON(VAR2,L,2),VALIGN0;

HH:=VALUEWHEN(VAR1,H);
LL:=VALUEWHEN(VAR2,L);

HHH:=REFX1(HH,9999);
LLL:=REFX1(LL,9999);
N:=9;

DRAWSL(ISLASTBAR,LLL,0,-N,0,COLORWHITE),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.191,0,-N,0,COLORGREEN),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.382,0,-N,0,COLORRED),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.5,0,-N,0,COLORYELLOW),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.618,0,-N,0,COLORMAGENTA),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.809,0,-N,0,COLORCYAN),DOT;
DRAWSL(ISLASTBAR,HHH,0,-N,0,COLORWHITE),DOT;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.191,0.191,3,COLORGREEN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.382,0.382,3,COLORRED),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.5,0.5,1,COLORYELLOW),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.618,0.618,3,COLORMAGENTA),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.809,0.809,3,COLORCYAN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL,0,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,HHH,1,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.191,LLL+(HHH-LLL)*0.191,2,COLORGREEN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.382,LLL+(HHH-LLL)*0.382,2,COLORRED),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.5,LLL+(HHH-LLL)*0.5,2,COLORYELLOW),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.618,LLL+(HHH-LLL)*0.618,2,COLORMAGENTA),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.809,LLL+(HHH-LLL)*0.809,2,COLORCYAN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL,LLL,2,COLORWHITE),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),HHH,HHH,2,COLORWHITE),VALIGN1,ALIGN2;

投资者咨询:波段顶底画百分比线 (文华财经)
来源:文华财经  日期:2020-10-25 9:35
 谢谢老师,挺好的,就是能不能不要那个笑脸哭脸的图标,因为那个图标和高低点的数值重叠后,数字看不清,或者在数字的上下方也行
技术人员回复
日期:2020-10-27 19:57
 参考

XXX:=20;
VAR1:=H>=HV(H,XXX) &&H>=REFX1(HHV(H,XXX),XXX);
VAR2:=L<=LV(L,XXX) &&L<=REFX1(LLV(L,XXX),XXX);

DRAWICON(VAR1,H+5*MINPRICE,1),VALIGN2;
DRAWICON(VAR2,L-5*MINPRICE,2),VALIGN0;

HH:=VALUEWHEN(VAR1,H);
LL:=VALUEWHEN(VAR2,L);

HHH:=REFX1(HH,9999);
LLL:=REFX1(LL,9999);
N:=9;

DRAWSL(ISLASTBAR,LLL,0,-N,0,COLORWHITE),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.191,0,-N,0,COLORGREEN),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.382,0,-N,0,COLORRED),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.5,0,-N,0,COLORYELLOW),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.618,0,-N,0,COLORMAGENTA),DOT;
DRAWSL(ISLASTBAR,LLL+(HHH-LLL)*0.809,0,-N,0,COLORCYAN),DOT;
DRAWSL(ISLASTBAR,HHH,0,-N,0,COLORWHITE),DOT;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.191,0.191,3,COLORGREEN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.382,0.382,3,COLORRED),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.5,0.5,1,COLORYELLOW),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.618,0.618,3,COLORMAGENTA),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL+(HHH-LLL)*0.809,0.809,3,COLORCYAN),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,LLL,0,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(ISLASTBAR,HHH,1,0,COLORWHITE),VALIGN1,ALIGN0;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.191,LLL+(HHH-LLL)*0.191,2,COLORGREEN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.382,LLL+(HHH-LLL)*0.382,2,COLORRED),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.5,LLL+(HHH-LLL)*0.5,2,COLORYELLOW),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.618,LLL+(HHH-LLL)*0.618,2,COLORMAGENTA),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL+(HHH-LLL)*0.809,LLL+(HHH-LLL)*0.809,2,COLORCYAN),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),LLL,LLL,2,COLORWHITE),VALIGN1,ALIGN2;
DRAWNUMBER(REFX(ISLASTBAR,9),HHH,HHH,2,COLORWHITE),VALIGN1,ALIGN2;