通达信公式编写常用语句收录
本文介绍收录股票常见的涨跌幅、移动筹码分布、均线交叉等代码语句。 用户在编辑公式时,可以根据情况进行修改和引用。
今日收盘价对于N日内最低收盘价的涨幅(%):
(CLOSE・LLV(CLOSE,N))/LLV(CLOSE,N)*100;
今日收盘价对于N日最高收盘价的涨幅(%):
(HHV(CLOSE,N)-CLOSE)/HHV(CLOSE,N)*100;
股价在过去N日内运行空间的相对位置:
(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
股价上方N1%至N2%处的筹码(%):
AA:=WINNER(C+C*N2/100)*100;
BB:=WINNER(C+C*N 1/100)*100;
AA-BB
股价下方N1%至N2%处的筹码(%): (WINNER(C-C*N 1 /100)-WINNER(C-C*N2/l 00))*100; 收盘价N%处的套牢盘:
100-(WINNER(C*N/l 00))*100;
收盘价N%处的获利盘:
WINNER(C*N/100)*100;
下影线:
(MIN(0,C)-L)/L*100;
上影线:
(H.MAX(O,C))/MAX(O,C)*100;
本周期的涨跌幅:
(C-REF(C,1))/REF(C,1 )*100;
振幅:
(H-L)/L*100;
均线交叉(M、N为均线周期):
CROSS(MA(C,M),MA(C,N));
均线多头排列:
A1:=MA(C,N1);
A2:=MA(C,N2);
A3:=MA(C,N3);
A4:=MA(C,N4);
COUNT(A1>A2 AND A2>A3 AND A3>A4,3);
均线空头排列:
A1:=MA(C,N1);
A2:=MA(C,N2);
A3:=MA(C,N3);
A4:=MA(C,N4);
COUNT(A1<A2 AND A2<A3 AND A3<A4,3);
N日均线向下:
AA:=MA(C,N);
BB:=REF(AA,2);
AA<BB
向前N日至M日出现过均线死叉(P1<P2):
AA:=MA(C,P1);
BB:=MA(C,P1);
CC:=REF(CROSS(BB,AA),N);
COUNT(CC,M);
日成交量大于N日以来的均量:
VOL>MA(VOL,N);
低位密集:
Al:=COST/(85);
A2:=COST(15);
A3:=A1-A2;
A4:=(Al+A2)/2;
A5:=A3/A4*100<10;
Bl:=HHV(H,120);
B2:=LLV(L,120);
B3:=B1-B2;
B4:=(A4-B2)<B3/2;
A5 AND B4;
换手率:
VOL/CAPITAL*100;
N日盈亏:
V1:=VOL/SUM(VOL,N);
V2:=DMA(CLOSE,V1);