编写--画趋势线平行线

01-11 21:40发布

KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);

KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWLINE1(KH2,C,KH1,C,1),COLORLIGHTGREEN,LINETHICK2,NOTEXT;老师.1.过这条趋势线二点之间最高点画趋势线的平行线.2.过这条趋势线二点之间最底点画趋势线的平行线.怎么写

KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWLINE1(KH2,C,KH1,C,1),COLORLIGHTGREEN,LINETHICK2,NOTEXT;老师.1.过这条趋势线二点之间最高点画趋势线的平行线.2.过这条趋势线二点之间最底点画趋势线的平行线.怎么写
付费偷看设置
发送
4条回答
文华解答
2楼-- · 01-11 22:46

看下这个效果:

//1

KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWTEXT(KH1,C,'★'),VALIGN1;
DRAWTEXT(KH2,C,'★'),VALIGN1;

NNN:TRENDLINES(KH2,C,KH1,C),COLORLIGHTGREEN,LINETHICK2,NOTEXT;
HHL:=HHVBARS(H,BARSLAST(KH2)+1);
HH:=HHV(H,BARSLAST(KH2)+1);
LLL:=LLVBARS(L,BARSLAST(KH2)+1);
LL:=LLV(L,BARSLAST(KH2)+1);

NNN1:NNN+REFX1(REF(REF(H,HHL)-REF(NNN,HHL),BARSLAST(KH1)),99999),DOT;
NNN2:NNN+REFX1(REF(REF(L,LLL)-REF(NNN,LLL),BARSLAST(KH1)),99999),DOT;

//2


KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWTEXT(KH1,C,'★'),VALIGN1;
DRAWTEXT(KH2,C,'★'),VALIGN1;

NNN:TRENDLINES(KH2,C,KH1,C),COLORLIGHTGREEN,LINETHICK2,NOTEXT;
HHL:=HHVBARS(H-NNN,BARSLAST(KH2)+1);
HH:=HHV(H-NNN,BARSLAST(KH2)+1);
LLL:=HHVBARS(NNN-L,BARSLAST(KH2)+1);
LL:=HHV(NNN-L,BARSLAST(KH2)+1);
NNN1:NNN+REFX1(REF(REF(H,HHL)-REF(NNN,HHL),BARSLAST(KH1)),99999),DOT;
NNN2:NNN+REFX1(REF(REF(L,LLL)-REF(NNN,LLL),BARSLAST(KH1)),99999),DOT;

文期王华
3楼-- · 01-11 23:06
老师.这是源码
TY309:=C;
HD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=HHV(TY309,2*10+1),10),10+1),10);
LD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=LLV(TY309,2*10+1),10),10+1),10);


KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWLINE1(KH2,C,KH1,C,1),COLORLIGHTGREEN,LINETHICK2,NOTEXT;
文华解答
4楼-- · 01-11 23:26

参考:

TY309:=C;
HD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=HHV(TY309,2*10+1),10),10+1),10);
LD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=LLV(TY309,2*10+1),10),10+1),10);

KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWTEXT(KH1,C,'★'),VALIGN1;
DRAWTEXT(KH2,C,'★'),VALIGN1;

NNN:TRENDLINES(KH2,C,KH1,C),COLORLIGHTGREEN,LINETHICK2,NOTEXT;
HHL:=HHVBARS(H,BARSLAST(KH2)+1);
HH:=HHV(H,BARSLAST(KH2)+1);
LLL:=LLVBARS(L,BARSLAST(KH2)+1);
LL:=LLV(L,BARSLAST(KH2)+1);

NNN1:NNN+REFX1(REF(REF(H,HHL)-REF(NNN,HHL),BARSLAST(KH1)),99999),DOT;
NNN2:NNN+REFX1(REF(REF(L,LLL)-REF(NNN,LLL),BARSLAST(KH1)),99999),DOT;

文华解答
5楼-- · 01-11 23:46

版本2:

TY309:=C;
HD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=HHV(TY309,2*10+1),10),10+1),10);
LD309:=FILTER(BACKSET(FILTER(REF(TY309,10)=LLV(TY309,2*10+1),10),10+1),10);

KH1:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,1)),0.5);
KH2:=CROSS(BACKSET(ISLASTBAR,SUMBARS(HD309,2)),0.5);

DRAWTEXT(KH1,C,'★'),VALIGN1;
DRAWTEXT(KH2,C,'★'),VALIGN1;

NNN:TRENDLINES(KH2,C,KH1,C),COLORLIGHTGREEN,LINETHICK2,NOTEXT;
HHL:=HHVBARS(H-NNN,BARSLAST(KH2)+1);
HH:=HHV(H-NNN,BARSLAST(KH2)+1);
LLL:=HHVBARS(NNN-L,BARSLAST(KH2)+1);
LL:=HHV(NNN-L,BARSLAST(KH2)+1);
NNN1:NNN+REFX1(REF(REF(H,HHL)-REF(NNN,HHL),BARSLAST(KH1)),99999),DOT;
NNN2:NNN+REFX1(REF(REF(L,LLL)-REF(NNN,LLL),BARSLAST(KH1)),99999),DOT;