C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
- input:高(0,0,999,1),低(0,0,9999),黄(0,0,1),黄A(0,0,2),n1(5,0,999,1),n2(10,0,999,1),n5(55,0,9999);
- DRAWTEXTABS(2,5,'【代码:'+STKLABEL+' 名称:'+STKNAME+'】'),Color00FFFF;
- TF:= LLV(l, BARSLAST(DISPSTATUS=1)+0);
- TS:=BARSCOUNT(TF);
- 天数:HHVALL(BARSSINCE(BACKSET(BARSTATUS=2,BARSLAST(DISPSTATUS=1)))+2)-TS,LINETHICK0;ZFF:=((H-L)/L)*100;
- CFJ:=H-L;
- DRAWTEXTABS(180,5,'【振幅:'+NUMTOSTRN(ZFF,2)+'%/ '+NUMTOSTRN(CFJ,2)+'元】'),ColorFFFF00,linethick0;
- TJA:=CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1);
- STICKLINE(TJA,LOW,HIGH,0,0),Color0000E9;
- STICKLINE(TJA,O,CLOSE,8,0),Color000080;
- STICKLINE(TJA,O,CLOSE,6,0),Color0000A5;
- STICKLINE(TJA,O,CLOSE,4,0),Color0000C0;
- STICKLINE(TJA,O,CLOSE,2,0),Color0000E6;
- STICKLINE(NOT(TJA),HIGH,LOW,0,0),Color00ff00;
- STICKLINE(NOT(TJA),CLOSE,OPEN,9,0),Color005000;
- STICKLINE(NOT(TJA),CLOSE,OPEN,6,0),Color006600;
- STICKLINE(NOT(TJA),CLOSE,OPEN,4,0),Color008000;
- STICKLINE(NOT(TJA),CLOSE,OPEN,2,0),Color00A000;
- Q1:=(H < REF(L,1));
- Q2:=(L > REF(H,1));
- DRAWTEXT(Q1,(H ),'缺口'),ALIGN1,VALIGN2,COLORffFF00;
- DRAWTEXT(Q2,(L ),'缺口'),ALIGN1,VALIGN0,COLOR00ffff;{
- DRAWFLAGTEXT(Q2,L,'缺口');
- DRAWFLAGTEXT(Q1,H,'缺口');}
- STICKLINE(Q1,(c+o)/2,o,5,0),coloraa0000;
- STICKLINE(Q1,(c+o)/2,o,3,0),colorcc0000;
- STICKLINE(Q1,(c+o)/2,o,1,0),coloree0000;
- STICKLINE(Q2,O,(c+o)/2,5,0),color208AAA;
- STICKLINE(Q2,O,(c+o)/2,3,0),color208CCC;
- STICKLINE(Q2,O,(c+o)/2,1,0),color208EEE;
- QC:=REF(C,1);QO:=REF(O,1);QH:=REF(H,1);QL:=REF(L,1);
- FUZ:=L+((H-L)/2);FUS:=O+((C-O)/2); FUSY:=C+((O-C)/2);SSFU:=(FUZ+IF(C>O,FUS,FUSY))/2;
- FUZ1:=L+((H-L)*0.333);FUS1:=O+((C-O)*0.333);FUS1Y:=C+((O-C)*0.333);SSFU1:=(FUZ1+IF(C>O,FUS1,FUS1Y))/2;
- FUZ2:=L+((H-L)*0.667);FUS2:=O+((C-O)*0.677);FUS2Y:=C+((O-C)*0.667);SSFU2:=(FUZ2+IF(C>O,FUS2,FUS2Y))/2;
- BS1:=Ql+((Qh-Ql)/2);BS2:=QO+((QC-QO)/2);BS3:=QC+((QO-QC)/2);
- DB1:=QL+((QH-QL)*0.333);DB2:=QO+((QC-QO)*0.333);DB3:=QC+((QO-QC)*0.333);
- EB1:=QL+((QH-QL)*0.667);EB2:=QO+((QC-QO)*0.667);EB3:=QC+((QO-QC)*0.667);
- SYB1:=QH-((QH-QC)/2);SYB2:=QH-((QH-QO)/2);
- SYB3:=IF(QC>QO,SYB1,SYB2);
- XYB1:=QL+((QC-QL)/2);XYB2:=QL+((QO-QL)/2);
- XYB3:=IF(QC<QO,XYB1,XYB2);
- QFU:=(BS1+IF(QC>QO,BS2,BS3))/2;
- QDFU:=(DB1+IF(QC>QO,DB2,DB3))/2;
- QEFU:=(EB1+IF(QC>QO,EB2,EB3))/2;
- STICKLINE(C=C,SSFU2,SSFU2,4,0),COLOR00FF00,LINETHICK1;
- STICKLINE(C=C,SSFU1,SSFU1,4,0),COLOR00FF00,LINETHICK1;
- STICKLINE(C=C,SSFU,SSFU,6,0),COLOR00FFFF,LINETHICK1;
- STICKLINE(C=C,IF(C>O,H-((H-C)/2),H-((H-O)/2)),IF(C>O,H-((H-C)/2),H-((H-O)/2)),1.3,0),COLORYELLOW,LINETHICK1;
- STICKLINE(C=C,IF(C<O,L+((C-L)/2),L+((O-L)/2)),IF(C<O,L+((C-L)/2),L+((O-L)/2)),1.3,0),COLORYELLOW,LINETHICK1;
- DRAWTEXTABS(10,20,' 前/现日振幅的1/2 【'+NUMTOSTRN(QFU,2)+'】/【'+NUMTOSTRN(SSFU,2)+'】'),Color0DEEEE;
- DRAWTEXTABS(10,35,'前/现日振幅的:1/3 【'+NUMTOSTRN(QDFU,2)+'】/【'+NUMTOSTRN(SSFU1,2)+'】'),Color00EE00;
- DRAWTEXTABS(10,50,'前/现日振幅的:2/3 【'+NUMTOSTRN(QEFU,2)+'】/【'+NUMTOSTRN(SSFU2,2)+'】'),Color00EE00;
- DRAWTEXTABS(10,65,'前上影线幅度的1/2 【'+NUMTOSTRN(SYB3,2)+'】'),ColorEEEEEE;
- DRAWTEXTABS(10,80,'前下影线幅度的1/2 【'+NUMTOSTRN(XYB3,2)+'】'),ColorEEEEEE;
- MC1:MA(C,N1),ColorFFFfff,linethick1,DOTLINE;
- DRAWTEXT(BARSTATUS=2 AND Mc1>REF(Mc1,1),MC1,' ↑'+NUMTOSTRn(Mc1,2)),COLORffffff;
- DRAWTEXT(BARSTATUS=2 AND Mc1<REF(Mc1,1),Mc1,' ↓'+NUMTOSTRn(Mc1,2)),Colorffffff;
- MC2:MA(C,N2),Color00Ffff,linethick1,DOTLINE;
- DRAWTEXT(BARSTATUS=2 AND Mc2>REF(Mc2,1),MC2,' ↑'+NUMTOSTRn(Mc2,2)),COLOR00ffff;
- DRAWTEXT(BARSTATUS=2 AND Mc2<REF(Mc2,1),Mc2,' ↓'+NUMTOSTRn(Mc2,2)),Color00ffff;
- MC5:EMA(C,N5),ColorFFFf00,linethick1;
- DRAWTEXT(BARSTATUS=2 AND Mc5>REF(Mc5,1),MC5,' '+NUMTOSTRn(N5,0)+'↑'+NUMTOSTRn(Mc5,2)),COLORFFFf00;
- DRAWTEXT(BARSTATUS=2 AND Mc5<REF(Mc5,1),Mc5,' '+NUMTOSTRn(N5,0)+'↓'+NUMTOSTRn(Mc5,2)),ColorFFFf00;
- QJ:=atan((MA(C,n1)/ref(MA(C,n1),1)-1)*100)*57.3;
- QJ1:=atan((ref(MA(C,n1),1)/ref(MA(C,n1),2)-1)*100)*57.3;
- QJ2:=atan((ref(MA(C,n1),2)/ref(MA(C,n1),3)-1)*100)*57.3;
- QMC:=REF(MC1,1);QMC1:=REF(MC1,2);
- CMC:=MC1-QMC;CMC1:=QMC-QMC1;CPJ:=(CMC+CMC1)/2;
- DRAWTEXTABS(20,95,''+NUMTOSTRN(n1,0)+'日 均线角度=∠'+NUMTOSTRN(QJ,2)+'/'+'度'+'/ 前日=;∠'+NUMTOSTRn(QJ1,2)+' 度'+'/ 前2日=;∠'+NUMTOSTRn(QJ2,2)+' 度'+''),Color00EEEE;
- DRAWTEXTABS(20,110,''+NUMTOSTRN(N1,0)+''+'日 均值=: '+NUMTOSTRN(MC1,2)+' 元'+''+'/ 前日 =:'+NUMTOSTRN(QMC,2)+' 元'+'/ 前2日=: '+NUMTOSTRN(QMC1,2)+' 元'),ColorFFffff;
- DRAWTEXTABS(20,125,''+NUMTOSTRN(N1,0)+''+'日 均线近三日的平均增(减)速=; '+NUMTOSTRN(CPJ,2)+' 元'+''),ColorFFffff;
- NN:= DISPSTATUS=2 AND 黄=1;
- NNN:= DISPSTATUS=2 AND 黄A=1;
- NNNN:= DISPSTATUS=2 AND 黄A=2;
- UG:=REF(H,高);UD:=REF(L,低);
- HH := HHV(Ug,1);
- LL := LLV(Ud,1);
- HL := HH-LL;
- Hk := LL-HH;
- A1 := LL+hL*0.191; A10 := LL+hL*0.03; B1 := LL+hL*0.125;{1/8} B9 := LL+hL*0.22; G1 := LL-hK*1.191; G10 := LL-HK*1.02; JG1 := LL-HK*1.125; JG9 := LL-HK*1.22;
- A2 := LL+hL*0.382; A11 := LL+hL*0.98; B2 := LL+hL*0.375;{3/8} B10 := LL+hL*0.28; G2 := LL-HK*1.382; G11 := LL-HK*1.03; JG2 := LL-HK*1.375; JG10 := LL-HK*1.28;
- A3 := LL+hL*0.618; A12 := LL+hL*0.05; B3 := LL+hL*0.625;{5/8} B11 := LL+hL*0.72; G3 := LL-HK*1.618; G12 := LL-HK*1.05; JG3 := LL-HK*1.625; JG11 := LL-HK*1.72;
- A4 := LL+hL*0.809; A13 := LL+hL*0.93; B4 := LL+hL*0.875;{7/8} B12 := LL+hL*0.78; G4 := LL-HK*1.809; G13 := LL-HK*1.08; JG4 := LL-HK*1.875; JG12 := LL-HK*1.78;
- A5 := LL+hL*0.50; A14 := LL+hL*0.08; B5 := LL+hL*0.333;{1/3} G5 := LL-HK*1.50; G14 := LL-HK*1.10; JG5 := LL-HK*1.333; JG13 := LL-HK*2;
- A6 := LL+HL*0.55; A15 := LL+hL*0.15; B6 := LL+hL*0.667;{2/3} G6 := LL-HK*1.45; G15 := LL-HK*1.15; JG6 := LL-HK*1.667;
- A7 := LL+HL*0.45; A16 := LL+hL*0.85; B7 := LL+hL*0.25; {2/8} G7 := LL-HK*1.55; G16 := LL-HK*1.85; JG7 := LL-HK*1.25;
- A8 := LL+HL*0.95; A17 := LL+hL*0.92; B8 := LL+hL*0.75; {6/8} G8 := LL-HK*1.95; JG8 := LL-HK*1.75;
- A9 := LL+hL*0.90; A18 := LL+hL*0.97; G9 := LL-HK*1.90;
-
- DRAWTEXT(NNN ,G5,'150%:'+NUMTOSTRN(g5,2)+ ' ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,color208FFF,linethick2;
- DRAWTEXT(NN ,LL,''+NUMTOSTRN(ll,2)+ '__________________________________________________________________________________近低'),ALIGN2,colorffff00,linethick1,VALIGN1;
- DRAWTEXT(NN ,hh,''+NUMTOSTRN(hh,2)+ '←-----------------------------------------------------------近高'),ALIGN2,color20FF20,linethick1,VALIGN1;
- DRAWTEXT(NN,A1,NUMTOSTRN(A1,2)+' :--0.191'),COLOR00bbbb,ALIGN2,VALIGN1;
- DRAWTEXT(NN,A2,NUMTOSTRN(A2,2)+' :--0.382'),COLOR00bbbb,ALIGN2,VALIGN1;
- DRAWTEXT(NN,A5,'★:('+NUMTOSTRN(A5,2)+') ←----------------*1/2'),COLORFFFFFF,ALIGN2,VALIGN1;
- DRAWTEXT(NN,A3,NUMTOSTRN(A3,2)+' :--0.618'),COLOR00bbbb,ALIGN2,VALIGN1;
- DRAWTEXT(NN,A4,NUMTOSTRN(A4,2)+' :--0.809'),COLOR00bbbb,ALIGN2,VALIGN1;
- DRAWTEXT(nn,a11,'98%:*→ '+'('+NUMTOSTRN(A11,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(nn,a13,'93%:*→ '+'('+NUMTOSTRN(A13,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(nn,a14,'8%:*→ '+'('+NUMTOSTRN(A14,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(nn,a10,'3%:*→ '+'('+NUMTOSTRN(A10,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(nn,a16,'85%:*→ '+'('+NUMTOSTRN(A16,2)+'------ '),ALIGN2,COLOR208FFF,VALIGN1;
- DRAWTEXT(nn,a15,'15%:*→ '+'('+NUMTOSTRN(A15,2)+'------ '),ALIGN2,COLOR208FFF,VALIGN1;
- DRAWTEXT(nn,B12,'78%:*→ '+'('+NUMTOSTRN(B12,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(nn,B11,'72%:*→ '+'('+NUMTOSTRN(B11,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(nn,B10,'28%:*→ '+'('+NUMTOSTRN(B10,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(nn,B9,'22%:*→ '+'('+NUMTOSTRN(B9,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(nn,B4,'7/8:*→ '+'('+NUMTOSTRN(B4,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,B8,'6/8:*→ '+'('+NUMTOSTRN(B8,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,B3,'5/8:*→ '+'('+NUMTOSTRN(B3,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,B2,'3/8:*→ '+'('+NUMTOSTRN(B2,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,B7,'2/8:*→ '+'('+NUMTOSTRN(B7,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,B1,'1/8:*→ '+'('+NUMTOSTRN(B1,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(nn,A6,'55%:*→ '+'('+NUMTOSTRN(A6,2)+' ← '),ALIGN2,ColorFEFFFF,VALIGN1;{
- DRAWTEXT(nn,A5,'50%:*→ '+'('+NUMTOSTRN(A5,2)+' ← '),ALIGN2,Color00FFFF,VALIGN1;}
- DRAWTEXT(nn,A7,'45%:*→ '+'('+NUMTOSTRN(A7,2)+' ← '),ALIGN2,ColorFEFFFF,VALIGN1;
- DRAWTEXT(nn,B5,'1/3%:*→'+'('+NUMTOSTRN(B5,2)+' ←-- '),ALIGN2,COLOR00ff00,VALIGN1;
- DRAWTEXT(nn,B6,'2/3%:*→'+'('+NUMTOSTRN(B6,2)+' ←-- '),ALIGN2,COLOR00ff00,VALIGN1;
- DRAWTEXT(NnN,G13,'8%:*→ '+'('+NUMTOSTRN(G13,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(NnN,G11,'3%:*→ '+'('+NUMTOSTRN(G11,2)+'← '),ALIGN2,COLORf0ff00,VALIGN1;
- DRAWTEXT(NnN,JG5,'1/3%:*→'+'('+NUMTOSTRN(JG5,2)+' ←-- '),ALIGN2,COLOR00ff00,VALIGN1;
- DRAWTEXT(NnN,JG7,'2/8:*→ '+'('+NUMTOSTRN(JG7,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(NnN,JG1,'1/8:*→ '+'('+NUMTOSTRN(JG1,2)+' ← '),ALIGN2,ColorFEBAF5,VALIGN1;
- DRAWTEXT(NnN,G15,'15%:*→ '+'('+NUMTOSTRN(G15,2)+'------ '),ALIGN2,COLOR208FFF,VALIGN1;
- DRAWTEXT(NnN,JG10,'28%:*→ '+'('+NUMTOSTRN(JG10,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(NnN,JG9,'22%:*→ '+'('+NUMTOSTRN(JG9,2)+'← '),ALIGN2,Color9FFF00,VALIGN1;
- DRAWTEXT(NnN,G1,'¥:191%:*→'+'('+NUMTOSTRN(G1,2)+' ←-- '),ALIGN2,COLOR00ffFF,VALIGN1;
- DRAWTEXT(NnN,G2,'¥:382%:*→'+'('+NUMTOSTRN(G2,2)+' ←-- '),ALIGN2,COLOR00ffFF,VALIGN1;
- DRAWTEXT(NnN,G6,'45%:*→'+'('+NUMTOSTRN(G6,2)+' ←-- '),ALIGN2,COLORFFFFFF,VALIGN1;
- GHJ1:=HH-hL*1.191; GJN1:=HH-HL*1.333;
- GHJ2:=HH-hL*1.382; GJN2:=HH-HL*1.667;
- GHJ3:=HH-hL*1.45; GJN3:=HH-HL*1.55;
- GHJ4:=HH-hL*1.50; GJN4:=HH-HL*1.125;
- GHJ5:=HH-hL*1.618; GJN5:=HH-HL*1.25;
- GHJ6:=HH-hL*1.809; GJN6:=HH-HL*1.75;
- DRAWTEXT(NnNn,GJN1,'1/3%:*→'+'('+NUMTOSTRN(GJN1,2)+' ←-- '),ALIGN2,COLOR00ff00,VALIGN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