收藏点赞加关注,防止以后找不到。
2 \5 o: z9 d% Y* u% V, n" w4 {如果有公式问题,评论区留言一起探讨。 e4 B+ N3 F. v/ }& h
指标如果想改成选股公式或改编到别的软件(如同花顺,博弈,文华)等上用,
$ t7 w% U: C$ @1 C( G9 l7 x R或需要帮忙编写程序化量化交易策略,可以看看这里: a8 J# S) n' S8 A& H
下面有效果图,可以先看看效果盘图是不是你想要的公式指标
9 J0 x! f: E/ G& q4 B6 _8 M6 C7 X# {' A. ]; \( c! o0 F, q
7 k0 J% T) T, A8 h9 Y
C22:=REF(C,1);5 N' T: ?/ J( f1 {$ G
ZT:=IF((C-C22)*100/C22>=(10-0.01*100/C22),1,0);2 x7 Q, g4 _9 \4 {& [7 G/ h
LG:=TOPRANGE(VOL);, o% Y+ v0 ?2 p; v( }
FZG:=H/REF(L,60)< 1.6 AND H/REF(L,20)< 1.5 AND H/REF(L,4)< 1.3 AND H/REF(L,10)< 1.5 AND COUNT(ZT,5)<=3 AND COUNT(ZT,50)<=5;- C) U, O, L6 [, O: v. u8 r, b |
ZLC:=O/REF(C,1)>1.07 AND C< O AND LG>60 AND FZG;& z; S& L2 _+ f x, n' m8 |
BGY:=REF(ZT,1) AND O/REF(C,1)>1.01 AND C< O AND LG>60 AND FZG;7 |. z, M, J, P; _
BGYY:=REF(ZT,1) AND H/REF(C,1)>1.07 AND C>O AND LG>100 AND FZG;0 q7 K0 W2 c) [) m9 X9 y
EBY:=O/REF(C,1)>1.01 AND C< O AND V< REF(V,1) AND REF(ZT,1) AND FZG;' l- ], d [' m
HF:=C=H AND C/REF(C,1)>1.095 AND C=O AND L< C;
7 B* i4 \/ A, f' h6 nTZBS31:= REF(HF,1) AND V <= 0.7*REF(V,1);DRAWTEXT_FIX(C>O,0.005,0.92,0,' Q'),COLORWHITE;
0 U; S/ y7 }; `DRAWTEXT_FIX(C>O,0.01,0.92,0,' :511411198 徵'),COLORWHITE;
! u9 T4 {/ k* }" M3 ZDRAWTEXT_FIX(C>O,0.09,0.92,0,' 信:CXH99CXH99'),COLORWHITE;/ M. ?- i& p/ T) F5 d" b, T7 I) M/ m) i
DRAWTEXT_FIX(C>O,0.01,0.75,0,'代编写指标选股公式量化交易模型'),COLORWHITE;% ~ Z7 f& q& z0 M8 n! a- q2 k! X
DRAWTEXT_FIX(C>O,0.005,0.92,0,'Q'),COLORWHITE;
( F' S2 X2 u1 k& k8 PBGS31:= REF(V=HHV(V,100),1) AND REF(C,1) > REF(C,2) AND V <= 0.7*REF(V,1);3 q+ z5 N6 a+ ^ O) h1 g: x
BBZTS31:= REF(ZT,2) AND REF(V,2) >= 2* REF(V,3) AND REF(ZT,1) AND REF(V,1) >= 2* REF(V,2) AND REF(V=HHV(V,60),1) AND V <= 0.7*REF(V,1);- f5 X' l+ |. W$ V6 F) X
BLZT:= REF(ZT,1) AND REF(V,1) >= REF(V,2)*2 AND REF(V=HHV(V,30),1) AND V<= 0.5*REF(V,1);
% ]$ l) b/ T7 T4 }3 b1 NZTBGS31:= REF(ZT,2) AND REF(V=HHV(V,100),1) AND V <= 0.7*REF(V,1);
$ K" g' N9 Y$ G4 d3 O) gDRAWICON(ZTBGS31 OR BBZTS31 OR BGS31 OR TZBS31 OR HF OR ZLC OR BGY OR BGYY OR EBY OR BLZT,H*1.015,9),COLORRED;0 s8 D1 M+ s* r U$ l
均价:AMOUNT/VOL/100,NODRAW,COLORYELLOW;- B' n! M2 P+ H6 O2 Y& j
BK:=IF(INBLOCK('科创板'),0.2,IF(INBLOCK('创业板'),0.2,IF(INBLOCK('ST板块'),0.05,0.1)));% S3 S! z6 O$ `) p" ^1 \
STICKLINE((C>=ZTPRICE(REF(C,1),BK) AND C=H),C,O,2.7,0),COLORFF00FF;1 \/ m, P. D- T# t7 r
STICKLINE((C<=DTPRICE(REF(C,1),BK) AND C=L),C,O,2.7,0),COLOR00BF00;
: `8 O8 C( s5 D6 O1 FTC:=NOT(INBLOCK('创业板')) AND NOT(INBLOCK('科创板'));2 c1 ?$ Y6 L* K k* d
LB10:=H>=REF(C,1)*1.085 AND C< REF(C,1)*1.11 AND C< H AND TC;, v/ l2 c3 h7 E- E' g. V; `
STICKLINE(LB10,H,MAX(O,C),0.02,0),COLORFF00FF;
0 p! r* M3 X$ ~6 JQB10:=C*1.085< REF(C,1) AND C*1.13>REF(C,1) AND C>L AND TC;/ Y) P( C* F* i2 Q4 c4 X
STICKLINE(QB10,L,MIN(O,C),0.02,0),COLORFF8000;
8 `3 ?# G; }0 l+ v1 zLB20:=H>REF(C,1)*1.196 AND C< REF(C,1)*1.22 AND C< H;4 Q8 f) {7 v8 u# E
STICKLINE(LB20,H,MAX(O,C),0.02,0),COLORFF00FF;
9 ]' D- L. t# o' M- Q% G) bQB20:=C*1.192< REF(C,1)AND C*1.26>REF(C,1) AND C>L;
E {5 @! P. qSTICKLINE(QB20,L,MIN(O,C),0.02,0),COLORFF8000;. ?1 C. o; |# `' r+ L
向上跳空:=MIN(C,O)>REF(MAX(C,O),1);
5 P0 C* B5 m( B" v$ Z6 ]" Z5 _明日涨停参考:C*1.1,NODRAW,COLORYELLOW;
, R) `4 E; z4 G明日创业涨停:C*1.2,NODRAW,COLORYELLOW;
8 V$ M' S# S7 _2 S! G9 w/ J# r& eSTICKLINE(向上跳空=1,O,C,0.4,0),COLORYELLOW;
6 ]0 S3 B1 Y6 e) BHS:=VOL/CAPITAL*100;
- i# I! ]! I: a+ s0 U2 Y& q换手比:HS/REF(HS,1),NODRAW,COLORFF00FF; j# }1 ], p. p) X) s1 w
三一:MAX(O,C)-ABS(O-C)/3,NODRAW,COLORYELLOW;+ J( i9 A* ?- D
二一:(O+C)/2,NODRAW,COLORYELLOW;2 X. K& j5 G, ^5 n2 Y, s8 K
三二:MIN(O,C)+ABS(O-C)/3,NODRAW,COLORYELLOW;
2 F5 A" j1 b# P& q3 \& a; d虚31:MAX(H,L)-(H-L)/3,NODRAW,COLORYELLOW;
1 y2 x7 y$ x9 a虚21:(L+H)/2,NODRAW,COLORYELLOW;" @4 i7 a! b+ \/ t
虚32:MIN(H,L)+(H-L)/3,NODRAW,COLORYELLOW;
9 c. m0 W1 q) }4 [AA11:=(REFXV(C,1)+REFXV(C,2)+REFXV(C,3))/3>MAX(O,C) ;
" ?: K% A+ Z# L X9 o高于实顶:IF(AA11,1,0),COLORYELLOW,NODRAW;; D- E- O! k' A. d# S+ w- _
T11:=CONST(LLVBARS(L,10));+ j. M! V2 h3 t) Q+ V9 l+ Q* i- N2 d
T11H:=CONST(REF(H,T11));
/ f$ r! g7 B0 ICC:=CONST(CURRBARSCOUNT);/ \" D/ C6 w, f1 O4 q* y; E
T12:=CONST(BARSLAST(CURRBARSCOUNT>CC+T11 AND H>T11H));
+ p8 r1 s) G& _+ W$ e, p; zT12H:=CONST(REF(H,T12));% k) k+ ]8 v$ f3 S! ^% a
T13:=CONST(BARSLAST(CURRBARSCOUNT>CC+T12 AND H>T12H));& O* B8 Y7 W$ P4 ?8 O i3 e
T13H:=CONST(REF(H,T13));! w7 F, R) r1 a4 L+ S @: `, r
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT(' 【行业】:',HYBLOCK),STRCAT(' 【地域】:',DYBLOCK)),STRCAT(' 【概念】:',GNBLOCK)));
8 i& L! x9 y6 z+ aDRAWTEXT_FIX(O>0,0,0.00,0,所属板块),COLORYELLOW;- _* G. |7 m( }4 ~8 | s: \5 C
DRAWTEXT_FIX(O>0,0,0.05,0,'同花顺概念:');
4 h5 Y d% H) v8 ~0 V! VDRAWTEXT_FIX(O>0,0.08,0.05,0,EXTERNSTR(0,1)),COLORFF00FF;
# N6 p5 j5 D# d# s$ r: \- g自由流通市值:=STRCAT(STRCAT('自由流通市值:', CON2STR(C*FINANCE(46)/100000000,2)),'亿');/ i( }: r: b' K& O
DRAWTEXT_FIX(O>0,0,0.09,0,自由流通市值),COLORYELLOW;
- y. f" A! r- H% {; L% ]一字板:=L=H AND (C+0.005-REF(C,1))/REF(C,1)*100>=10;# v0 i( P5 b& h* t& b
STICKLINE(一字板,REF(C,1),C,2.8,-1),COLORFFEEBB;- m5 ?0 C6 @: ~) K
收阴:=O>C AND (O-C)/O>0.04;
( w1 h9 _* q3 T收阳:=O< C AND (C-O)/O>0.04;
Q+ I) }$ |( r3 y8 ]3 e实体大于4%:=IF(O>C,收阴,收阳);, b' ?- G) h0 x
STICKLINE(实体大于4%,二一,二一,2,0),COLORGRAY;
- @& t( w. P* k. g6 z$ B3 qTK:=C>O AND O>=REF(MAX(C,O),1)+0.01 OR O>=REF(C,1)+0.01 ;
# z0 z3 R1 _# i% ISTICKLINE(TK, O,(C-O)*0.01+O,3,0),COLORYELLOW;/ G2 p. s0 f4 _# P( U
GLT:=CONST(HHVBARS(V,高量天数));
. H2 m$ F" Q( K) X高量顶:=IF(CURRBARSCOUNT<=GLT+1,CONST(REF(MAX(C,O),GLT)),DRAWNULL);3 c! _- Z& V+ U [ g! T; {" Z, t3 M5 I
高量底:=IF(CURRBARSCOUNT<=GLT+1,CONST(IF((REF(MAX(C,O),GLT)-REF(MIN(C,O),GLT))/REF(O,GLT)<=0.033,REF(L,GLT),REF(MIN(C,O),GLT))),DRAWNULL);# q* }4 P ^0 w9 R
STICKLINE(高量底,高量底,高量底,5,0),COLORGREEN;
( U3 {$ u% N5 X1 G/ M& \" w. tSTICKLINE(高量顶,高量顶,高量顶,5,0),COLORRED;
4 q4 a% l4 V. KDRAWTEXT(ISLASTBAR,高量顶,STRCAT(' ','安全线')),COLORRED;
; H9 H8 x0 M2 q0 F: w, G8 ?+ z) m$ JDRAWTEXT(ISLASTBAR,高量底,STRCAT(' ','保命线')),COLORGREEN; |