部分指标源代码

合集下载

通达信指标算法源码大全

通达信指标算法源码大全

通达信指标算法源码大全.txt本文档整理了一系列通达信指标算法的源码,旨在为用户提供方便和参考。

以下是部分源码示例:1. 移动平均线算法def moving_average(data, d):计算移动平均线moving_avg = []for i in range(d, len(data)):avg = sum(data[d:i]) / dmoving_avg.append(avg)return moving_avg2. 相对强弱指标算法def relative_strength_index(data, d):计算相对强弱指标rsi = []for i in range(d, len(data)):gain = 0loss = 0for j in range(d, i):diff = data[j+1] - data[j]if diff > 0:gain += diffelse:loss -= diffavg____avg_loss = loss / drs = avg_gain / avg_loss___(100 - (100 / (1 + rs)))return rsi3. 布林通道算法def bollinger_bands(data, d, n):计算布林通道middle_band = moving_average(data, d)upper_band = []lower_band = []for i in range(d, len(data)):std_dev = statistics.stdev(data[d:i])upper_band.append(middle_band[i] + n * std_dev)lower_band.append(middle_band[i] - n * std_dev)return middle_band, upper_band, lower_band请注意,以上示例代码仅用于演示通达信指标算法的基本思路,实际应用可能需要根据具体需求进行修改和优化。

各种指标源码范文

各种指标源码范文

各种指标源码范文这里是一些常见的指标源码示例,你可以根据自己的需求进行修改和使用。

1.技术指标:这些指标主要用于评估和分析股票价格的变动趋势,如移动平均线、相对强弱指数(RSI)等。

移动平均线:```pythondef moving_average(data, window):return data.rolling(window).mean```相对强弱指数(RSI):```pythondef relative_strength_index(data, window):diff = data.diff(1).dropnagain = diff.apply(lambda x: x if x > 0 else 0)loss = diff.apply(lambda x: abs(x) if x < 0 else 0)avg_gain = gain.rolling(window).meanavg_loss = loss.rolling(window).meanrs = avg_gain / avg_lossrsi = 100 - (100 / (1 + rs))return rsi```2.财务指标:这些指标用于评估和分析公司的财务状况和经营绩效,如利润率、资产回报率等。

利润率:```python```资产回报率:```python```3.市场指标:这些指标用于评估和分析市场的整体状况和趋势,如股票市盈率、通货膨胀率等。

市盈率:```pythondef price_earnings_ratio(stock_price, earnings_per_share): return stock_price / earnings_per_share```通货膨胀率:```pythondef inflation_rate(current_price_level,previous_price_level):return ((current_price_level - previous_price_level) / previous_price_level) * 100```请注意,以上示例只是源码的一部分,还可能需要根据具体需求进行修改和完善。

自用(操盘主图)指标源码

自用(操盘主图)指标源码

操盘主图源码(已测试,自用),看趋势特别简洁HH:=(20*H+19*REF(H,1)+18*REF(H,2)+17*REF(H,3)+16*REF(H,4)+15*REF(H,5)+14*REF(H,6)+13*R EF(H,7)+12*REF(H,8)+11*REF(H,9)+10*REF(H,10)+9*REF(H,11)+8*REF(H,12)+7*REF(H,13)+6*REF( H,14)+5*REF(H,15)+4*REF(H,16)+3*REF(H,17)+2*REF(H,18)+REF(H,20))/210,COLORBLUE,LINETHICK1;LL:=(20*L+19*REF(L,1)+18*REF(L,2)+17*REF(L,3)+16*REF(L,4)+15*REF(L,5)+14*REF(L,6)+13*REF (L,7)+12*REF(L,8)+11*REF(L,9)+10*REF(L,10)+9*REF(L,11)+8*REF(L,12)+7*REF(L,13)+6*REF(L,14) +5*REF(L,15)+4*REF(L,16)+3*REF(L,17)+2*REF(L,18)+REF(L,20))/210,COLORBLUE,LINETHICK1;D90H:=EMA(HH,90),COLORRED,LINETHICK1;D90L:=EMA(LL,90),COLORRED,LINETHICK1;DGH:=(20*H+19*REF(H,1)+18*REF(H,2)+17*REF(H,3)+16*REF(H,4)+15*REF(H,5)+14*REF(H,6)+13* REF(H,7)+12*REF(H,8)+11*REF(H,9)+10*REF(H,10)+9*REF(H,11)+8*REF(H,12)+7*REF(H,13)+6*RE F(H,14)+5*REF(H,15)+4*REF(H,16)+3*REF(H,17)+2*REF(H,18)+REF(H,20))/210,COLORBLUE,LINETHICK1;DDL:=(20*L+19*REF(L,1)+18*REF(L,2)+17*REF(L,3)+16 *REF(L,4)+15*REF(L,5)+14*REF(L,6)+13*REF(L,7)+12*REF(L,8)+11*REF(L,9)+10*REF(L,10)+9*REF (L,11)+8*REF(L,12)+7*REF(L,13)+6*REF(L,14)+5*REF(L,15)+4*REF(L,16)+3*REF(L,17)+2*REF(L,18)+REF(L,20))/210,COLORBLUE,LINETHICK1;D90C:=D90H-D90L;D90D:=D90H+D90C*2,COLORRED,L INETHICK1;D90T:=D90L-D90C*2,COLORRED,LINETHICK1;G0:=(XMA(XMA(H,25),25)-XMA(XMA( L,25),25))*1+XMA(XMA(H,25),25),LINETHICK1,COLORWHITE;D0:=XMA(XMA(L,25),25)-(XMA(X MA(H,25),25)-XMA(XMA(L,25),25))*1,LINETHICK1,COLORWHITE;DTD:=D0>=D90T AND G0>=D90D;KTD:=G0<=D90D AND D0<=D90T;ZDD:=D0>=D90T AND G0<=D90D;BDD0:=(XMA(XMA(H,60),60)-XMA(XMA(L,60),60))*3+XMA(XMA(H,60),60),LINETHIC K2,COLORGREEN;BDT0:=XMA(XMA(L,60),60)-(XMA(XMA(H,60),60)-XMA(XMA(L,60),60))*3,LIN ETHICK2,COLORGREEN;STICKLINE(DTD=1,G0,D0,5,0),COLOR000066;STICKLINE(KTD=1,G0,D0, 5,0),COLOR003300;STICKLINE(ZDD=1,G0,D0,5,0),COLOR555555;上轨:(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),DOTLINE,COLORWHITE;下轨:XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,DOTLINE,COLORWHITE; MA90:MA(C,90),LINETHICK5,COLORLIGREEN;QQ1:=下轨>D90H AND 下轨>REF(下轨,1) AND REF(下轨,1)>REF(下轨,2) AND REF(下轨,2)>REF(下轨,3) AND REF(下轨,3)>REF(下轨,4) ;IF(QQ1,MA90,DRAWNULL),LINETHICK5,COLORLIMAGENTA;HD:=DRAWLINE(HIGH>=HHV(HIGH,20),HIGH,LOW<=LLV(LOW,20),HHV(HIGH,4),1),LINETHICK2 ,COLORMAGENTA;HK:=DRAWLINE(LOW<=LLV(LOW,20),LOW,HIGH>=HHV(HIGH,20),LLV(LOW,4),1),LINETHICK2,C OLORWHITE;BSB:=EMA((CLOSE+HIGH+LOW)/3,3);BSM:=EMA(SLOPE((CLOSE+HIGH+LOW)/3,24)*20+(CLOSE+HIGH+LOW)/3,48),POINTDOT,COLOR YELLOW;STICKLINE(BSB>=BSM,LOW,HIGH,0.0,0),COLORRED;STICKLINE(BSB>=BSM,CLOSE,OPEN,3,1),COLORRED;STICKLINE(BSB<=BSM,LOW,HIGH,0.0,0),COLORGREEN;STICKLINE(BSB<=BSM,CLOSE,OPEN,3,1),COLORGREEN;白色点多定位1:=L<下轨AND H>下轨;白色点空定位1:=H>上轨AND L<上轨;STICKLINE(白色点多定位1=1,L,下轨,3,0),COLORMAGENTA;STICKLINE(白色点空定位1=1,H,上轨,3,0),COLORGREEN;白色点多定位2:=H<下轨;白色点空定位2:=L>上轨;STICKLINE(白色点多定位2=1,L,H,0.0,0),COLORMAGENTA;STICKLINE(白色点多定位2=1,C,O,3,0),COLORMAGENTA;STICKLINE(白色点空定位2=1,L,H,0.0,0),COLORGREEN;STICKLINE(白色点空定位2=1,C,O,3,0),COLORGREEN;{多头多定位:=CROSS(ZD1,L) AND DTD=1;多头平定位:=CROSS(H,ZK1) AND DTD=1 AND ZDD=0;空头空定位:=CROSS(H,ZK1) AND KTD=1;空头平定位:=CROSS(ZD1,L) AND KTD=1 AND ZDD=0;震荡多定位:=CROSS(ZD1,L) AND ZDD=1;震荡空定位:=CROSS(H,ZK1) AND ZDD=1;DRAWICON(空头平定位=1,L,5);DRAWICON(多头平定位=1,H,6);DRAWICON(多头多定位=1 OR 震荡多定位=1,L,5);DRAWICON(空头空定位=1 OR 震荡空定位=1,H,6);}DRAWTEXT(ISLASTBAR,上轨,'卖'),COLORGREEN;DRAWTEXT(ISLASTBAR,下轨,'买'),COLORRED;MA20:MA(C,20),LINETHICK2,COLORWHITE;DRAWTEXT(CURRBARSCOUNT=3,HIGH*1.02,'3'), COLORYELLOW;DRAWTEXT(CURRBARSCOUNT=5,HIGH*1.02,'5'), COLORYELLOW;DRAWTEXT(CURRBARSCOUNT=8,HIGH*1.02,'8'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=13,HIGH*1.02,'13'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=21,HIGH*1.02,'21'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=34,HIGH*1.02,'34'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=55,HIGH*1.02,'55'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=89,HIGH*1.02,'89'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=144,HIGH*1.02,'144'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=233,HIGH*1.02,'233'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=377,HIGH*1.02,'377'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=610,HIGH*1.02,'610'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=987,HIGH*1.02,'987'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=1597,HIGH*1.02,'1597'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=2584,HIGH*1.02,'2584'), COLORYELLOW; DRAWTEXT(CURRBARSCOUNT=4181,HIGH*1.02,'4181'), COLORYELLOW;。

5款指标源码分享,需要的自己领取!!!

5款指标源码分享,需要的自己领取!!!

5款指标源码分享,需要的自己领取郑重申明:本公众号【秘术抓波段】,专注于回调买进模式,本公众号所述股票均由本人亲自选出,仅供本人技术理论研究所用,同时最好结合市场方向,技术为辅!每周都会选出优质股票供大家参考,每周也会有免费指标代码送出,大家关注并且置顶,每周消息不容错过。

文中所述股票名称或代码,仅为学习、交流、探讨,不构成任何实际买卖操作建议,股市有风险,入市需谨慎!公众号源码后台分享有时候会出现乱码,或者我自己复制过去出现漏掉的现象,今天把前面分享的指标源码重新发给大家:1.分时大单统计指标(资金统计必须要用到未来函数,不影响使用):X_1:=IF(AMOUNT>=FINANCE(40)*0.05/100 AND DCLOSE>=DOPEN,AMOUNT/10000,0);X_2:=IF(AMOUNT>=FINANCE(40)*0.05/100 AND DCLOSE<=DOPEN,AMOUNT/10000,0);ISBUYORDER;ISBUYORDER;X_3:=IF(AMOUNT>=FINANCE(40)*0.025/100 AND AMOUNT<FINANCE(40)*0.05/100 AND DCLOSE>=DOPEN,AMOUNT/10000,0);X_4:=IF(AMOUNT>=FINANCE(40)*0.025/100 AND AMOUNT<FINANCE(40)*0.05/100 AND DCLOSE<=DOPEN,AMOUNT/10000,0);ISBUYORDER;ISBUYORDER;X_5:=IF(AMOUNT>=FINANCE(40)*0.005/100 AND AMOUNT<FINANCE(40)*0.025/100 AND DCLOSE>=DOPEN,AMOUNT/10000,0);X_6:=IF(AMOUNT>=FINANCE(40)*0.005/100 AND AMOUNT<FINANCE(40)*0.025/100 AND DCLOSE<=DOPEN,AMOUNT/10000,0);ISBUYORDER;X_7:=IF(AMOUNT<FINANCE(40)*0.005/100 AND DCLOSE>=DOPEN,AMOUNT/10000,0);X_8:=IF(AMOUNT<FINANCE(40)*0.005/100 AND DCLOSE<=DOPEN,AMOUNT/10000,0);X_9:=SUM(X_1,0)-SUM(X_2,0)+(SUM(X_3,0)-SUM(X_4,0))+(SUM(X_5,0)-SUM(X_6,0))+(SUM(X_7,0)-SUM(X_8,0));X_10:=X_9;X_11:=SUM(X_1,0)-SUM(X_2,0)+(SUM(X_3,0)-SUM(X_4,0));超:SUM(X_1,0)-SUM(X_2,0),COLORYELLOW;DRAWTEXT_FIX(1,0.99,5,2,'微信公众号:秘术抓波段'),COLORYELLOW;X_12:=SUM(X_7,0)-SUM(X_8,0);X_13:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/CAPITAL*100,IF(CL OSE<REF(CLOSE,1),(-VOL)/CAPITAL*100,0)),0);X_14:=VOL*CLOSE/100;X_15:=SUM(IF(X_14/8>20 AND CLOSE>REF(CLOSE,1),X_14,0),0);X_16:=SUM(IF(X_14/8>20 AND CLOSE<REF(CLOSE,1),X_14,0),0);X_17:=SUM(IF(X_14/8<20 AND CLOSE>REF(CLOSE,1),X_14,0),0);X_18:=SUM(IF(X_14/8<20 AND CLOSE<REF(CLOSE,1),X_14,0),0);X_19:=X_15+X_16+X_17+X_18;X_20:=IF(ISLASTBAR,100*X_15/X_19,0);X_21:=IF(ISLASTBAR,100*X_16/X_19,0);X_22:=IF(ISLASTBAR,100*X_17/X_19,0);X_23:=IF(ISLASTBAR,100*X_18/X_19,0);X_24:=X_15;X_25:=X_16;2.平台划线指标:M60:MA(CLOSE,60)COLORGREEN,LINETHICK2;DRAWTEXT_FIX(1,0.99,5,2,'微信公众号:秘术抓波段'),COLORYELLOW;{突破前高线}VAR1:=CLOSE-LOW;VAR2:=HIGH-LOW;VAR3:=CLOSE-HIGH;VAR4:=IF(HIGH>LOW,(VAR1/VAR2+VAR3/VAR2)*VOL,0);HPTP:=SUM(VAR4,10)/10000,COLORSTICK;TKXL:=-1;XVYO:=UPNDAY(TKXL,1),NODRAW;G:=MA(C,5);D:=MA(C,10);HH:=REF(H,5)=HHV(H,11);LL:=REF(L,5)=LLV(L,11);FG01:=BACKSET(HH,6)>BACKSET(HH,5);FD01:=BACKSET(LL,6)>BACKSET(LL,5);FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);FGH:=REF(H,BARSLAST(FG0));FGL:=REF(L,BARSLAST(FG0));FGH1:=REF(H,BARSLAST(FG0)+1);FGL1:=REF(L,BARSLAST(FG0)+1);FGL2:=REF(L,BARSLAST(FG0)+2);FDH2:=REF(H,BARSLAST(FD0)+2);FDH:=REF(H,BARSLAST(FD0));FDL:=REF(L,BARSLAST(FD0));FDH1:=REF(H,BARSLAST(FD0)+1);FDL1:=REF(L,BARSLAST(FD0)+1);FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));FG1:=FGH>FDZH AND FG0;FD1:=FDL<FGZL AND FD0;FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));BHG:=COUNT(BH0,BARSLAST(FD0));BHD:=COUNT(BH0,BARSLAST(FG0));BGQ:=COUNT(GQ,BARSLAST(FD0));BDQ:=COUNT(DQ,BARSLAST(FG0));BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));G1X:=(FG AND BARSLAST(FD)>BK),NODRAW;D1X:=(FD AND BARSLAST(FG)>BK),NODRAW;G1:=(FG0 ANDREF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));{W:=IF(DATE<1201231,C,DRAWNULL);}D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G 1)),REF(H,BARSLAST(D1))),NODRAW;D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1) ),REF(L,BARSLAST(G1))),NODRAW;G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);NN:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2))AND BARSLAST(D2)>BARSLAST(G2));UU:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2))AND BARSLAST(G2)>BARSLAST(D2));找顶线:DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORGREEN,DOTLI NE;找底线:DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLORRED,DOTLINE;ZT:=C=ZTPRICE(REF(C,1),0.1);STICKLINE(ZT,C,O,2,0),COLORMAGENTA;DRAWICON(CROSS(C,找顶线),找顶线*1.01,34);3.左山峰指标(手机指标需要删除主题概念代码,电脑版直接复制即可):{主题概念}ZZ1:=STRCAT(HYBLOCK,'----');Z2:=STRCAT(ZZ1,FGBLOCK);Z3:=STRCAT(Z2,DYBLOCK);Z4:=STRCAT(Z3,'----');DRAWTEXT_FIX(1,0.00,0.06,0,' 主题概念:')COLORCYAN;DRAWTEXT_FIX(ISLASTBAR,0.07,0.06,0,STRCAT(Z4,GNBLOCK )),COLORCYAN;DRAWTEXT_FIX(1,0.07,0.24,0,EXTERNSTR(0,14))COLORYELL OW;M1:=21;M2:=0;M3:=120;M4:=63;MA7:MA(CLOSE,M1);MA14:MA(CLOSE,M2);MA21:MA(CLOSE,M3);MA63:MA(CLOSE,M4)COLORGREEN,LINETHICK3;LT:=LLVBARS(L,60);LT1:=LLVBARS(L,60);LTT:=BARSLAST(CURRBARSCOUNT=CONST(LT)+1);HT:=FINDHIGHBARS(H,LT+1,60,1);DT:=FINDLOW(L,LT1+1,60,1);锅盖:DRAWLINE(CURRBARSCOUNT=CONST(HT)+1,H,ISLASTBAR,REF(H,HT),0),COLORYELLOW ,LINETHICK3;TT:=BARSLAST(CURRB ARSCOUNT=CONST(HT)+1);AA:=CROSS(C,CONST(锅盖));TJ:=COUNT(AA,TT+1)=1 AND AA;TJ1:=COUNT(V<MA(V,277),TT+1) ;BL:=TJ1/(TT+1)*100;。

各种指标源码范文

各种指标源码范文

各种指标源码范文```pythonclass Metrics:def __init__(self):self.data = []def add_data(self, value):self.data.append(value)def get_average(self):if len(self.data) == 0:return Nonereturn sum(self.data) / len(self.data) def get_max(self):if len(self.data) == 0:return Nonereturn max(self.data)def get_min(self):if len(self.data) == 0:return Nonereturn min(self.data)def get_sum(self):if len(self.data) == 0:return Nonereturn sum(self.data)def get_count(self):return len(self.data)#测试m = Metricsm.add_data(10)m.add_data(20)m.add_data(30)print("Average:", m.get_average() print("Max:", m.get_max()print("Min:", m.get_min()print("Sum:", m.get_sum()print("Count:", m.get_count()```在这个范例中,我们定义了一个 `Metrics` 类,该类包含了一些基本指标的计算方法,比如平均值、最大值、最小值、总和和计数。

我们可以通过调用相应的方法来获取这些指标,然后用于监控和分析。

通过这个简单的指标源码范文,我们可以看到如何使用面向对象的思维来构建一个简单的指标工具。

指标公式源码大全

指标公式源码大全

指标公式源码大全指标公式是在金融市场和经济领域中广泛使用的一种数学算法,用于分析股票、商品、货币和其他金融工具的走势和趋势。

指标公式可以帮助投资者和交易员判断市场的方向,制定买卖策略,提高交易效率和收益率。

下面是一些常用的指标公式的源码大全,供大家参考和学习。

1. 移动平均线(MA)```def moving_average(data, window):ma_values = []for i in range(len(data) - window + 1):ma = sum(data[i:i + window]) / windowma_values.append(ma)return ma_values```2. 相对强弱指标(RSI)```def rsi(data, period):delta = np.diff(data)gain = np.where(delta > 0, delta, 0)loss = np.where(delta < 0, -delta, 0)avg_gain = moving_average(gain, period)avg_loss = moving_average(loss, period)rs = avg_gain / avg_lossrsi = 100 - (100 / (1 + rs))return rsi```3. 指数移动平均线(EMA)```def ema(data, period):ema_values = [data[0]]for i in range(1, len(data)):ema = ((data[i] - ema_values[-1]) * (2 / (period + 1))) + ema_values[-1] ema_values.append(ema)return ema_values```4. 随机指标(KDJ)```def kdj(data, n, m):high_list = data['high'].rolling(n).max()low_list = data['low'].rolling(n).min()rsv = (data['close'] - low_list) / (high_list - low_list) * 100k = sma(rsv, m)d = sma(k, m)j = 3 * k - 2 * dreturn k, d, j```5. 布林线指标(Bollinger Bands)```def bollinger_bands(data, window, n):ma = moving_average(data, window)std = pd.Series(data).rolling(window).std()upper_band = ma + (std * n)lower_band = ma - (std * n)return upper_band, lower_band```以上就是一些常用的指标公式的源码大全,希望对大家的学习和实践有所帮助。

51个优秀公式指标源码

51个优秀公式指标源码

51个优秀公式指标源码{短线套利主图}ma6:ma(c,6),colorwhite,linethick2;ma18:ma(c,18),color0099ff,linethick2;ma55:ma(c,55),colorff00FF;ma125:ma(c,125),colorffcc66;ma250:ma(c,250),colorblue;TY:=C;A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10); C1:=BACKSET(B1,10+1);HD:=FILTER(C1,10);A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10); C2:=BACKSET(B2,10+1);LD:=FILTER(C2,10);A:=REF(C,BARSLAST(HD)); B:=REF(C,BARSLAST(LD)); t1:=BARSLAST(HD)&lt;BARSLAST(LD) AND NOT(HD) ; t2:=BARSLAST(HD)&gt;BARSLAST(LD) AND NOT(LD); 波峰:IF(t1,A,A),ColorFF00FF,POINTDOT;STICKLINE(t1,A,A,9,0),ColorFF00FF;波谷:IF(t2,B,B),Color80FF00,POINTDOT;STICKLINE(t2,B,B,9,0),Color80FF00;买进价:=((c-ref(ma6,1))/6+ma6)*1.004;买进条件:=cross(c,买进价) and 买进价&gt;ref(买进价,1); 白K买进:IF(买进条件,l,h),COLORWHITE,POINTDOT; STICKLINE(买进条件,h,l,0,1),colorwhite,linethick2; STICKLINE(买进条件,o,c,4,1),colorwhite,linethick2;加码价:=((c-ref(ma18,1))/18+ma18)*1.004;加码条件:=cross(c,加码价) and 加码价&gt;ref(加码价,1); 黄K加码:IF(加码条件,l,h),coloryellow,POINTDOT; STICKLINE(加码条件,h,l,0,1),coloryellow,linethick2; STICKLINE(加码条件,o,c,4,1),coloryellow,linethick2;{[通达信]开发人自称价值200万的设置为主图}多:EMA(C,3),COLORYELLOW;空:EMA(C,5),COLOR00FF00;均衡:EMA(空,5),COLORWHITE,;VARF1:=COUNT(CROSS(多,均衡),2)=1;VARF2:=COUNT(CROSS(空,均衡),2)=1;ZAI:=FILTER(VARF1 AND VARF2,2);DRAWTEXT(ZAI,均衡,'主升↑'),COLORFF00FF;VV2:=REF(CLOSE,1);VV3:=SMA((CLOSE-VV2),6,1)/SMA(ABS(CLOSE-VV2),6,1)*100;DRAWICON(REF(VV3,1)&gt;81 AND VV3&lt;80,HIGH,2); DRAWTEXT(REF(VV3,1)&gt;81 ANDVV3&lt;80,HIGH*1.03,'沽空↓'),COLOR YELLOW;VF1:=MA(CLOSE,60)-MA(CLOSE,5)/3.2;DRAWTEXT(IF(CLOSE&lt;VF1 ANDVOL/240&gt;MA(VOL,5)/240 ANDCLOSE&gt;=REF(CLOSE,1)*1.08 ANDCLOSE&lt;MA(CLOSE,13)*1.3,1,0),LOW,''),COLORRED; VARA:=(CLOSE-REF(OPEN,29))/REF(OPEN,29)*100; VARB:=EMA(0.667*REF(VARA,1)+0.333*VARA,5); DRAWTEXT(IF(VOL&gt;=1.3*MA(VOL,5) ANDCOUNT(VARA&gt;=VARB ANDVARA&lt;-17,3) ANDREF(LOW,1)=LLV(LOW,120),1,0),LOW,'注意买入'); VARR1:=SMA(MAX(CLOSE-REF(C,1),0),6,1)/SMA(ABS( CLOSE-REF(C,1)),6,1)*100;DRAWICON(CROSS(82,VARR1),HIGH,2); DRAWTEXT(CROSS(82,VARR1),HIGH,'短空↓'),COLORYELLOW;VAR1:=(HIGH+LOW+OPEN+2*CLOSE)/5;VAR2:=REF(VAR1,1);VAR3:=SMA(MAX(VAR1-VAR2,0),10,1)/SMA(ABS(VAR1-VAR2),10,1)*100;HY3:=IF(COUNT(VAR3&lt;20,5)&gt;=1 ANDCOUNT(VAR1=LLV(VAR1,10),10)&gt;=1 ANDCLOSE&gt;=OPEN*1.038 ANDVOL&gt;MA(VOL,5)*1.2,1,0);DRAWTEXT(HY3,LOW,'注意买入'),COLORRED;S:=MA(VOL,5)/MA(VOL,60),COLORRED,,LINETHICK2; A:=MA(S,5),COLORGREEN,,LINETHICK2;BIAS:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100;F:=MA(S,121);RSV:=(CLOSE-LLV(LOW,45))/(HHV(HIGH,45)-LLV(LOW, 45))*100;K:=SMA(RSV,15,1);D:=SMA(K,15,1);J:=3*K-2*D;LC:=REF(CLOSE,1);RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC ),6,1)*100;DRAWTEXT(CROSS(84,RSI) , HIGH*1.06,'逃顶!'),COLORYELLOW ;S1:=IF((J&lt;11 AND BIAS&gt;-11 AND CROSS( S,F) AND(S-F)&gt;0.010),2,0),STICK,LINETHICK3,COLORGREEN; DRAWTEXT(S1=2,LOW,'关注'), COLORGREEN;中轨:HHV(MA(H,13),13),COLORRED,LINETHICK2;趋势:LLV(MA(H,13),1),COLORGREEN,LINETHICK2;{买卖指标}SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*1 00&gt;100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C, 20))*100);AA10:MA(CLOSE,8),COLOR0000FF;AA12:MA(CLOSE,1 2),COLOR0000FF;BB10:=((ATAN((AA10- REF(AA10,1))) * 3.1416) * 10);BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) *10);MA13:=MA(CLOSE,13);STICKLINE((((AA12 &lt;= AA10) AND (BB12 &gt;= 1)) AND (BB10 &gt;=1)),AA10,AA12,4,0),COLOR0080FF;STICKLINE((((AA12 &gt;= AA10) AND (BB10 &lt;= 1)) AND (BB10 &lt;=1)),AA10,AA12,4,0),COLOR00FF00;X1:=(C+L+H)/3;BB13:=ATAN(EMA(X1,13)-REF(EMA(X1, 13),1))*3.1416*10;EMA8:=EMA(C,8);DRAWTEXT(FILTER(BB13&gt;1 AND EMA(X1,13)&gt;REF(EMA(X1,8),1),10),EMA8,'∠45上升'),COLORWHITE;压力:MA(REF(HHV(C,30),1),2),COLOR9DFFFF;支撑:MA(REF(LLV(C,30),1),2),COLORABFF46;AA1:=AMOUNT/V;BB1:=L&lt;AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100&gt;1.2;DD1:=L&lt;MA( C,5)*0.921;EE1:=V&lt;MA(V,5)*1.5;FF1:=BB1 AND CC1 AND DD1 ANDEE1;DRAWTEXT(FF1,(LOW*0.99),'老鼠仓'),COLOR4080FF;A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5, 1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1); 黑马线:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L, 21)))*100;趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2)); DRAWTEXT(CROSS(趋势线,0)AND 黑马线&lt;40,(HIGH* 0.97),'▲大黑马'),COLORYELLOW;LC:=REF(CLOSE,1);RSI:=((SMA(MAX((CLOSE -LC),0),3,1) /SMA(ABS((CLOSE - LC)),3,1)) * 100);FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);DRAWTEX T(CROSS(FF,MA15),(LOW* 0.99),'底背离'),COLORA6E500;DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),COLOR1880FF;VAR2:=LLV(LOW,27);VAR3:=HHV(HIGH,34);VAR4:=EMA ((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*25;注意买:=IF((VAR4&lt;10),80,100);RSV:=(C-LLV(L,9))/(HHV(H,9 )-LLV(L,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;超跌:=IF(J&lt;0,10,0);BDDD:=LLV(J,2)=LLV(J,8);买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD ANDJ&lt;20,30,0);DRAWTEXT(买入AND 注意买=100 AND 超跌=0,LOW,'短线'),COLOR8000FF;MTM:=C-REF(C,1);DX:=100*EMA(EMA(MTM,6),6)/EMA( EMA(ABS(MTM),6),6);买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX&lt;0,2) ANDCROSS(DX,MA(DX,2)),1,0);{天机均线}EMA250:MA(C,250),COLORRED;EMA6:MA(C,6),COLORRED LINETHICK2;EMA18:MA(C,18),COLORYELLOW;EMA55:MA(C,55),COLORFF00FF;EMA144:MA(C,144),COLORGREEN;EMA288:MA(C,288),COLORBLUE;中线【买入】:=COUNT(CLOSE&lt;EMA18,5)=4 AND CLOSE/EMA18&gt;1.004 AND CROSS(CLOSE,EMA18) AND EMA18&gt;=REF(EMA18,1),LINETHICK,COLORRED;DRAWTEXT(中线【买入】,LOW*0.95,' 中线【买入】'),COLORRED;VL:=REF(LOW,1);VAR12:=(SMA(ABS(LOW-VL),13,1))/(SMA(MAX(LOW-VL ,0),13,1))*100;VAR14:=MA(VAR12,13);VAR15:=LLV(LOW,34);VAR18:=EMA(IF(LOW&lt;=VAR15,VAR14,0),3);VAR110:=SMA(SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH, 54)-LLV(LOW,54))*100,7,1),5,1);VAR111:=SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-L LV(LOW,54))*100,7,1)*16.18-VAR110*10.9;T:=FILTER(IF(VAR111&lt;=VAR110 ANDVAR18&gt;REF(VAR18,1),VAR18*8,0),20); DRAWTEXT(T,LOW-0.4,'←洗盘结束'),COLORFF00FF; DRAWTEXT(T,LOW-0.2,'|'),COLORFF00FF;VAR21:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LO W,36))*100;VAR22:=SMA(VAR21,3,1);VAR23:=SMA(VAR22,3,1);VAR24:=SMA(VAR23,3,1);VAR25:=CROSS(VAR23,VAR24) AND VAR23&lt;20; DRAWTEXT(FILTER(VAR25,10)=1,LOW-0.4,'←抄底'),COLORRED;DRAWTEXT(FILTER(VAR25,10)=1,LOW-0.2,'|'),COLORR ED;VAR29:=CROSS(VAR24,VAR23) AND VAR23&gt;80; DRAWTEXT(FILTER(VAR29,5)=1,HIGH+0.4,'←逃顶'),COLORBLUE;DRAWTEXT(FILTER(VAR29,5)=1,HIGH+0.2,'|'),COLORB LUE;{(使用说明:天机均线1.该指标有明确的抄底,逃顶,洗盘结束信号及中线买入信号;2.均线设置周期为250,6,18,55,144,288;3.如果144线向上,出现洗盘结束+抄底为低吸的好机会;4.超短线用5分钟周期,短线用60分钟周期;股市无对错,只有赢和赔! 指标无好坏,操作在个人!在此特别感谢一发千钧大师,本指标沿用了大师的部分理念截图三个,一个跨度较长,一个跨度较短,另一个为60分钟周期,其他自行验证;操作要领1.有时间盯盘的按15分钟短线波段操作,只做"吃鱼身子"的上升行情,2.没时间看盘的按60分钟做波段操作,也能将"鱼"吃干净.3.长线爱好者用周线选股可免盯,看盘之苦,安然做"投资"4.中线爱好者用日线选股可安然做波段,避免坐"电梯".5.短线爱好者用30分钟线看盘可享受"冲浪"的快乐,安全做"投机".6.超短线(头天进、二天出)的用5分钟看盘"永不套牢".7.高手中的高手用1分钟线盯盘可享受"权证"的盛宴,"痛并快乐着".操盘要点1.定位:量身定做一套发挥"自身条件"的操作方案,严守买卖纪律.2.定势:趋势方向的判定,信自己的"感觉",顺势者心自顺.3.定量:针对不同(个股)行情阶段,严控投入资金比例,进退自如,先立于不败之地.4.定律:破底莫入、破顶莫追}高胜算系统操盘线:MA(C,4),COLORRED,LINETHICK3;安全线:MA(C,19),COLORGRAY,LINESTICK,LINETHICK1;牛熊分界线:MA(C,200),COLORYELLOW,CIRCLEDOT,LINETHICK 1;DRAWTEXT(CROSS(安全线,操盘线),H*1.01,'←S卖出'),Color00FF00;DRAWTEXT(CROSS(操盘线,安全线),L*0.99,'←B买入'),Color00FFFF;STICKLINE(CROSS(操盘线,安全线) ANDBACKSET(CLOSE&gt;操盘线,2) AND(操盘线&gt;安全线) AND (CLOSE&gt;安全线),OPEN,CLOSE,2,1),COLORYELLOW;STICKLINE(CROSS(安全线,操盘线) ANDBACKSET(CLOSE&lt;操盘线,2) AND(操盘线&lt;安全线),OPEN,CLOSE,2,1);DRAWICON(CROSS(操盘线,安全线),L*0.98,1); DRAWICON(CROSS(安全线,操盘线),H*1,2);通达信主图公式:垂帘听股MA5:=MA(C,5);A:=(3*C+L+O+H)/6;垂帘:(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*R EF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+ 10*REF(A,10)+9*REF(A,11)+8*REF(A,12)+7*REF(A,13)+6*REF(A,14)+ 5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+REF(A,20))/21 0,COLORRED,POINTDOT;听股:MA(垂帘,13),COLORFFCCCC,CIRCLEDOT;ZAR1:=SLOPE(EMA(CLOSE,2),5)*15+C;ZAR2:=EMA(ZAR1,5);ZARA:=EMA(EMA(EMA(EMA(EMA(EMA(EMA(EMA(ZAR 2,5),5),5),5),5),5),5),5);ZARB:=BARSLAST(CROSS(CLOSE,ZARA));ZARC:=BARSLAST(CROSS(ZARA,CLOSE)); STICKLINE(CLOSE&lt;ZARA,REF(CLOSE,ZARC),REF(C LOSE,ZARC),12,0),LINETHICK2,COLORFFCCCC; STICKLINE(CLOSE&gt;ZARA ANDCLOSE&gt;REF(CLOSE,ZARB),REF(CLOSE,ZARB),垂帘,0.2,0),COLORFFC8FF;STICKLINE(CLOSE&gt;ZARA ANDCLOSE&gt;REF(CLOSE,ZARB),REF(CLOSE,ZARB),REF (CLOSE,ZARB),12,0),COLORFFC8FF,LINETHICK2; {上涨:=0,COLORFFC8FF;}STICKLINE(CLOSE&lt;ZARA ANDCLOSE&lt;REF(CLOSE,ZARC),REF(CLOSE,ZARC),垂帘,0.2,0),COLOR00FF00;{止盈止损:0,COLOR00FF00;}VAR41:=EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(L OW,34)),3);VAR42:=EMA(100*(INDEXC-LLV(INDEXL,34))/(HHV(INDEXH,34)-LLV(INDEXL,34)),3);VAR4A:=REF(VAR41,1)&gt;92 AND VAR41&lt;92; DRAWTEXT(VAR4A,H+0.12,'●短卖'),COLOR00FF00;STICKLINE(C&gt;=O,H,L,0,0),COLORRED; STICKLINE(C&lt;O,H,L,0,0),COLORFFFF52; STICKLINE(C&gt;=O,C,O,4,1),COLORRED; STICKLINE(C&lt;O,C,O,4,0),COLORFFFF52;MA13:MA(C,13),COLORWHITE,LINETHICK2;MA55:=MA(C,55),COLORFF00FF;MA125:=MA(C,125),COLORFFCC66;MA250:=MA(C,250),COLORBLUE;{STICKLINE(CROSS(MA5,听股) AND MA5&gt;听股AND C&gt;O,MA13,MA13-0.09,4,0),COLORYELLOW;} DRAWTEXT(CROSS(MA5,听股) AND MA5&gt;听股AND C&gt;O,MA13-0.12,'垂帘听股'),COLORWHITE;T:=BARSLAST(L&gt;REF(H,1));E:=COUNT(L&lt;REF(H,T+1),T)&lt;2;STICKLINE(L&lt;REF(H,T+1 ) ANDE,L,L-0.09,4,0),COLOR0099FF;DRAWTEXT(L&lt;REF(H,T+1 ) AND E,L-0.12,'缺口回补'),COLOR0099FF;VLL:=CROSS(MA(C,13),MA(C,21));DRAWTEXT(VLL,M A13,'●圆弧底'),COLORYELLOW;精品均线战法主图公式集{短线套利主图}ma6:ma(c,6),colorwhite,linethick2;ma18:ma(c,18),color0099ff,linethick2;ma55:ma(c,55),colorff00FF;ma125:ma(c,125),colorffcc66;ma250:ma(c,250),colorblue;TY:=C;A1:=REF(TY,10)=HHV(TY,2*10+1);B1:=FILTER(A1,10); C1:=BACKSET(B1,10+1);HD:=FILTER(C1,10);A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10); C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);A:=REF(C,BARSLAST(HD));B:=REF(C,BARSLAST(LD));t1:=BARSLAST(HD)&lt;BARSLAST(LD) AND NOT(HD) ;t2:=BARSLAST(HD)&gt;BARSLAST(LD) ANDNOT(LD);波峰:IF(t1,A,A),ColorFF00FF,POINTDOT;STICKLINE(t1,A,A,9,0),ColorFF00FF;波谷:IF(t2,B,B),Color80FF00,POINTDOT;STICKLINE(t2,B,B,9,0),Color80FF00;买进价:=((c-ref(ma6,1))/6+ma6)*1.004;买进条件:=cross(c,买进价)and买进价&gt;ref(买进价,1);白K买进:IF(买进条件,l,h),COLORWHITE,POINTDOT; STICKLINE(买进条件,h,l,0,1),colorwhite,linethick2; STICKLINE(买进条件,o,c,4,1),colorwhite,linethick2;加码价:=((c-ref(ma18,1))/18+ma18)*1.004;加码条件:=cross(c,加码价)and加码价&gt;ref(加码价,1);黄K加码:IF(加码条件,l,h),coloryellow,POINTDOT; STICKLINE(加码条件,h,l,0,1),coloryellow,linethick2; STICKLINE(加码条件,o,c,4,1),coloryellow,linethick2;{指标要点:白K买进,黄K加码.指标原理:短线均线设为6日和18日。

28个指南针源码指标

28个指南针源码指标

28个指南针源码指标1、BB BAND布林线宽n=30Var1:=MA(CLOSE,N);Var2:=Var1+2*STD(CLOSE,N);变盘: 5, POINTDOT;布林宽度: (Var2-Var1)/Var1*100;警戒: 30, POINTDOT;2、CBW成本带宽n1=97.5,n2=2.5CBW: 100*(COST(N1)-COST(N2))/COST(N1);3、CBXQD成本均线强度n=4,n1=5,n2=13,n3=34Var1:=AMOUNT/(100*VOL);Var2:=MA(Var1,N1);Var3:=MA(Var1,N2);Var4:=MA(Var1,N3);Var5:=DMA(CLOSE,VOL/CAPITAL);CYR5: 100*(Var2-REF(Var2,N))/REF(Var2,N); CYR13: 100*(Var3-REF(Var3,N))/REF(Var3,N); CYR34: 100*(Var4-REF(Var4,N))/REF(Var4,N); CYR无穷: 100*(Var5-REF(Var5,N))/REF(Var5,1);4、CKD相对价位Var1:=AMOUNT/(100*VOL);Var2:=MA(Var1,13);Var3:=DMA(Var1,VOL/CAPITAL);CKDP: 100*(Var2-COST(0))/(COST(100)-COST(0)); CKDW: 100*(Var3-COST(0))/(COST(100)-COST(0));5、CMACDCMACD指标n1=5,n2=13Var1:=AMOUNT/(100*VOL);Var2:=MA(Var1,N1);Var3:=MA(Var1,N2);CMACD: 100*(Var2-Var3)/Var3, COLORSTICK;6、CYB优化布林线n=20MB: MA(CLOSE,N);上轨: MB+STD(CLOSE,N);下轨: MB-STD(CLOSE,N);上极限: MB+2*STD(CLOSE,N);下极限: MB-2*STD(CLOSE,N);STICKLINE(open>=close ,close ,open,9,0 ),COLORaaaaaa; STICKLINE(open>=close ,close ,open,6,0 ),COLORbbbbbb; STICKLINE(open>=close ,close ,open,2.4,0 ),COLORcccccc; STICKLINE(open>=close ,close ,open,1.1,0 ),COLORdddddd;STICKLINE(close>open,close,open,9,0 ),COLOr6666cc; STICKLINE(close>open,close,open,6 ,0 ),COLOR7777dd;STICKLINE(close>open,close,open,2.4 ,0 ),COLOR8888ee; STICKLINE(close>open,close,open,1.1 ,0 ),COLOR9999ff;STICKLINE(close>open,open,low,0.5,0 ),COLOR1199ff; STICKLINE(close>open,close,HIGH,0.5 ,0 ),COLOR1199ff; STICKLINE(open>=close,close,low,0.5 ,0 ),COLORcccccc; STICKLINE(open>=close,open,HIGH,0.5 ,0 ),COLORcccccc; ----------------------------------------------------------7、CYC成本均线n1=5,n2=13,n3=34Var1:=AMOUNT/(100*VOL);短线成本均线: MA(Var1,N1);中线成本均线: MA(Var1,N2);长线成本均线: MA(Var1,N3);无穷成本均线: DMA(CLOSE,VOL/CAPITAL);STICKLINE(open>=close ,close ,open,9,0 ),COLORaaaaaa; STICKLINE(open>=close ,close ,open,6,0 ),COLORbbbbbb; STICKLINE(open>=close ,close ,open,2.4,0 ),COLORcccccc; STICKLINE(open>=close ,close ,open,1.1,0 ),COLORdddddd;STICKLINE(close>open,close,open,9,0 ),COLOr6666cc; STICKLINE(close>open,close,open,6 ,0 ),COLOR7777dd; STICKLINE(close>open,close,open,2.4 ,0 ),COLOR8888ee; STICKLINE(close>open,close,open,1.1 ,0 ),COLOR9999ff;STICKLINE(close>open,open,low,0.5,0 ),COLOR1199ff; STICKLINE(close>open,close,HIGH,0.5 ,0 ),COLOR1199ff; STICKLINE(open>=close,close,low,0.5 ,0 ),COLORcccccc; STICKLINE(open>=close,open,HIGH,0.5 ,0 ),COLORcccccc;---------------------------------------------------------------- 8、CYC2成本均线p1=5,p2=13,p3=34CYC1:0.01*EMA(AMOUNT,P1)/EMA(VOL,P1);CYC2:0.01*EMA(AMOUNT,P2)/EMA(VOL,P2);CYC3:0.01*EMA(AMOUNT,P3)/EMA(VOL,P3);CYC∞:DMA(AMOUNT/(100*VOL),VOL/(100*FINANCE(7))); ----------------------------------------------------------------- 9、CYD承接因子n=21CYDS:WINNER(CLOSE)/(VOL/CAPITAL);CYDN:WINNER(CLOSE)/MA(VOL/CAPITAL,N);----------------------------------------------------------------- 10、CYD2承接因子A:=WINNER(CLOSE )*CAPITAL;承接因子:A/VOL;333、CYDD指南针动态承接因子Var1:=WINNER(CLOSE);Var2:=DMA(Var1,VOL/CAPITAL);Var3:=DMA(VOL,VOL/CAPITAL)/CAPITAL;CYDD: Var1/Var3;CYDD1: Var2/Var3;1, POINTDOT;----------------------------------------------------------------- 11、CYE市场趋势MAL:=MA(CLOSE,5);MAS:=MA(MA(CLOSE,20),5);CYEL:(MAL-REF(MAL,1))/REF(MAL,1)*100;CYES:(MAS-REF(MAS,1))/REF(MAS,1)*100;-------------------------------------------------------------------12、CYF市场能量n=21HSL:=VOL/CAPITAL*100;CYF:100-100/(1+EMA(HSL,N)*100);---------------------------------------------------------------------13、CYOBV优化累积能量线n=34NOBV1:SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),0-VOL,0)),N)/CAPITAL;--------------------------------------------------------------------------------14、CYQKL博弈K线长度100*(WINNER(CLOSE)-WINNER(OPEN)), COLORSTICK;-------------------------------------------------------------------------------15、CYR市场强弱n=13,m=5DIVE:=0.01*EMA(AMOUNT,N)/EMA(VOL,N);CYR:(DIVE/REF(DIVE,1)-1)*100;MACYR:MA(CYR,M);-------------------------------------------------------------------------------16、CYS市场盈亏指标n1=5,n2=13,n3=34Var1:=AMOUNT/(100*VOL);Var2:=MA(Var1,N1);Var3:=MA(Var1,N2);Var4:=MA(Var1,N3);Var5:=DMA(CLOSE,VOL/CAPITAL);CYS5: 100*(CLOSE-Var2)/Var2;CYS13: 100*(CLOSE-Var3)/Var3;CYS34: 100*(CLOSE-Var4)/Var4;CYS无穷: 100*(CLOSE-Var5)/Var5;----------------------------------------------------------------------------17、CYS2市场盈亏CYC13:=0.01*EMA(AMOUNT,13)/EMA(VOL,13);CYS:(CLOSE-CYC13)/CYC13*100;----------------------------------------------------------------------------18、CYS-YJJ市场盈亏p1=4,p2=5VAR2:=VOL*CLOSE;VAR3:=EMA(VAR2,13)/EMA(VOL,13);CYS: (EMA(CLOSE,P1)-VAR3)/VAR3*100;ML: EMA(CYS,P2);LO: 0, POINTDOT;----------------------------------------------------------------------------19、CYW主力控盘VAR1:=CLOSE-LOW;VAR2:=HIGH-LOW;VAR3:=CLOSE-HIGH;VAR4:=IF(CLOSE>=0,(VAR1/VAR2+VAR3/VAR2)*VOL,(VAR3/ VAR2+VAR1/VAR2)*VOL);CYW: SUM(VAR4,10)/10000, COLORSTICK;------------------------------------------------------------------------------20、CYW-YJJ主力控盘p1=16,p2=8,p3=45VAR1:=1;VAR2:=CLOSE-REF(CLOSE,1);VAR3:=IF(CLOSE-REF(CLOSE,1)>=0,VAR2,0);VAR4:=REF(CLOSE,1)-CLOSE;VAR5:=IF(CLOSE-REF(CLOSE,1)<=0,VAR4,0);VAR6:=SUM(VAR3,P1)/SUM(VAR5,P1);VAR7:=100-100/(1+VAR6);VAR8:=EMA(VAR7,P1);VAR9:=EMA(VAR8,P2);VARA:=EMA(VAR8,P3);MO: (VAR8-VARA)*VAR1;ML: (VAR9-VARA)*VAR1;MODE: MO*VAR1, COLORSTICK;---------------------------------------------------------------------------------21、DKBL成本多空布林线n=10,p=3Var1:=AMOUNT/(100*VOL);Var2:=MA(Var1,3);Var3:=MA(Var1,6);Var4:=MA(Var1,12);Var5:=MA(Var1,24);BBI: (Var2+Var3+Var4+Var5)/4;UPR: BBI+P*STD(BBI,N);DWN: BBI-P*STD(BBI,N);STICKLINE(open>=close ,close ,open,9,0 ),COLORaaaaaa;STICKLINE(open>=close ,close ,open,6,0 ),COLORbbbbbb;STICKLINE(open>=close ,close ,open,2.4,0 ),COLORcccccc;STICKLINE(open>=close ,close ,open,1.1,0 ),COLORdddddd;STICKLINE(close>open,close,open,9,0 ),COLOr6666cc;STICKLINE(close>open,close,open,6 ,0 ),COLOR7777dd;STICKLINE(close>open,close,open,2.4 ,0 ),COLOR8888ee;STICKLINE(close>open,close,open,1.1 ,0 ),COLOR9999ff;STICKLINE(close>open,open,low,0.5,0 ),COLOR1199ff;STICKLINE(close>open,close,HIGH,0.5 ,0 ),COLOR1199ff;STICKLINE(open>=close,close,low,0.5 ,0 ),COLORcccccc;STICKLINE(open>=close,open,HIGH,0.5 ,0 ),COLORcccccc;-------------------------------------------------------------------22、JBCYSCYS越低的股涨得越好。

技术分析指标源码

技术分析指标源码

技术分析指标源码以下是一些常见的技术分析指标及其源代码,供参考:1. 移动平均线(Moving Average)移动平均线是计算一段时间内平均价格的指标,常用于平滑价格走势。

以下是计算简单移动平均线(SMA)的Python源代码:```pythondef sma(data, window):sma_list = []for i in range(len(data) - window + 1):sma_list.append(sum(data[i:i+window]) / window)return sma_list```2. 相对强弱指标(Relative Strength Index, RSI):相对强弱指标是一个用于测量市场超买超卖的指标。

以下是计算RSI的Python源代码:```pythondef rsi(data, window):up_list = []down_list = []for i in range(1, len(data)):diff = data[i] - data[i-1]if diff > 0:up_list.append(diff)down_list.append(0)elif diff < 0:up_list.append(0)down_list.append(abs(diff))else:up_list.append(0)down_list.append(0)up_avg = sma(up_list, window)down_avg = sma(down_list, window)rsi_list = [100 - (100 / (1 + (up_avg[i] / down_avg[i]))) for i in range(len(up_avg))]return rsi_list```3. 布林带(Bollinger Bands):布林带是一种通过计算标准差来确定价格波动范围的指标。

通达信自用经典指标源码【附图】

通达信自用经典指标源码【附图】

发几个通达信自用经典指标源码【附图】首先声明:指标不是万能的,只能作为参考使用。

中线买卖主图此主题相关图片如下:中线买卖主图EMA13:EMA(C,13),COLORWHITE;EMA21:EMA(C,21),COLORYELLOW;EMA34:EMA(C,34),COLORFF00FF;EMA60:MA(C,60),COLORFFCC66;X1:=(C+L+H)/3;X2:=EMA(X1,6);X3:=EMA(X2,5);STICKLINE(X2>X3 AND C>EMA13,LOW,HIGH,0.1,1),COLORRED; STICKLINE(X2>X3 AND C>EMA13,CLOSE,OPEN,3,1),COLORRED; STICKLINE(X2<X3 AND C<EMA13,LOW,HIGH,0.1,1),COLORFFFF52; STICKLINE(X2<X3 AND C<EMA13,CLOSE,OPEN,3,0),COLORFFFF52;GR1:=BARSLAST(BETWEEN("BIAS.BIAS2"(6,13,24),0,5));GR2:=EMA13>EMA21 AND EMA21>EMA34 AND EMA13>REF(EMA13,1); GR3:=COUNT("BIAS.BIAS2"(6,13,24)>10 AND H=HHV(H,GR1),GR1); GR4:=H=HHV(H,GR1);GR5:="MACD.MACD"(9,17,8)<REF("MACD.MACD"(9,17,8),1);GR6:=GR2 AND GR3 AND GR4;GR7:=GR2 AND GR3 AND GR4 AND GR5;GR8:=GR6 AND GR7;LC := REF(CLOSE,1);RSI6:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100; BIAS5:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;换手:=100*V/CAPITAL;BB13:=ATAN(EMA13-REF(EMA13,1))*3.1416*10;EMA8:=EMA(C,8);AA1:=AMOUNT/VOL;BB1:=L<AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;DD1:=L<MA(C,6)*0.921;EE1:=VOL<MA(V,5)*1.5;FF1:=BB1 AND CC1 AND DD1 AND EE1;DRAWTEXT(FF1,L*0.99,'买点'),COLORRED;STICKLINE(FF1,H,L,0.3,0),COLORRED;STICKLINE(FF1,O,C,3,1),LINETHICK2,COLORYELLOW;A2:=(C-REF(C,1))/REF(C,1)*100<1.02;A3:=H>MA(C,5)*1.12;AA:= A2 AND A3;DRAWTEXT(AA,H*1.05,'卖点'),COLOR00FF00;STICKLINE(AA,H,L,3,0),COLOR00FF00;中线买卖副图此主题相关图片如下:中线买卖副图VAR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),25); VAR2:=HIGH-REF(HIGH,1);VAR3:=REF(LOW,1)-LOW;VAR4:=SUM(IF(VAR2>0 AND VAR2>VAR3,VAR2,0),25);VAR5:=SUM(IF(VAR3>0 AND VAR3>VAR2,VAR3,0),25);VAR6:=VAR4*100/VAR1;VAR7:=VAR5*100/VAR1;VAR8:=MA(ABS(VAR7-VAR6)/(VAR7+VAR6)*100,15);VAR9:=(VAR8+REF(VAR8,15))/2;A:=(VAR7>VAR6 AND VAR7>25 AND VAR6<25);B:ZIG(3,50/5)*100,COLORWHITE;G:MA(B,2),COLORYELLOW;D:=CROSS(B,G)*1000,COLORRED;W:=CROSS(G,B)*1000,COLORBLUE;E:=REF(INDEXC,1);F:=SMA(MAX(INDEXC-E,0),3,1)/SMA(ABS(INDEXC-E),3,1);VAR10:=F AND F<8;VAR11:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;VAR12:=SMA(VAR11,3,1);VAR13:=SMA(VAR12,3,1);VAR14:=VAR13 AND VAR13<20;MM:=A AND D AND VAR10 AND VAR14 ;DRAWTEXT(W=1000,B*1.05,'卖' ),COLOR00FF00;DRAWTEXT(D=1000,B*1.05,'买'),COLORRED;短中买卖主图此主题相关图片如下:短中买卖主图EMA13:EMA(C,13),COLORWHITE;EMA21:EMA(C,21),COLORYELLOW;EMA34:EMA(C,34),COLORFF00FF;EMA60:MA(C,60),COLORFFCC66;DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5), 2)<=REF(ZIG(3,5),3)),LOW*0.98,9) ;DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5), 2)>=REF(ZIG(3,5),3)),HIGH*1.01,4);VAR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;VAR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;VAR6:=(VAR3+VAR4+VAR5)/3;VAR7:=EMA(VAR6,5);ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;VAR8:=IF(VAR6<=-20,10,0);VAR9:=HHV(VAR8,10);VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);K:=EMA(VAR7,5)*2, , COLORFF00FF;D:=EMA(K,5), , COLORWHITE;J:=K*3-D*2, ,COLORYELLOW;VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;HS:=VOL/CAPITAL*100, , COLORGREEN;DRAWTEXT(VAR8=10 AND FILTER(VAR8=10,5),LOW*1.00,'准备') COLORMAGENTA;DRAWTEXT(VARA=20,LOW*1.00,'一定要买') COLORRED;DRAWICON(VARA=20,LOW*1.00,1);VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LL V(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((OPEN-LLV (LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);VAR11:=VARF<REF(VAR10,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1);DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'庄家异动'),LINETHICK1,COLORFF00FF;VAR12:=(HIGH+LOW+CLOSE)/3;VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));VAR15:=IF(VAR13>=150 AND VAR13<200 AND VAR14>=150 AND VAR14<200,10,0);VAR16:=IF(VAR13<=-150 AND VAR13>-200 AND VAR14<=-150 AND VAR14>-200,-10,VAR15);VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;VAR18:=100-ABS(VAR17);VAR19:=IF(VAR18<90,VAR18,100);VAR1A:=IF(VARE>0,VARE,0);VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,LOW*1.00,'大动作') COLORYELLOW;VAR20:=PEAKBARS(3,15,1)<10;VAR21:=IF(VAR20=1,2,0);VAR22:=IF(VAR21=2,2,0);VAR23:=IF(VAR22>REF(VAR22,1),35,0)LINETHICK2;DRAWTEXT(VAR23=35,HIGH*1.00,'一定要逃')COLORGREEN;DRAWICON(VAR23=35,HIGH*1.00,2);底红顶绿副图此主题相关图片如下:底红顶绿副图LC:=REF(CLOSE,1);RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);TR:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10); HD:=(HIGH - REF(HIGH,1));LD:=(REF(LOW,1) - LOW);DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);PDI:=((DMP * 100) / TR);MDI:=((DMM * 100) / TR);ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);AV:=(RSI5 + ADX);DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);0,COLORFF00FF;WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));NEWVOL:=(RSI5 - WR10);阶段底部:=(AV + NEWVOL);STICKLINE((阶段底部 >= 0),0,阶段底部,0.3,1),LINETHICK2,COLORCC6600;STICKLINE((阶段底部 < 0),0,阶段底部,0.8,1),LINETHICK6,COLORRED;趋势线:LLV(阶段底部,1),COLORFFFFFF;STICKLINE((趋势线 >230 ),250,趋势线,0.8,1),LINETHICK6,COLORGREEN;230,COLORFFFFFF;动力线副图量:=V;换手:=V/CAPITAL*100;VAR1:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));买盘:=IF(CLOSE>OPEN,VAR1*(HIGH-LOW),IF(CLOSE<OPEN,VAR1*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)); 卖盘:=IF(CLOSE>OPEN,0-VAR1*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-VAR1*(HIGH-LOW),0-VOL/ 2));DLX:(买盘-(-卖盘))/量*换手,VOLSTICK;DLX1:SUM(DLX,6),COLORRED;DLX2:MA(DLX1,5);DLX3:MA(DLX1,10);A1:=SUMBARS(VOL,CAPITAL);CMA:=IF(CAPITAL>0,SUM(AMOUNT,A1)/SUM(VOL,A1)/100000,EMA(CLOSE,120000)); 百分之百换手价:CMA,LINETHICK0,COLORFFC0FF;{100%换手平均成本价};此主题相关图片如下:3D立体K线主图及成交量副图此主题相关图片如下:3D主图MA5:MA(C,5);MA10:MA(C,10);MA20:MA(C,20);MA60:MA(C,60);MA120:MA(C,120);MA250:MA(C,250);STICKLINE(C>O,C,O,3 ,0 ),COLORRED; STICKLINE(C>O,C,O,2 ,0 ),COLOR1040FF; STICKLINE(C>O,C,O,1 ,0 ),COLOR1083FF; STICKLINE(C>O,H,L,0.0001 ,0 ),COLOR10ABFF;STICKLINE(C<=O,C,O,3,0 ),COLORFF147C; STICKLINE(C<=O,C,O,2,0 ),COLORFF547C; STICKLINE(C<=O,C,O,1,0 ),COLORFF887C; STICKLINE(C<=O,H,L,0.0001,0 ),COLORFFD220;3D成交量副图MA5:MA(VOL,5),LINETHICK2;MA10:MA(VOL,10),LINETHICK2;量:VOL,LINETHICK0;STICKLINE(CLOSE>=OPEN,VOL,0,3,0),COLORRED; STICKLINE(CLOSE>=OPEN,VOL,0,2,0),COLOR1040FF; STICKLINE(CLOSE>=OPEN,VOL,0,1,0),COLOR1083FF; STICKLINE(CLOSE>=OPEN,VOL,0,0,0),COLOR10ABFF;STICKLINE(CLOSE<OPEN,VOL,0,3,0),COLORFF147C; STICKLINE(CLOSE<OPEN,VOL,0,2,0),COLORFF547C; STICKLINE(CLOSE<OPEN,VOL,0,1,0),COLORFF887C; STICKLINE(CLOSE<OPEN,VOL,0,0,0),COLORFFAC10;飞天格格主图此主题相关图片如下:飞天格格VAR1:=MA(CLOSE,30);海底: VAR1-2*STD(CLOSE,60),COLORCYAN,LINETHICK2; 水平面: MA(CLOSE,60),POINTDOT;天际: VAR1+2*STD(CLOSE,60);FLY1: MA(CLOSE,5);FLY2: MA(CLOSE,10);VAR2:=CROSS(MA(CLOSE,5),MA(CLOSE,30));DRAWICON(VAR2,LOW-LOW*0.01,1);DRAWTEXT(VAR2 AND CLOSE>MA(CLOSE,250),LOW-LOW*0.02,'←少量买 '),COLORYELLOW;DRAWTEXT(VAR2 AND CLOSE>=MA(CLOSE,60) AND CLOSE<=MA(CLOSE,250),LOW-LOW*0.02,'←半仓买'),COLO RYELLOW;DRAWTEXT(VAR2 AND CLOSE<MA(CLOSE,60),LOW-LOW*0.02,'←全仓买 '),COLORYELLOW;在macd的指标公式中加入这一行字将会更强大:partline(diff,diff>=ref(diff,1),rgb(255,0,0),diff<ref(diff,1),rgb(0,255,0)),linethick2;通达信四星级主图-凯恩斯的公式“线上阴线买,线下阳线卖A1:=DATE <= 13181231;七天线:MA(C,7),COLORGRAY;工作线:(EMA(C,14)) * A1,POINTDOT,LINETHICK4,COLORYELLOW;生命线:(MA(C,25)) * A1,LINETHICK2,COLORMAGENTA;不惑线:(MA(C,40)) * A1,COLORCYAN;姊妹线:(EMA(C,56)) * A1,,POINTDOT,COLORWHITE;A3:=EMA((((SLOPE(C,21)) * 20) + C),68);A4:=EMA(C,10);A5:=REF(C,2);A6:=((SMA((MAX((C - A5),0)),6,1)) / (SMA(ABS((C - A5)),6,1))) * 100; A7:=IF(((A6 < (REF(A6,1))) AND (A6 > 79)),A6,0);A8:=LLV(L,21);A9:=HHV(H,21);A10:=EMA((((CLOSE - A8) / (A9 - A8)) * 100),5);A11:=EMA((((CLOSE - A8) / (A9 - A8)) * 50),13);A12:=EMA(((0.667 * (REF(A10,1))) + (0.333 * A10)),2);A13:=LLV(L,55);A14:=HHV(H,34);A15:=EMA((((C - A13) / (A14 - A13)) * 100),3);A16:=(A11 + A15) / 2;A17:=EMA(((0.667 * (REF(A15,1))) + (0.333 * A10)),2);A18:=EMA(A16,5);A19:=EMA(((0.667 * (REF(A18,1))) + (0.333 * A18)),2);A20:=CROSS(A10,A11);A21:=(CROSS(A10,A19)) AND (A19 < 30);A22:=A21 * 0.6;A23:=((C + L) + H) / 3;A24:=EMA(A23,6);A25:=EMA(A24,5);A26:=CROSS(A24,A25);DRAWICON(A26,(LOW / 1.015),1),LINETHICK2,COLORMAGENTA;DRAWTEXT(CROSS(A4,A3),L*0.9,'线上阴线买|买错也要买!线下阳线卖|卖错也要卖!'),LINETHICK4,COLORYELLOW;STICKLINE(((C >= 工作线) AND (C >= O)),H,L,0,1),COLORRED;STICKLINE(((C >= 工作线) AND (C >= O)),O,C,2,1),COLORRED;STICKLINE(((C >= 工作线) AND (C <= O)),H,L,0,0),COLORRED;STICKLINE(((C >= 工作线) AND (C <= O)),O,C,2,0),COLORRED;STICKLINE(((C < 工作线) AND (C >= O)),H,L,0,1),COLORGREEN; STICKLINE(((C < 工作线) AND (C >= O)),O,C,2,1),COLORGREEN; STICKLINE(((C < 工作线) AND (C <= O)),H,L,0,0),COLORGREEN; STICKLINE(((C < 工作线) AND (C <= O)),O,C,2,0),COLORGREEN;公式一(安全逃顶---副图)本公式最大的优点就是逃顶100%,不毕等第二天的信号出现,你就可以判断出来,而且,在买入加仓的信号也精确显示,对打击主力踪迹,可以说是庄影难遁!巨量有下部(负交易量)说名主力,一边拉升,一边出逃,黄色成交量,且中间为红色蜡烛芯的,说明主力控盘,出现兰色或粉红色的蜡烛色!情况就不妙!根据股票的趋势线做分析是否出逃!操作口诀:选好股,挑好庄;等大势,看起航。

各种指标源码范文

各种指标源码范文

各种指标源码范文以下是一些常见的指标源码,用于计算不同方面的数据指标。

1. 平均值(Mean):```pythondef mean(data):sum = 0count = 0for d in data:sum += dcount += 1return sum / count```2. 中位数(Median):```pythondef median(data):sorted_data = sorted(data)n = len(sorted_data)if n % 2 == 0:return (sorted_data[n//2 - 1] + sorted_data[n//2]) / 2else:return sorted_data[n//2]```3. 众数(Mode):```pythondef mode(data):from collections import Countercounter = Counter(data)max_count = max(counter.values()return [k for k, v in counter.items( if v == max_count] ```4. 方差(Variance):```pythondef variance(data):mean_val = mean(data)squared_diff_sum = sum([(d - mean_val)**2 for d in data]) return squared_diff_sum / len(data)```5. 标准差(Standard Deviation):```pythondef std_deviation(data):return variance(data) ** 0.5```6. 相关系数(Correlation Coefficient):```pythondef correlation_coefficient(x, y):mean_x = mean(x)mean_y = mean(y)n = len(x)sum_xy = sum([xi*yi for xi, yi in zip(x, y)])sum_xx = sum([(xi - mean_x)**2 for xi in x])sum_yy = sum([(yi - mean_y)**2 for yi in y])return (sum_xy - (n * mean_x * mean_y)) / ((sum_xx * sum_yy) ** 0.5)```7. 百分位数(Percentile):```pythondef percentile(data, p):sorted_data = sorted(data)n = len(sorted_data)k=(n-1)*pf = math.floor(k)c = math.ceil(k)if f == c:return sorted_data[int(k)]else:return sorted_data[int(f)] * (c - k) + sorted_data[int(c)] * (k - f)```8. 四分位数(Quartiles):```pythondef quartiles(data):q1 = percentile(data, 0.25)q2 = percentile(data, 0.5)q3 = percentile(data, 0.75)return q1, q2, q3```以上是一些常见的指标计算方法的源代码。

指标公式源码大全

指标公式源码大全

指标公式源码大全引言概述:指标公式源码是金融领域中的重要工具,它们用于计算和预测市场的趋势和走势。

本文将为您介绍一些常用的指标公式源码,帮助您更好地理解和应用这些指标。

正文内容:1. 移动平均指标:1.1 简单移动平均(SMA):介绍SMA的计算公式和源码实现。

1.2 加权移动平均(WMA):详细解释WMA的计算方法和源码实现。

1.3 指数移动平均(EMA):介绍EMA的计算公式和源码实现。

2. 相对强弱指标(RSI):2.1 RSI的计算方法:解释RSI的计算公式和源码实现。

2.2 RSI的应用场景:阐述RSI在金融市场中的应用和意义。

2.3 RSI的优缺点:分析RSI指标的优点和局限性。

3. 布林带指标:3.1 布林带的计算公式:详细描述布林带的计算方法和源码实现。

3.2 布林带的解读:解释布林带指标的含义和使用技巧。

3.3 布林带的应用案例:通过实例展示布林带指标在实际交易中的应用。

4. 随机指标(KDJ):4.1 KDJ的计算方法:详细解释KDJ指标的计算公式和源码实现。

4.2 KDJ的应用场景:介绍KDJ指标在技术分析中的应用和意义。

4.3 KDJ的优点和缺点:分析KDJ指标的优势和不足之处。

5. 平均真实范围指标(ATR):5.1 ATR的计算方法:详细介绍ATR指标的计算公式和源码实现。

5.2 ATR的应用案例:通过实例演示ATR指标在市场分析中的应用。

5.3 ATR的局限性:分析ATR指标的限制和不足之处。

总结:总结部分将从以下三个方面对指标公式源码进行总结:1. 指标公式源码的重要性和作用:强调指标公式源码在金融分析和交易中的重要性。

2. 不同指标的特点和适用领域:概述各个指标的特点和适用范围,帮助读者选择合适的指标。

3. 指标公式源码的局限性和注意事项:提醒读者在使用指标公式源码时要注意其局限性,并结合实际情况进行分析和判断。

通过本文的介绍,读者可以更好地理解和应用指标公式源码,提高金融分析和交易的准确性和效率。

20个极品通达信指标公式源码

20个极品通达信指标公式源码

公式1(未来函数)代码N1:=5;N2:=10;N3:=20;N4:=30;P:=2;M:=20;N:=250;M1:=55;W:=21;P3:=500;N9:=90; HR:=HHV(HIGH,M1);HRY:=LLV(LOW,M1);HRY11:=HR*HRY;HRY33:SQRT(HRY11),COLORGREEN,LINETHICK2;IF(C>HRY33 AND HRY33 >=REF(HRY33 ,1), HRY33 ,DRAWNULL),LINETHICK2,COLORRED; MA1:EMA(CLOSE,N1);MA2:EMA(CLOSE,N2);MA3:EMA(CLOSE,N3),COLOR00FFFF;MA4:EMA(CLOSE,N4),LINETHICK2;TJ1:=CROSS(MA1,MA2) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018OR CROSS(MA1,MA4) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018OR CROSS(MA2,MA3) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018OR CROSS(MA1,MA3) AND C>O AND C>REF(C,1) AND C/REF(C,1)>=1.018;TJ2:=(MAX(MA1,MAX(MA2,MA3))-MIN(MA1,MIN(MA2,MA3)))/MIN(MA1,MIN(MA2,MA3))*100<=P;XG:=TJ1 AND TJ2;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);DEA :=EMA(DIFF,9);MACD:=2*(DIFF-DEA);做多:=IF(K>D AND MACD>0 AND V>1,2,0),COLORRED;做空:=IF(K<D AND MACD<0 AND V>1,-2,0),COLOR00FF00;强洗:=IF(MACD>0 AND K<D AND V>1,1,0),COLOR0099FF;弱升:=IF(MACD<0 AND K>D AND V>1,-1,0),COLORFFFF00;STICKLINE(做多AND C>=O,C,O,3,1),COLORRED;STICKLINE(做多AND C<O,C,O,3,0),COLOR990099;STICKLINE(做多AND C<O,C,O,1,0),COLORCC00CC;STICKLINE(做多AND C<O,C,O,0.3,0),COLORFF00FF;STICKLINE(做多AND C>=O,C,O,3,1),COLOR0000FF;{STICKLINE(做多AND C>=O,C,O,1.5,0),COLOR0000DD;STICKLINE(做多AND C>=O,C,O,0.4,0),COLOR0000FF;}STICKLINE(做空AND C>=O,L,H,0.1,0),COLOR0000FF;STICKLINE(做空AND C>=O,C,O,3,1),COLOR00FF00;{STICKLINE(做空AND C<O,C,O,3,0),COLOR00FF00;STICKLINE(做空AND C<O,C,O,0.3,0),COLOR00FF00;STICKLINE(做空AND C<O,C,O,0.3,0),COLOR00FF00;}STICKLINE(强洗AND C>=O,L,H,0.1,0),COLOR0000FF;STICKLINE(强洗AND C>=O,C,O,3,1),COLORFFFFFF;STICKLINE(强洗AND C<O,C,O,3,0),COLOR999999;STICKLINE(强洗AND C<O,C,O,1,0),COLORCCCCCC;STICKLINE(强洗AND C<O,C,O,0.3,0),COLORFFFFFF;STICKLINE(弱升AND C>=O,C,O,3,1),COLOR00FFFF;STICKLINE(弱升AND C<O,C,O,3,0),COLOR009999;STICKLINE(弱升AND C<O,C,O,0.3,0),COLOR00FFFF;STICKLINE(FILTER(TJ1,3),C,O,4,0),COLOR0000FF;DRAWICON(FILTER(XG,3),L*0.985,23);GET:=ZIG(3,3),COLORYELLOW;PL5:=ZIG(3,5);EN1:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);EX1:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);PL10:=ZIG(3,10);EN2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)<=REF(ZIG(3,10),3);EX2:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)>=REF(ZIG(3,10),3);PL20:=ZIG(3,20);EN3:=ZIG(3,20)>REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)<=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)<=REF(ZIG(3,20),3);EX3:=ZIG(3,20)<REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)>=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)>=REF(ZIG(3,20),3);PL40:=ZIG(3,40);走强1:=BARSLAST(PL5<REF(PL5,1));走弱1:=BARSLAST(PL5>REF(PL5,1));走强2:=BARSLAST(PL10<REF(PL10,1));走弱2:=BARSLAST(PL10>REF(PL10,1));走强3:=BARSLAST(PL20<REF(PL20,1));走弱3:=BARSLAST(PL20>REF(PL20,1));ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);DRAWTEXT(EN1 AND DTJZ5=1,L*0.98,'(A)'),COLORFFFF00;DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'(B)'),COLORFF00FF;DRAWTEXT(EN2 AND ZTJZ5=1,L*0.98,'(C)'),COLOR0000FF;DRAWTEXT(EN2 AND DTJZ10=1,L*0.93,'Ⅰ'),COLORFF00FF;DRAWTEXT(EX2 AND DTJD10=2,H*1.05,'Ⅱ'),COLORFFFF00;DRAWTEXT(EN3 AND ZTJZ10=1,L*0.93,'Ⅲ'),COLOR0000FF;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.03,'①'),LINETHICK3,COLOR00FFFF; DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.95,'②'),LINETHICK3,COLOR00FFFF; DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2)AND EX2,H*1.03,'③'),LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.95,'④'),LINETHICK3,COLOR00FFFF;TJ11:=EN2 AND ZTJZ5=1;TJ22:=EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2;TJ33:=EN2 AND DTJZ10=1;TJ44:=EN3 AND ZTJZ10=1;TJ55:=EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2;XG22:=TJ11 OR TJ22 OR TJ33 OR TJ44 OR TJ55;MM:=C>HRY33 AND HRY33 >=REF(HRY33 ,1);QQ:=HRY33>=REF(HRY33 ,1);XG11:=CROSS(C,HRY33) AND QQ AND MM;BUY1:=LAST(CLOSE>MA(CLOSE,55),0,5);BUY2:=EXIST(CLOSE<MA(CLOSE,55),5);BUY:=CLOSE>MA(CLOSE,55)&&BUY1&&BUY2;W18:=FILTER(EXIST(XG11 OR BUY,1),5);STICKLINE(W18,C,(C+O)/2,4,0),COLORFF00FF;DRAWTEXT(W18,L*0.97,'牛'),COLOR00FFFF;X1:=REF(C,1)/HHV(H,20)<0.82;X2:=(MIN(C,O)-L)/(H-L)>0.67;X3:=(HIGH-MAX(CLOSE,OPEN))/(HIGH-LOW)<0.33;X4:=ABS(C-O)/C<0.01;DOWN:=O>C;X5:=COUNT(DOWN,7)>=5;XG8:=X1 AND X2 AND X3 AND X4 AND X5;DRAWTEXT(XG8,L*0.98,'螺'),COLOR00FFFF;AA:=REF(C,1)/REF(O,1)<0.96;BB:=C/O>1.03;CC:=C>REF(O,1);TJ81:=AA AND BB AND CC;X81:=REF(C,1)/HHV(H,20)<0.82;DN:=O>C;X82:=COUNT(DN,7)>=5;X83:=C=HHV(C,3);XG81:=TJ81 AND X81 AND X82;XG82:=X81 AND X82 AND X83;XG88:=XG81 OR XG82;DRAWTEXT(XG88,L*0.96,'反'),COLOR00FFFF;X01:=REF(C,1)/HHV(H,21)<0.77;{DOWN1:=O>C;X02:=COUNT(DOWN1,9)>=6;}X03:=ABS(C-O)/C<0.008;X04:=(H-L)/C>0.025;XG0:=X01 AND X03 AND X04;DRAWTEXT(XG0,L*0.97,'星'),COLOR00FFFF;S1:=REF(C,1)/LLV(L,W)>1.30;S2:=(H-MAX(C,O))/(H-L)>0.60;S3:=ABS(C-O)/C<0.03;S4:=(H-O)/C>0.05 AND C<O;SAL1:=S1 AND S2 AND S3;SAL2:=S1 AND ABS(C-O)/C>0.05 AND C<O;SAL3:=S1 AND ABS(C-O)/C<0.001;SAL4:=S1 AND S4;SAL5:=(H-MAX(C,O))/(H-L)>0.67 AND C<O AND S3;SAL:=SAL1 OR SAL2 OR SAL3 OR SAL4 OR SAL5;LC:=REF(CLOSE,1);RSI:=SMA(MAX(CLOSE-LC,0),4.1,1)/SMA(ABS(CLOSE-LC),4.1,1)*100;黄买:=FILTER((REF(CLOSE,2)<CLOSE AND RSI<25),7);黄卖:=FILTER((REF(CLOSE,2)>CLOSE AND RSI>80),7);红买:=FILTER(CROSS(RSI,11),7);红卖:=FILTER(CROSS(89,RSI),7);绿买:=FILTER(CROSS(RSI,20),7);绿卖:=FILTER(CROSS(80,RSI),7);SL1:=红卖AND 绿卖;SL2:=红卖AND 绿卖AND 黄卖;BU:=红买AND 绿买;SS1:=CROSS(MA(C,5),C);SS2:=(REF(C,1)-C)/REF(C,1)>0.04;SS3:=O<REF(C,1);JJ1:=SS1 AND SS2 AND SS3;SSL:=JJ1 AND S1;SAL8:=FILTER(SAL OR SSL,5);DRAWTEXT(SAL8 OR SL1 OR SL2,H*1.02,'卖'),COLOR00FF00; STICKLINE(SAL8 OR SL1 OR SL2,C,O,1,0),COLORFF0000; DRAWTEXT(SAL8 AND SL1 AND SL2,H*1.02,'必卖'),COLOR00FF00; MA20:=MA(CLOSE,20);AA10:=MA(CLOSE,8);中期大底:=LLV(LOW,30);支撑:=HHV(EMA(((((OPEN + LOW) + HIGH) + CLOSE) / 4),5),60);压力一:=HHV(LOW,20);中线:=MA(CLOSE,3);天:=(MA(LOW,15) * 0.985);人:=(MA(LOW,15) * 0.96);地:=(((HIGH + LOW) + CLOSE) / 3);B1:=HHV(地,(4 * 15));B6:=LLV(地,(4 * 15));B7:=(B1 - B6);B8:=(MA(((地- B6) / B7),2) * 80);短期底部:=(LLV(HIGH,30) * 0.93);MA80:=LLV(HIGH,30);压力二:=(SMA(HIGH,21,2) * 1.035);下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100); RSV8:=SMA(下档线,3,1);K8:=SMA(RSV8,3,1);D8:=((3 * RSV8) - (2 * K8));J12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);K24:=SMA(SMA(J12,3,1),3,1);D24:=((3 * SMA(J12,3,1)) - (2 * K24));压力位:=IF(CROSS(D24,D),HIGH,L);长期底部:=LLV(HIGH,30);X18:=EMA((((((3 * CLOSE) + HIGH) + LOW) + OPEN) / 6),10);逃遁:=(SMA(HIGH,21,2) * 1.05);TJ18:=FILTER(((((LLV(LOW,0) AND ((MA(CLOSE,37) - REF(MA(CLOSE,37),1)) > 0)) AND (LOW <= 短期底部)) AND (WINNER(CLOSE) < 0.05)) AND ((CLOSE / OPEN)> 0.13)),7);图公式2代码PJJ:=DMA((H + L + C * 2) / 4,0.9);JJ:=REF(EMA(PJJ,3),1);QJJ:=VOL / ((H - L) * 2 - ABS(C - O));XVL:=IF(C > O,QJJ * (H - L),IF(C < O,QJJ * (H - O + (C - L)),VOL / 2))+ IF(C > O,0 - QJJ * (H - C + (O - L)),IF(C < O,0 - QJJ * (H - L),0 - VOL / 2)); HSL:=XVL / 20 / 1.15;攻击流量:=HSL * 0.55 + REF(HSL,1) * 0.33 + REF(HSL,2) * 0.22;GJJ:=EMA(攻击流量,2);DIFF:=(EMA(GJJ,12)-EMA(GJJ,26)),COLORGREEN;DEA:=MA(DIFF,2),COLORYELLOW;VA2:=LLV(LOW,33);VA3:=HHV(HIGH,21);VA4:=EMA((CLOSE-VA2)/(VA3-VA2)*100,10)*-1+100;趋势:=100-EMA(0.191*REF(VA4,1)+0.809*VA4,1);趋势线:=100-EMA(0.191*REF(VA4,1)+0.809*VA4,1);STICKLINE(DIFF>DEA AND 趋势线>REF(趋势线,1),HHV(H,5)*1.05,LLV(L,5)*0.95,4,0),COLOR781836;DRAWKLINE(H,O,L,C);V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);V2:=(1-7/100)*(DMA(CLOSE,V1));V3:=(1+7/100)*(DMA(CLOSE,V1));V5:=MA((LOW+HIGH+CLOSE)/3,5);支撑:REFDATE(V2,DATE),POINTDOT,LINETHICK3,COLORCC66FF;阻力:REFDATE(V3,DATE),POINTDOT,LINETHICK3,COLORGREEN;VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2); VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2); VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;STICKLINE(VAR19,L,L*0.98,3,0),COLORYELLOW;VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;STICKLINE(VAR1A,H*1.01,H,3,0),COLOR00FF00{98FD};MA3:MA(C,3);MA5:MA(C,5),COLORWHITE;MA10:=MA(C,10),NODRAW;MA30:MA(C,34),NODRAW;五日乖离率:=(C-MA5)/MA5*100;BB5:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416;IF(BB5>30 AND MA5>REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORRED;BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;IF(BB5<0 AND MA5<REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORGREEN;DD5:=MA5<REF(MA5,1);IF(DD5,MA5,DRAWNULL),COLOR00FF00;X0:=(3*C+L+O+H)/6;多空线: (20*X0+19*REF(X0,1)+18*REF(X0,2)+17*REF(X0,3)+16*REF(X0,4)+15*REF(X0,5)+14*REF(X0,6)+13*REF(X0,7)+12*REF(X0,8)+11*REF(X0,9)+10*REF(X0,10)+9*REF(X0,11)+8*REF(X0,12)+7*REF(X0,13)+6*REF(X0,14)+5*REF(X0,15)+4*REF(X0,16)+3*REF(X0,17)+2*REF(X0,18)+REF(X0,20))/210,COLORFF00FF,LINETHICK1;{用法:黄托底买进,绿压顶买出。

通达信指标源码范文

通达信指标源码范文

通达信指标源码范文通达信是一种常用的股票行情软件,它提供了丰富的技术指标供投资者参考。

以下是通达信指标源码的一些例子:1.移动平均线(MA)指标源码:```//计算移动平均线double[] CalculateMA(double[] closePrice, int period)double[] ma = new double[closePrice.Length];for (int i = period - 1; i < closePrice.Length; i++)double sum = 0;for (int j = i; j > i - period; j--)sum += closePrice[j];}ma[i] = sum / period;}return ma;```2.相对强弱指标(RSI)源码:```//计算相对强弱指标double[] CalculateRSI(double[] closePrice, int period) double[] rsi = new double[closePrice.Length];for (int i = period; i < closePrice.Length; i++)double sumGain = 0;double sumLoss = 0;for (int j = i; j > i - period; j--)double diff = closePrice[j] - closePrice[j - 1];if (diff >= 0)sumGain += diff;}elsesumLoss -= diff;}}double averageGain = sumGain / period;double averageLoss = sumLoss / period;rsi[i] = 100 - (100 / (1 + (averageGain / averageLoss))); }return rsi;```3.随机指标(KDJ)源码:```//计算随机指标void CalculateKDJ(double[] closePrice, double[] highestHigh, double[] lowestLow, int period, out double[] k, out double[] d, out double[] j)k = new double[closePrice.Length];d = new double[closePrice.Length];j = new double[closePrice.Length];for (int i = period - 1; i < closePrice.Length; i++)double maxHigh = double.MinValue;double minLow = double.MaxValue;for (int j = i; j > i - period; j--)if (highestHigh[j] > maxHigh)maxHigh = highestHigh[j];}if (lowestLow[j] < minLow)minLow = lowestLow[j];}}double rsv = (closePrice[i] - minLow) / (maxHigh - minLow) * 100;if (i == period - 1)k[i] = rsv;d[i] = rsv;}elsek[i] = 2 / 3 * k[i - 1] + 1 / 3 * rsv;d[i]=2/3*d[i-1]+1/3*k[i];}j[i]=3*k[i]-2*d[i];}```这些源码只是示例,实际使用通达信指标源码需要根据具体需求进行适当修改和完善。

股票-指标源代码

股票-指标源代码

JMACDDIF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK,COLOR0000FF;VAR3:=HHV(HIGH,60);VAR4:=LLV(LOW,30);VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;VAR6:=(VAR3+VAR4+VAR5)/3;VAR7:=EMA(VAR6,5);K:=EMA(VAR7,5)*2, COLORFF00FF;D:=EMA(K,5), COLORWHITE;J:=K*3-D*2, COLORYELLOW;ENTERLONG:=CROSS(K,D);E*ITLONG:=CROSS(D,K);B:=(IF(TROUGHBARS(3,15,1)=1 AND HIGH>LOW+0.01,20,-1))/50,COLORYELLOW ,LINETHICK1; {B1:=(DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),L*0.98,1))*D*2/3;}Q:=(IF(PEAKBARS(3,15,1)=1,80,0))/200,COLORGREEN,LINETHICK1;{Q1:=(DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),H*1.01,2))*D*2/3;}NOTE*T强:IF(DIF>MA(DIF,2),DIF,DRAWNULL),COLORRED;VAB0:=531;VAB1:=1510000;VAB2:=VAB0 + VAB1;VAB3:=IF(DATE > VAB2,0,1);LC:=REF(CLOSE,1);SG:=EMA(HHV(HIGH,1),8);*1:=EMA(CLOSE,8);*30:=((*1 < REF(*1,1)) AND (CLOSE < *1));*31:=IF(((SG < REF(SG,1)) OR *30),1,0);操作线:=SMA(MA*(CLOSE-LC,0),2,1)/SMA(ABS(CLOSE-LC),2,1)*100,COLORRED,LINETHICK2;震仓线:=45,COLORMAGENTA;抄底线:=20,COLORGREEN;PP:=操作线<震仓线 AND REF(操作线,1)>震仓线 ;PP3:=操作线<抄底线 AND REF(操作线,1)>抄底线*VAB3;DRAWTE*T(CURRBARSCOUNT=129,0.5,'【.55188.】'),COLOR889999;抓牛:((((((COUNT((*31 = 1),4) = 3) AND (*31 = 0))AND O<C AND (((C-REF(C,1))/REF(C,1))>0.085))*89) >=89)OR((C-REF(C,1))/REF(C,1)>0.085 AND (REF(PP3,1) OR REF(PP,1))) AND VAB3=1)/2,STICK,COLORLIRED,LINETHICK4;DRAWTE*T(抓牛,抓牛*-1.11,'B'),COLORLIRED;超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超S:=-L2_AMO(0,3)/10000.0;大S:=-L2_AMO(1,3)/10000.0;中S:=-L2_AMO(2,3)/10000.0;小S:=-L2_AMO(3,3)/10000.0;资金净流入万:(超B+大B+中B+小B)+(超S+大S+中S+小S),NODRAW,COLORWHITE;买进:B,STICK,LINETHICK2,COLORYELLOW;卖出:Q,STICK,LINETHICK2,COLORGREEN;涨家数:INDE*ADV,COLOR0080FF,NODRAW;跌家数:INDE*DEC,COLORGREEN,NODRAW;TJ1:=(C+0.01-REF(C,1))/REF(C,1)*100;TJ2:=(C-0.01-REF(C,1))/REF(C,1)*100;TJ3:=(C-REF(C,1))/REF(C,1)*100;Q1:=IF(TJ1>10.05,1,0);Q2:=IF(TJ2<9.95 AND TJ3>=9.95,1,0);涨停板:IF(Q1 OR Q2,0.5,0),COLORFF00FF;TT:=240/FROMOPEN;比:=TT;促进指数MFL:=(HIGH-LOW)*1000000/(VOL*比),COLORRED;AY2:=EMA(CLOSE,12)-EMA(CLOSE,26);AZ2:=EMA(AY2,9);LT2:=(AY2-AZ2);L211:=IF(LT2,LLV(L,21),DRAWNULL),COLOR217158,CIRCLEDOT;ZGD:=HHV(H,80)*0.99;ZGD2:=CONST(ZGD);ZDD:=LLV(L211,80);ZDD2:=CONST(ZDD);YYA4:=MA(CLOSE,20);YYA5:=(CLOSE > MA(CLOSE,5));YYA6:=(MA(CLOSE,5) > MA(CLOSE,10));YYA7:=(CLOSE > MA(CLOSE,10));YYA8:=(MA(CLOSE,5) > MA(CLOSE,20));YYA9:=(CLOSE > MA(CLOSE,20));YYA10:=REF(YYA4,1);YYA11:=(YYA4 > YYA10);YYAV*:=(((((IF(YYA5,10,(0 - 10)) + IF(YYA6,10,(0 - 10))) + IF(YYA7,10,(0 - 10))) + IF(YYA8,10,(0 - 10))) + IF(YYA9,10,(0 - 10))) + IF(YYA11,10,(0 - 10)));DSL*:=(CLOSE / INDE*C);DSL*1:=MA(DSL*,5);DSL*2:=MA(DSL*,10);YYV1:=MA(VOL,5);YYV2:=MA(VOL,10);J1:=CONST(IF( YYAV* > 0,200,100));J2:=CONST(IF( YYAV* > 0,00,100));J3:=CONST(IF( YYAV* > 0,100,100));ZGD3:=ZGD2;ZDD3:=ZDD2;ZGD4:=ZGD2;情况1:=CONST(IF(((CROSS(YYAV*,1) AND (YYV1 >= YYV2)) AND (DSL* >= DSL*1)),1,0)),NODRAW;情况2:=CONST(IF(((CROSS(YYAV*,1) AND (YYV1 < YYV2)) AND (DSL* >= DSL*1)),1,0));情况3:=CONST(IF(((CROSS(YYAV*,1) AND (YYV1 > YYV2)) AND (DSL* < DSL*1)),1,0));情况4:=CONST(IF(((CROSS(YYAV*,1) AND (YYV1 <= YYV2)) AND (DSL* < DSL*1)),1,0));情况5:=CONST(IF(((CROSS(1,YYAV*) AND (YYV1 >= YYV2)) AND (DSL* >= DSL*1)),1,0)); 情况6:=CONST(IF(((CROSS(1,YYAV*) AND (YYV1 < YYV2)) AND (DSL* >= DSL*1)),1,0));情况7:=CONST(IF(((CROSS(1,YYAV*) AND (YYV1 >= YYV2)) AND (DSL* < DSL*1)),1,0));情况8:=CONST(IF(((CROSS(1,YYAV*) AND (YYV1 < YYV2)) AND (DSL* < DSL*1)),1,0));情况9:=CONST(IF(((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 >= YYV2)) AND (DSL* >= DSL*1)),1,0));情况10:=CONST(IF(((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 < YYV2)) AND (DSL* >= DSL*1)),1,0));情况11:=CONST(IF(((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 >= YYV2)) AND (DSL* < DSL*1)),1,0)),NODRAW;情况12:=CONST(IF(((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 < YYV2)) AND (DSL* < DSL*1)),1,0));情况13:=CONST(IF(((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 >= YYV2)) AND (DSL* >= DSL*1)),1,0));情况14:=CONST(IF(((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 < YYV2)) AND (DSL* >= DSL*1)),1,0));情况15:=CONST(IF(((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 >= YYV2)) AND (DSL* < DSL*1)),1,0));情况16:=CONST(IF(((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 < YYV2)) AND (DSL* < DSL*1)),1,0));大盘1:=CONST(IF((CROSS(YYAV*,1) AND (YYV1 >= YYV2)),1,0));大盘2:=CONST(IF((CROSS(YYAV*,1) AND (YYV1 < YYV2)),1,0));大盘3:=CONST(IF((CROSS(1,YYAV*) AND (YYV1 >= YYV2)),1,0));大盘4:=CONST(IF((CROSS(1,YYAV*) AND (YYV1 < YYV2)),1,0));大盘5:=CONST(IF((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 >= YYV2)),1,0)); 大盘6:=CONST(IF((((YYAV* >= 1) AND (REF(YYAV*,1) > 0)) AND (YYV1 < YYV2)),1,0)); 大盘7:=CONST(IF((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 >= YYV2)),1,0)); 大盘8:=CONST(IF((((YYAV* < 1) AND (REF(YYAV*,1) < 0)) AND (YYV1 < YYV2)),1,0)); MFI:=(HIGH-LOW)*1000000/(VOL*比);TS1:=IF(情况1=1,0.7+0.06,0.7);TS2:=IF(情况2=1,TS1+0.06,TS1);TS3:=IF(情况3=1,TS2+0.06,TS2);TS4:=IF(情况4=1,TS3+0.06,TS3);TS5:=IF(情况5=1,TS4+0.06,TS4);TS6:=IF(情况6=1,TS5+0.06,TS5);TS7:=IF(情况7=1,TS6+0.06,TS6);TS8:=IF(情况8=1,TS7+0.06,TS7);TS9:=IF(情况9=1,TS8+0.06,TS8);TS10:=IF(情况10=1,TS9+0.06,TS9);TS11:=IF(情况11=1,TS10+0.06,TS10);TS12:=IF(情况12=1,TS11+0.06,TS11);TS13:=IF(情况13=1,TS12+0.06,TS12);TS14:=IF(情况14=1,TS13+0.06,TS13);TS15:=IF(情况15=1,TS14+0.06,TS14);TS16:=IF(情况16=1,TS15+0.06,TS15);TS17:=IF(大盘1=1,TS16+0.06,TS16);TS18:=IF(大盘2=1,TS17+0.06,TS17);TS19:=IF(大盘3=1,TS18+0.06,TS18);TS20:=IF(大盘4=1,TS19+0.06,TS19);TS21:=IF(大盘5=1,TS20+0.06,TS20);TS22:=IF(大盘6=1,TS21+0.06,TS21);TS23:=IF(大盘7=1,TS22+0.06,TS22);TS24:=IF(大盘8=1,TS23+0.06,TS23);DRAWTE*T_FI*(情况1=1 ,0,0.00,0,'量能理想,明显走强,中线参与,仓位在2/3左右'),COLORCYAN;DRAWTE*T_FI*(情况2=1 ,0,0.00,0,'走势趋强量能缺乏,短线进场,仓位在1/2左右'),COLORCYAN;DRAWTE*T_FI*(情况3=1 ,0,0.00,0,'量价良好,并没有明显走强,短线进场,仓位1/2左右。

指标源代码

指标源代码

指标源代码分类:操作备忘寻找领头羊白色: SMA(HIGH,21,2)*1.05,COLORWHITE;黄色: SMA(LOW,21,2)*0.95,COLORYELLOW;粉色: SMA(LOW,5,1),COLORMAGENTA;绿色: SMA(CLOSE,2,1),COLORGREEN;波段买入:IF(CROSS(绿色,粉色),白色*1.05,粉色),COLORMAGENTA;领头羊:IF(CROSS(绿色,白色),白色*1.10,黄色),COLORYELLOW;绿线上穿紫线时,可作波段买入,绿线上穿白线时,很可能是大牛股。

资金流向VAR1:=SMA(AMOUNT,10,1)/1000000;VAR2:=REF(VAR1,1);VAR3:=MA(REF(CLOSE,1),5);最高:VAR1*HIGH/VAR3*1/10,POINTDOT,COLOR009900,COLORGRA Y;最低:VAR1*LOW/VAR3*1/10,POINTDOT,COLOR009900,COLORYELL OW;开盘:VAR1*OPEN/VAR3*1/10,POINTDOT,COLOR009900,COLORMA GENTA;收盘:VAR1*CLOSE/VAR3*1/10,COLOR009900,COLORGREEN,POINT DOT;生命线:EMA(收盘,12),COLORWHITE;昨收盘:=REF(收盘,1),POINTDOT,COLOR009900,LINETHICK0;涨跌:=(收盘-REF(收盘,1))/REF(收盘,1)*100,POINTDOT,COLOR009900,LINETHICK0;STICKLINE(收盘>开盘,收盘,开盘,3,0),COLORRED;STICKLINE(收盘>开盘,最高,MAX(收盘,开盘),0,1),COLORRED;STICKLINE(收盘>开盘,MIN(收盘,开盘),最低,0,1),COLORRED;STICKLINE(收盘<开盘,收盘,开盘,2,0),COLORGREEN;STICKLINE(收盘<开盘,最高,MAX(收盘,开盘),0,1),COLORGREEN;STICKLINE(收盘<开盘,MIN(收盘,开盘),最低,0,1),COLORGREEN;延宏黄金柱VOLUME:VOL,VOLSTICK; MAVOL1:MA(VOLUME,5); MAVOL3:MA(VOLUME,35); MAVOL2:MA(VOLUME,135); V2:IF(CURRBARSCOUNT=1,VOL*240/FROMOPEN/REF(VOL,1)-1,VOL/REF(VOL,1)-1),NODRAW,COLORRED;STICKLINE(V2>=1,0,VOL,2,0),COLORYELLOW;金蜘蛛CV:=CLOSE;BBIBOLL:=(MA(CV,3)+MA(CV,6)+MA(CV,12)+MA(CV,24))/4;UPR:=BBIBOLL+6*STD(BBIBOLL,11);DWN:=BBIBOLL-6*STD(BBIBOLL,11);QJJ:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));XVL:=(IF(CLOSE>OPEN,QJJ*(HIGH-LOW),IF(CLOSEOPEN,0-QJJ*(HIGH-CLOSE+OPEN-LOW),IF(CLOSEHSL:=(XVL/20)/1.15;攻击:=((HSL*0.55+(REF(HSL,1)*0.33))+(REF(HSL,2)*0.22));LLJX:=EMA(攻击,3);0,POINTDOT,COLORWHITE;B1:SUM(LLJX,1),COLORCYAN;B2:SUM(LLJX,2),COLORCYAN;B3:SUM(LLJX,3),COLORCYAN;B4:SUM(LLJX,4),COLORCYAN;B5:SUM(LLJX,5),COLORCYAN;B6:SUM(LLJX,6),COLORCYAN;B7:SUM(LLJX,7),COLORCYAN;B8:SUM(LLJX,8),COLORCYAN;B9:SUM(LLJX,9),COLORCYAN;B10:SUM(LLJX,10),COLORCYAN;A1:IF(B1>REF(B1,1),B1,DRAWNULL),COLORRED;A2:IF(B2>REF(B2,1),B2,DRAWNULL),COLORRED;A3:IF(B3>REF(B3,1),B3,DRAWNULL),COLORRED;A4:IF(B4>REF(B4,1),B4,DRAWNULL),COLORRED;A5:IF(B5>REF(B5,1),B5,DRAWNULL),COLORRED;A6:IF(B6>REF(B6,1),B6,DRAWNULL),COLORRED;A7:IF(B7>REF(B7,1),B7,DRAWNULL),COLORRED;A8:IF(B8>REF(B8,1),B8,DRAWNULL),COLORRED;A9:IF(B9>REF(B9,1),B9,DRAWNULL),COLORRED;A10:IF(B10>REF(B10,1),B10,DRAWNULL),COLORRED;延宏逃顶VAR2:=LLV(LOW,10);VAR3:=HHV(HIGH,25);阶段卖出: 3.2,COLORC6C600;3.5,COLOR0088FF;清仓卖出: 3.5,COLORFF75FF;动力线:= EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4);STICKLINE(动力线>REF(动力线,1) ,动力线,REF(动力线,1),3 ,1),COLORRED;STICKLINE(动力线<=REF(动力线,1) ,动力线,REF(动力线,1),3 ,1),COLOR00FF00;底部:0.2,COLOR70DB93;关注:0.5,COLORYELLOW;DRAWICON( FILTER(CROSS(动力线,关注),20),动力线+0.02 ,1);DRAWICON( FILTER(CROSS(清仓卖出,动力线),20),动力线+0.02,2);DRAWICON( FILTER(CROSS(动力线,底部),20),动力线+0.02 ,1);DRAWICON( FILTER(CROSS(阶段卖出,动力线),20),动力线+0.02,2);强弱分界线:1.75,POINTDOT,LINETHICK2,COLOR70DB93;数值:动力线,COLORA8A8A8;T+0指标MA30:=EMA(CLOSE,30);强弱:EMA(CLOSE,900);STICKLINE((MA30>强弱),MA30,强弱,1,0),COLOR0000FF;STICKLINE((MA30<强弱),MA30,强弱,1,0),COLOR00FF00;H1:=MAX(DYNAINFO(3),DYNAINFO(5));L1:=MIN(DYNAINFO(3),DYNAINFO(6));P1:=H1-L1;阻力:L1+P1*7/8,COLOR00DD00;支撑:L1+P1*0.5/8,COLOR00DD00;现价:CLOSE,COLORWHITE,LINETHICK1;STICKLINE(CROSS(支撑,现价),支撑,阻力,1,0),COLORYELLOW;DRAWTEXT(LONGCROSS(支撑,现价,2),支撑*1.001,'★B'),COLORYELLOW;{吸}DRAWTEXT(LONGCROSS(现价,阻力,2),现价,'★'),COLORRED;{抛};一根筋(主图)FL:MA(CLOSE,13)+ABS(MA(CLOSE,13)-REF(MA(CLOSE,13),1));FS:MA(CLOSE,13)+MA(CLOSE,13)-REF(MA(CLOSE,13),1);CG:IF(MA(CLOSE,13)K1:=BACKSET(CG>REF(CG,1),2);IF(K1,CG,DRAWNULL),COLOR00FFFF,LINETHICK2;C2:=REF(C,1);涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);STICKLINE(涨停,OPEN,CLOSE,2,0),COLORYELLOW;跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;STICKLINE(跌停,H,L,0,1),COLORGREEN;区间买卖(主图)N1:=7;LC:=REF(CLOSE,1);X:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,COLORYELLOW,LINETHICK1;魔鬼:=DRAWLINE(X>=HHV(X,N1),X,X<=LLV(X,N1),X,1),COLOR00FF00;魔王:=DRAWLINE(X>=HHV(X,N1),X,X<=LLV(X,N1),1,X),COLOR00F F00;TJ0:=X=魔王;TJ1:=X=魔鬼;TJ2:=XTJ3:=X>REF(1,X);JRS1:=DRAWICON(TJ1 AND TJ2,X,1);JRS2:=DRAWICON(TJ0 AND TJ3,X,2);DRAWICON(FILTER(JRS1>0,1),L*0.97,1);DRAWICON(FILTER(JRS2>0,1),H*1.02,15);布林宝塔VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);CLOSE<=REF(CLOSE,2);VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);STICKLINE(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARAOR VARB OR VARC,CLOSE,REF(CLOSE,1),1.5,0),COLORRED;VARD:=CLOSEVARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);CLOSE>=REF(CLOSE,2);VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);STICKLINE(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,CLOSE,REF(CLOSE,1),1.5,0),COLORFFFF00;VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLORF FFF00;VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),1.5,0),COLOR RED;N:=20;MID:=MA(C,N);VA1:=POW((C-MID),2);VA2:=MA(VA1,N);VA3:=SQRT(VA2);UPPER:=MID+1*VA3;LOWER:=MID-1*VA3;BOLL:REF(MID,1);UB:REF(UPPER,1);LB:REF(LOWER,1);游资逃顶VAR1:=(HIGH+LOW+CLOSE*2)/4;VAR2:=EMA(VAR1,21);VAR3:=STD(VAR1,21);VAR4:=((VAR1-VAR2)/VAR3*100+200)/4;VAR5:=(EMA(VAR4,89)-25)*1.56;VAR6:=EMA(VAR5,5)*1.22;VAR7:=EMA(VAR6,3);VAR8:=3*VAR6-2*VAR7;VAR1A:=IF(CROSS(VAR6,VAR8) AND CROSS(VAR7,VAR8) AND CROSS(VAR7,VAR6),1,0);VAR1B:=EMA(CLOSE,3)-EMA(CLOSE,89);VAR1C:=EMA(VAR1B,21);VAR1D:=(VAR1B-VAR1C)*10;VAR1F:=POW(VAR1D,3)*0.1+POW(VAR1D,2);拉升资金:IF(VAR1D>0.015,VAR1F,0)/45,COLORMAGENTA;VAR9:=EMA(CLOSE,2)-EMA(CLOSE,55);VAR10:=EMA(VAR9,13);VAR11:=2*(VAR9-VAR10);主力资金:POW(VAR11,3)*0.1+POW(VAR11,1),COLORRED;0,COLORYELLOW;MACD实战解盘公式(副图)DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));DEA:=EMA(DIFF,9);MACD2:=(2 * (DIFF - DEA));DU0:=CROSS(DIFF,0);UD0:=CROSS(0,DIFF);TDU0:=BARSLAST(DU0);TUD0:=BARSLAST(UD0);DU3:=REF(DU0,1);UD3:=REF(UD0,1);TDU3:=BARSLAST(DU3);TUD3:=BARSLAST(UD3);UDGLINE:=IF((TDU3 < TUD3),REF(HHV(HIGH,2),TDU3),REF(LLV(LOW,2),TUD3));JDU0:=(((REF(CLOSE,1) <= REF(UDGLINE,1)) AND (CLOSE > UDGLINE)) AND (TDU0 < TUD0));JUD0:=(((REF(CLOSE,1) >= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0));JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1));JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1));JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));JUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) > REF(BARSLAST(JDU1),1)));JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) < REF(BARSLAST(JDU1),1)));BSLINE:=IF((BARSLAST(JDU2) < BARSLAST(JUD2)),IF(REF(CROSS(0,MACD2),1),LLV(LOW,2),REF(LL V(LOW,2),BARSLAST(REF(CROSS(0,MACD2),1)))),IF(REF(CROSS(M ACD2,0),1),HHV(HIGH,2),REF(HHV(HIGH,2),BARSLAST(REF(CROS S(MACD2,0),1)))));DRAWICON((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))),0,10);STICKLINE((MACD2>=0),0,MACD2,3,1),COLOR0000FF;STICKLINE(((MACD2>=0) AND (MACD2 < REF(MACD2,1))),0,MACD2,3,0),COLORCYAN;STICKLINE((MACD2<0),0,MACD2,3,0),COLORFFFF00;STICKLINE(((MACD2<0) AND (MACD2 >REF(MACD2,1))),0,MACD2,3,1),COLORRED;DIF:DIFF,LINETHICK2,COLOR00FFFF;DEF:DEA,COLOR00FF00;MACD:MACD2,LINETHICK0,COLORFFFF00;DEFUT:=BARSLAST(CROSS(MACD2,0));DEFDT:=BARSLAST(CROSS(0,MACD2));DEFUL:=IF((MACD2 >= 0),HHV(MACD2,(DEFUT + 1)),REF(HHV(MACD2,(DEFUT + 1)),(DEFDT + 1)));DEFDL:=IF((MACD2 < 0),LLV(MACD2,(DEFDT + 1)),REF(LLV(MACD2,(DEFDT + 1)),(DEFUT + 1)));DEFU2L:=REF(DEFUL,(DEFUT + 1));DEFD2L:=REF(DEFDL,(DEFDT + 1));DRAWICON(((((LLV(MACD2,4) > 0) AND (MACD2 < REF(MACD2,1))) AND (REF(MACD2,1) > REF(MACD2,2))) AND (REF(MACD2,2) > REF(MACD2,3))),MACD2,5);DRAWICON(((((HHV(MACD2,4) < 0) AND (MACD2 > REF(MACD2,1))) AND (REF(MACD2,1) < REF(MACD2,2))) AND (REF(MACD2,2) < REF(MACD2,3))),MACD2,4);DRAWICON(((((JUD1 OR (BARSLAST(JDU1) > BARSLAST(JUD1))) AND (MACD2 >= 0)) AND (REF(MACD2,1) < REF(DEFU2L,1))) AND (MACD2 > DEFU2L)),MACD2,12);DRAWICON(((((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))) AND (MACD2 < 0)) AND (REF(MACD2,1) > REF(DEFD2L,1))) AND (MACD2 < DEFD2L)),MACD2,12);追涨、逃顶(主图)空:=EMA(C,5);均衡:EMA(空,5),COLORWHITE;中轨:HHV(MA(H,13),13),COLORRED,LINETHICK2;趋势:LLV(MA(H,13),1),COLORGREEN,LINETHICK2;VARA:=(CLOSE-REF(OPEN,29))/REF(OPEN,29)*100;VARB:=EMA(0.667*REF(VARA,1)+0.333*VARA,5);DRAWTEXT(IF(VOL>=1.3*MA(VOL,5) AND COUNT(VARA>=VARB AND VARA<-17,3) AND REF(LOW,1)=LLV(LOW,120),1,0),LOW,'买入');VARC:=SMA(MAX(CLOSE-REF(C,1),0),6,1)/SMA(ABS(CLOSE-REF(C,1)),6,1)*100;DRAWICON(CROSS(82,VARC),HIGH,2);VAR1:=(HIGH+LOW+OPEN+2*CLOSE)/5;VAR2:=REF(VAR1,1);VAR3:=SMA(MAX(VAR1-VAR2,0),10,1)/SMA(ABS(VAR1-VAR2),10,1)*100;VAR4:=FILTER(IF(COUNT(VAR3<20,5)>=1 AND COUNT(VAR1=LLV(VAR1,10),10)>=1 AND CLOSE>=OPEN*1.038 AND VOL>MA(VOL,5)*1.2,1,0),5);DRAWICON(VAR4,LOW,1);VAR5:=FILTER(均衡>REF(均衡,1)AND 中轨REF(C,1),11);DRAWTEXT(VAR5,L*0.98,'追涨');VAR6:=REF(CLOSE,1);VAR7:=SMA(MAX(CLOSE-VAR6,0),6,1)/SMA(ABS(CLOSE-VAR6),6,1)*100;DRAWTEXT(CROSS(84,VAR7),H*1.03,'逃顶'),COLORYELLOW ;寻找立桩量的窍门一个最简便的方法是开盘后观“81”“83”中的“今日总金额排名”一栏,寻找金额异动的个股。

波浪趋势指标源码

波浪趋势指标源码

波浪趋势指标源码可能包括以下部分:1. 初始化部分:这部分代码通常用于初始化一些变量,例如当前价格、最高价、最低价、时间等。

```pythoncurrent_price = 0.0high_price = 0.0low_price = 0.0time = 0```2. 计算部分:这部分代码通常使用公式来计算波浪趋势指标。

具体公式可能因不同的指标而异,但通常会涉及到当前价格、最高价、最低价、时间等变量。

```pythonwave_indicator = (current_price - low_price) / (high_price - low_price) * 100```3. 绘制图表部分:这部分代码通常用于将波浪趋势指标绘制成图表。

这可能涉及到调用绘图库(如matplotlib)来绘制图表。

```pythonimport matplotlib.pyplot as pltplt.plot(time, wave_indicator)plt.show()```将这些代码组合在一起,一个简单的波浪趋势指标源码可能如下:```python# 初始化部分current_price = 50 # 当前价格high_price = 80 # 最高价low_price = 30 # 最低价time = 0 # 时间# 计算部分wave_indicator = (current_price - low_price) / (high_price - low_price) * 100 # 波浪趋势指标值# 绘制图表部分import matplotlib.pyplot as pltplt.plot(time, wave_indicator)plt.title('波浪趋势指标')plt.show()```请注意,上述代码只是一个简单的示例,实际的波浪趋势指标源码可能更复杂,并且需要更多的变量和逻辑来适应不同的交易系统和市场环境。

热门指标源代码

热门指标源代码

热门指标源代码标题: 热门指标源代码:了解如何评估和使用这些常用指标简介:热门指标是在各行各业中用来评估和衡量特定指标的工具。

无论是在金融领域、市场营销、数据分析还是其他任何行业,理解和正确使用热门指标源代码是至关重要的。

本文将深入探讨几个常用的热门指标源代码,包括其背后的原理、适用领域以及使用建议,并分享我对每个指标的观点和理解。

正文:第一部分:热门指标源代码的概述在当前信息爆炸的时代,我们需要一些工具来帮助我们更好地理解和分析数据。

热门指标源代码正是这样的工具之一。

这些指标源代码可以提供有关特定指标的信息,帮助我们做出决策。

以下是几个常用的热门指标源代码:1. 均线指标(Moving Average Indicator)均线指标是一种基于历史数据计算移动平均值的指标。

它可以帮助我们更好地理解和分析股票价格或其他时间序列数据。

以简单移动平均线为例,它可以平滑价格波动并显示长期趋势。

这种指标源代码可以用于判断价格的上升或下降趋势,并据此作出相应的投资决策。

我的观点和理解:均线指标是技术分析中最常用的指标之一。

它可以提供对市场趋势的洞察力,并帮助投资者做出更明智的决策。

然而,它的效果可能会受到市场波动和其他因素的影响,因此需要结合其他指标和分析方法来进行更全面的评估。

2. 相对强弱指标(Relative Strength Index)相对强弱指标是一种用于衡量和比较不同证券价格变动的指标。

它可以帮助我们判断某个证券的价格是否超买或超卖,并据此作出买入或卖出的决策。

相对强弱指标是根据价格变动的相对强度来计算的,通常以0到100之间的数字表示。

我的观点和理解:相对强弱指标是一种有用的技术分析工具,可以帮助投资者判断市场的超买和超卖情况。

然而,它并不能单独提供足够的信息来做出决策,需要结合其他指标和分析方法来进行综合评估。

第二部分:热门指标源代码的应用领域热门指标源代码可以应用于多个领域,以下是一些常见的应用领域:1. 金融领域在金融领域,热门指标源代码广泛应用于股票市场、外汇市场和其他金融市场。

编写指标的参考原码大放送

编写指标的参考原码大放送

编写指标的参考原码大放送飞狐精品代码收集贴求证券历史最高、最低价时的日期hhp:=HHVBARS(HIGH,0);llp:=LLVBARS(LOW,0);hhd:REF(DATE,hhp);lld:REF(DATE,llp);求历史最高、次高、最低、次低时价格fh:=HIGH;ph:=fh;fl:=LOW;pl:=fl;a:=SORTPOS(ph,1,1,DATACOUNT);a:=SORTPOS(pl,0,1,DATACOUNT);最高:fh[ph[1]];次高:fh[ph[2]];最低:fl[pl[1]];次低:fl[pl[2]];求证券上市日期fd:=date;上市日期:fd[1];求证券首日收盘价格REF(CLOSE,BARPOS-1);方法二:REF(CLOSE,BARSSINCE(CLOSE));副图显示指数foxc:="1A0001$close";foxo:="1A0001$open";foxl:="1A0001 $low";foxh:="1A0001$high";ktj:=(foxc>foxo or foxc=o and foxc>ref(foxc,1));stickline(ktj,foxh,foxl,0.1,1),colorred;stickline(ktj,foxc,foxo,7,1),colorred;stickline(not(ktj),foxh,foxl,0.1,0),colorcyan;stickline(not(ktj),foxc,foxo,7,0),colorcyan;方法二XO:=INDEXO;XH:=INDEXH;XL:=INDEXL;XC:=INDEXC;STICKLINE(XC>XO OR (XC=XO AND XC>REF(XO,1)),XC,XH,0.1,0),COLORMAGENTA;STICKLINE(XC>XO OR (XC=XO AND XC>REF(XO,1)),XO,XL,0.1,0),COLORMAGENTA;STICKLINE(XC>XO OR (XC=XO AND XC>REF(XO,1)),XO,XC,7,0),COLORMAGENTA;STICKLINE(XC<XO OR (XC=XO AND XC<=REF(XO,1)),XH,XL,0.1,0),COLORCYAN;STICKLINE(XC<XO OR (XC=XO AND XC<=REF(XO,1)),XO,XC,7,0),COLORCYAN;对应指数开:INDEXO LINETHICK0 PRECISION0 COLORYELLOW;高:INDEXH LINETHICK0 PRECISION0 COLORWHITE;低:INDEXL LINETHICK0 PRECISION0 COLORRED;收:INDEXC LINETHICK0 PRECISION0 COLORCYAN;序列变量值用在判断语句fc:=CLOSE;fo:=OPEN;for i=1 to DATACOUNT doIF fc>fo then A:fc+5;取光标位置K线日期REF(DATE,BARSLAST(SYSPARAM(1)=BARPOS));k线数的数值随光标移动显示DRAWTEXT(SYSPARAM(1)=BARPOS,1,'K线数='+NUMTOSTR(SYSPARAM(1),0));求某一年最低价格比如 2002 年方法一:n:=2002;fl:=IF(YEAR=2002,LOW,10000000);ll:LLV(fl,0);求某一年最高价格比如 2002 年A:=HHV(H*(YEAR=2002),0);YH:A[DATACOUNT];求每年最大成交量VARIABLE:maxv[20]=0,n=1;fy:=year;fv:=v;maxv[1]:=fv[1];for i=2 to DATACOUNT do beginif fy<>fy[i-1] then n:=n+1;maxv[n]:=max(maxv[n],fv);end;求 N年最低价input:n(1,1,100);tj1:=YEAR<>ref(year,1);ts1:=sumbars(tj1,N);ts:=BARSSINCE(ts1)+1;N年最低价:llv(l,ts);计算以成交量为权重的平均股价SUM(VOL*CLOSE,3)/SUM(VOL,3);成本集中度成本集中度:(COST(95)-COST(5))/(COST(95)+COST(5))*100;取历史某日数据假设取2003年9月30日收盘价格IF(DATE=1030930,CLOSE,0);统计 N 天内最高价和最低价之间的天数以及它们之间换手率之和INPUT:N(150);HH:=HHVBARS(HIGH,N); LL:=LLVBARS(LOW,N);HD:=MAX(HH,LL); LD:=MIN(HH,LL);周期:HD-LD,LINETHICK0;HSL:=VOL/CAPITAL*N;换手率之和:SUM(HSL,HD)-SUM(HSL,LD),LINETHICK0;计算 N 日内阳线的成交量之和与 N 日内阴线的成交量之和的比率INPUT:N(10);阳线量:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,0),n);阴线量:=SUM(IF(CLOSE<REF(CLOSE,1),VOL,0),n);阳线量/阴线量;文字跟随光标移动tj:=barpos=sysparam(1);drawtext(tj,c,stklabel+'n'+stkname);表达涨停板{如果为ST涨停为5%,否则为10%}bl:=if(STKINBLOCK(STKLABEL,'ST板块'),1.0495,1.095);{如果涨停返回1,否则返回0}ztb:(c>=intpart(ref(c,1)*bl*100+0.495)/100);编写指标的参考原码大放送---1776.pfc:=收盘价;pfc1:=收盘价;fc:=收盘价;fv:=成交量;pc:=排序位置(pfc,0,1,序列数据量);pc1:=排序(pfc1,0,1,序列数据量);x:=pfc1<>向后引用(pfc1,1) or 是否最后周期;str:='价格成交(手)'+'n';for i=1 to 序列数据量 do begin条件函数 fc[pfc]=fc[pfc[i-1]] thensumv:=sumv+fv[pfc];elsesumv:=fv[pfc];条件函数 x thenstr:=str+数字转化为字符串(fc[pfc],2)+' ---------- '+数字转化为字符串(sumv,0)+'n';end;显示解盘文字(1,str),COLORWHITE;77.var1:=求和(成交额,m)/m;Var2:=求和(成交量,N)/N;Var3:=Var2*向前引用(Var2,N-1);Var4:=Var2/向前引用(Var2,N-1);Var5:=最高值(Var2,N)*var1;Var6:=最低值(Var2,N)*var1;看空: 画柱线(Var3,Var5,Var6,8,1),colorcyan;看多: 画柱线(Var4,Var5,Var6,8,1),colorred;78.趋势线: 3*移动平均((收盘价-最低值(最低价,27))/(最高值(最高价,27)-最低值(最低价,27))*100,5,1)-2*移动平均(移动平均((收盘价-最低值(最低价,27))/(最高值(最高价,27)-最低值(最低价,27))*100,5,1),3,1);见底信号: 10;买点准备: 条件函数(趋势线<=10,50,0);买入时间: 条件函数(交叉函数(趋势线,见底信号),100,0);79.Var1:=(2*收盘价+最高价+最低价)/4;Var2:=最低值(最低价,34);Var3:=最高值(最高价,34);波: 指数平滑移动平均((Var1-Var2)/(Var3-Var2)*100, 13) ,linethick2,colorred ;段: 指数平滑移动平均(0.667*向前引用(波,1)+0.333*波,4) ,color00ffff linethick2;画柱线(交叉函数(波,段) AND 波<20,0,20,5,0),linethick2,colorred ;画柱线(交叉函数(段,波) AND 段>60,100,80,5,0),color00ffff linethick2;显示文字(交叉函数(波,段) AND 波<20,35,'抄底'),colorblue,linethick2;显示文字(交叉函数(段,波) AND 段>60,65,'逃顶'),colorblue linethick2;80.趋势线: (1.06*(3*移动平均((收盘价-最低值(最低价,27))/(最高值(最高价,27)-最低值(最低价,27))*100,5,1)-2*移动平均(移动平均((收盘价-最低值(最低价,27))/(最高值(最高价,27)-最低值(最低价,27))*100,5,1),3,1)-50)+50);Var2:=(2*收盘价+最高价+最低价+开盘价)/5;Var3:=最低值(最低价,34);Var4:=最高值(最高价,34);SK: 指数平滑移动平均((Var2-Var3)/(Var4-Var3)*100,13);SD: 指数平滑移动平均(SK,3);买入: 条件函数(交叉函数(趋势线,8.5),60,19);卖出: 条件函数(交叉函数(87,趋势线),40,81);Var5:=成交额/成交量/100;Var6:=条件函数(Var5>收盘价*1.1,收盘价,条件函数(Var5<收盘价*0.9,收盘价,Var5));Var7:=100*获利盘比例(Var6);Var8:=简单移动平均(Var7,8);Var9:=最高值(收盘价,0)/Var8;VarA:=条件函数(Var9>2.5,-10,Var9);VarB:=条件函数(VarA>1,-10,VarA);底限: VarB, , ;VarC:=Var8/最低值(最低价,0);VarD:=最高值(最高价,0)/Var8*8*10;VarE:=条件函数(VarD>50,50,VarD);VarF:=VarE;Var10:=最高值(最高价,0)/Var8*4.5*100;Var11:=条件函数(Var10>100,103,Var10);显示文字(交叉函数(87,趋势线),35,'逃'), , ;显示文字(交叉函数(趋势线,8.5),65,'买'), , ;显示文字(交叉函数(90,Var8),86,'诱多'), , ;显示文字(交叉函数(Var8,10),11,'吸筹'), , ;显示文字(交叉函数(Var8,46),Var8,'拉升'), ,;Var13:=条件函数(交叉函数(SK,SD),23,19);Var14:=条件函数(交叉函数(SD,SK),77,81);卖出1: Var14, , ;买进: Var13, , ;81.80, , colorred;20,coloryellow;Var1:=最高值(最高价,9)-最低值(最低价,9);Var2:=最高值(最高价,9)-收盘价;Var3:=收盘价-最低值(最低价,9);Var4:=Var2/Var1*100-70;Var5:=(收盘价-最低值(最低价,60))/(最高值(最高价,60)-最低值(最低价,60))*100;Var6:=(2*收盘价+最高价+最低价)/4;Var7:=移动平均(Var3/Var1*100,3,1);Var8:=最低值(最低价,34);Var9:=移动平均(Var7,3,1)-移动平均(Var4,9,1);VarA:=条件函数(Var9>100,Var9-100,0);VarB:=最高值(最高价,34);VarC:=指数平滑移动平均((Var6-Var8)/(VarB-Var8)*100,13);VarD:=指数平滑移动平均(0.667*向前引用(VarC,1)+0.333*VarC,2);VarD, ,colorred;画柱线(VarC-VarD>0,VarC,VarD,8,0),colorgreen ,;画柱线(VarC-VarD<0,VarC,VarD,8,0), , colorred;差值: (VarC-VarD)*5, ,colorgreen ;画柱线(差值>=0,0,差值,4,0), ,coloryellow;画柱线(差值>=0,0,差值*0.8,4,0), , colorff9900;画柱线(差值>=0,0,差值*0.6,4,0), ,colorffcc00;画柱线(差值>=0,0,差值*0.4,4,0), ,colorffcccc ;画柱线(差值>=0,0,差值*0.2,4,0), , colorffccff;画柱线(差值<=0,0,差值*1,4,0), , color00ff00;画柱线(差值<=0,0,差值*0.8,4,0), ,color00cc00;画柱线(差值<=0,0,差值*0.6,4,0), color009900,;画柱线(差值<=0,0,差值*0.4,4,0), ,color006600;画柱线(差值<=0,0,差值*0.2,4,0), , ;82.Var1:=(指数平滑移动平均(收盘价,12)-指数平滑移动平均(收盘价,26))*100;Var2:=指数平滑移动平均(Var1,9);Var3:=2*(Var1-Var2);画区间彩带(Var1>=0,0,Var1*0.8),COLOREEEEFF;画区间彩带(Var1>=0,0,Var1*0.7),COLORDDDDFF;画区间彩带(Var1>=0,0,Var1*0.6),COLORCCCCFF;画区间彩带(Var1>=0,0,Var1*0.5),COLORBBBBFF;画区间彩带(Var1>=0,0,Var1*0.4),COLORAAAAFF;画区间彩带(Var1>=0,0,Var1*0.3),COLOR9999FF;画区间彩带(Var1>=0,0,Var1*0.2),COLOR8888FF;画区间彩带(Var1>=0,0,Var1*0.1),COLOR7777FF;画区间彩带(Var1<0,0,Var1*0.8),COLORFFB0B0;画区间彩带(Var1<0,0,Var1*0.7),COLORFF9D9D;画区间彩带(Var1<0,0,Var1*0.6),COLORFF8E8E;画区间彩带(Var1<0,0,Var1*0.5),COLORFF7D7D;画区间彩带(Var1<0,0,Var1*0.4),COLORFF6A6A;画区间彩带(Var1<0,0,Var1*0.3),COLORFF4D4D;画区间彩带(Var1<0,0,Var1*0.2),COLORFF2D2D;画区间彩带(Var1<0,0,Var1*0.1),COLORFF0000;画区间彩带(Var2>=0,0,Var2*0.8),COLORD3FF60;画区间彩带(Var2>=0,0,Var2*0.7),COLORC2FF24;画区间彩带(Var2>=0,0,Var2*0.6),COLORBAFF02;画区间彩带(Var2>=0,0,Var2*0.5),COLORAFF200;画区间彩带(Var2>=0,0,Var2*0.4),COLORA4E100;画区间彩带(Var2>=0,0,Var2*0.3),COLOR96CE00;画区间彩带(Var2>=0,0,Var2*0.2),COLOR89BD00;画区间彩带(Var2>=0,0,Var2*0.1),COLOR78A600;画区间彩带(Var2<0,0,Var2*0.8),COLOR1EBE01;画区间彩带(Var2<0,0,Var2*0.7),COLOR20CD01;画区间彩带(Var2<0,0,Var2*0.6),COLOR22DC01;画区间彩带(Var2<0,0,Var2*0.5),COLOR25F101;画区间彩带(Var2<0,0,Var2*0.4),COLOR34FE10;画区间彩带(Var2<0,0,Var2*0.3),COLOR49FE29;画区间彩带(Var2<0,0,Var2*0.2),COLOR6BFE52;画区间彩带(Var2<0,0,Var2*0.1),COLOR82FE6B;83.画渐变背景色(收盘价>1, RGB颜色值(50,80,40), RGB颜色值(20,70,110),1);0,colorff6633;DIFF:指数平滑移动平均(收盘价,12) - 指数平滑移动平均(收盘价,26),colormagenta,LINETHICK1;DEA:指数平滑移动平均(DIFF,9),coloryellow,LINETHICK1;MACD:2*(DIFF-DEA), 彩色棒状线;MACD1:2*(DIFF-DEA),colorred;MACD2:加权移动平均(MACD1,3),colorcyan;画柱线(MACD1>MACD2 and macd1>0,0,MACD1,2,0),colorred;画柱线(MACD1>MACD2 and macd1<0,0,MACD1,2,0),coloryellow;画柱线(MACD1<MACD2,0,MACD1,1,0),COLORCYAN;84.坐标线:-10;50;70;110;ww:100*(收盘价-最低值(最低价,18))/(最高值(最高价,18)-最低值(最低价,18));ww2:100*(收盘价-最低值(最低价,36))/(最高值(最高价,36)-最低值(最低价,36));lsqu:70;85.a1:=成交额/成交量/流通盘大小*10000;a2:=条件函数(收盘价<向前引用(收盘价,1),a1,0);a3:=条件函数(收盘价>=向前引用(收盘价,1),a1,0);看空能量:指数平滑移动平均(求和(a2,n),m),棒状线,colorgreen;做空能量:-指数平滑移动平均(求和(a2,n),m),棒状线,colorgreen;看多能量:指数平滑移动平均(求和(a3,n),m),棒状线,colorred;做多能量:-指数平滑移动平均(求和(a3,n),m),棒状线,colorred;86.龙头线:指数平滑移动平均(成本分布(3),3),colormagenta,LINETHICK1,;龙尾线:指数平滑移动平均(成本分布(21),3),LINETHICK1,,colorgreen;龙心线:指数平滑移动平均((成本分布(8)+成本分布(21))/2,8),coloryellow,LINETHICK1;龙飘飘:最高值(最高价,21),COLORred,linethick1;龙悄悄:最低值(最低价,21),COLORcyan,linethick1;龙行吟:画图标(交叉函数("kdj.j",龙头线) or 交叉函数("vmacd.diff",龙头线),最低价,10),linethick0;87.龙麟:最高值(最高价,21),COLORyellow,linethick1;龙宫:最低值(最低价,21),COLORGREEN,linethick1;Varr1:=移动平均(最大值(收盘价-向前引用(收盘价,1),0),6,1)/移动平均(绝对值(收盘价-向前引用(收盘价,1)),6,1)*100;KS:=(收盘价-简单移动平均(收盘价,13))/简单移动平均(收盘价,13)*(-100);RKS:=向前引用(KS,1);MLS:=RKS/KS>=1.23 AND RKS>=8 AND 收盘价/向前引用(收盘价,1)>=1.02;超跌:=画柱线(KS>=8,最高价,最低价,0,1),colorwhite,linethick2;反弹:=画柱线(MLS=1,最高价,最低价,0,1),colormagenta,linethick2;画柱线(收盘价>=开盘价,收盘价,开盘价,8,1) COLORred;画柱线(收盘价<=开盘价,收盘价,开盘价,8,1) COLORgreen;画柱线(KS>=8,开盘价,收盘价,8,1),colorwhite,linethick2;画柱线(MLS=1,开盘价,收盘价,8,1),colormagenta,linethick2;MA1:=指数平滑移动平均(收盘价,3),linethick2;MA2:=指数平滑移动平均(收盘价,5),linethick2;MA3:=指数平滑移动平均(收盘价,8),linethick2;MA4:=指数平滑移动平均(收盘价,13),linethick2;MA5:=指数平滑移动平均(收盘价,21),linethick2;MA6:=指数平滑移动平均(收盘价,34),linethick2;MA7:=指数平滑移动平均(收盘价,55),linethick2;MA8:=指数平滑移动平均(收盘价,89),linethick2;龙行:指数平滑移动平均(收盘价,10),colorcyan;龙舞:龙行 + 1.91*估算标准差(收盘价,10),colormagenta;龙穴:龙行 - 1.91*估算标准差(收盘价,10),colorblue;资金存量1:=指数平滑移动平均(获利盘比例(收盘价*0.90)*100*收盘价,2),colorred,linethick0;资金存量2:=获利盘比例(收盘价*0.85)*100*收盘价,colorgreen,linethick0;ma1:=指数平滑移动平均(资金存量1,3),linethick2;ma2:=指数平滑移动平均(资金存量1,5),linethick2;ma3:=指数平滑移动平均(资金存量1,8),linethick2;ma4:=指数平滑移动平均(资金存量1,13),linethick2;aa:=信号过滤(交叉函数(ma1,ma2),10);bb:=信号过滤(交叉函数("kdj.j",资金存量1 or 资金存量2),10);88.J0:=(收盘价+最低价+开盘价+最高价)/4;J1:=简单移动平均(J0,11);RSV:=(J1-最低值(J1,9))/(最高值(J1,9)-最低值(J1,9))*100;K:移动平均(RSV,3,1);D:移动平均(K,3,1);J:3*K-2*D;编写指标的参考原码大放送---1673.AA:=交易类型('模拟训练','', 1);BB:=交易类型('模拟训练','', 2);CC:=交易价格('模拟训练','',1);DD:=交易价格('模拟训练','',2);显示数字(aa=1 and 是否最后周期,cc*0.99,cc,2),SHIFT2,COLORRED;显示数字(bb=1 and 是否最后周期,dd*1.01,dd,2),SHIFT2,COLORGREEN;画图标(AA=1,CC,4);画图标(BB=1,DD,5);EE:=交易量('模拟训练','',1);FF:=交易量('模拟训练','',2);显示解盘数值(aa,'多头买入价格:',CC,2,0),COLORRED;显示解盘数值(bb,'多头卖出价格:',DD,2,0),COLORGREEN;显示解盘数值(AA,'多头买入量:',EE,2,0),COLORRED;显示解盘数值(BB,'多头卖出量:',FF,2,0),COLORGREEN;74.股价重心:=动态移动平均(成交额/成交量/100,成交量/流通盘大小),colorgreen,linethick2;主线:=(简单移动平均(收盘价,6)+简单移动平均(收盘价,12)+简单移动平均(收盘价,24)+简单移动平均(收盘价,36))/4,linethick2,colorff00ff;ma14:=指数平滑移动平均(收盘价,14);ma34:=指数平滑移动平均(收盘价,26);ma54:=指数平滑移动平均(收盘价,54);ma90:=指数平滑移动平均(收盘价,90);ma120:=指数平滑移动平均(收盘价,120),点状线,linethick2,colorwhite;年线:=指数平滑移动平均(收盘价,250),coloryellow,linethick2;{中短波}hz:=指数平滑移动平均(收盘价,13);短波:指数平滑移动平均(hz,1),color00dd00,linethick1;中波:指数平滑移动平均(hz,26),colorred,linethick1;均线148天:=指数平滑移动平均(收盘价,148),点状线,linethick1,colorgreen;成本:=求和(成交额,0)/求和(成交量,0)/100,coloryellow ,linethick2 ;hz2:指数平滑移动平均(hz,8),colorgreen,linethick2;hz4:指数平滑移动平均(hz,39),colorff00ff,linethick2;a1:画柱线(hz2<HZ4,短波,HZ4,1.5,0),COLORBLUEa2:画柱线(短波>hz2,短波,hz2,3,0),colorgreen;a3:画柱线(中波>hz4,中波,hz4,2,0),colorff00ff;{慢速kdj}rsv:=(收盘价-最低值(最低价,60))/(最高值(最高价,60)-最低值(最低价,60))*100;fastk:=移动平均(rsv,12,1);k:=移动平均(fastk,9,1),coloryellow;d:=移动平均(k,3,1),linethick2,colorblue;j:=3*k-2*d,linethick1,colorgreen;{中波}var11:=3*移动平均((收盘价-最低值(最低价,75))/(最高值(最高价,75)-最低值(最低价,75))*100,20,1)-2*移动平均(移动平均((收盘价-最低值(最低价,75))/(最高值(最高价,75)-最低值(最低价,75))*100,20,1),15,1);var22:=100-var11;中势线:=(-1)*(指数平滑移动平均(var22,1)-50)+42,coloryellow,linethick2;tz:=(收盘价-最低值(最低价,331))/(最高值(最高价,331)-最低值(最低价,331))*100;强势线:=移动平均(tz,5,1),linethick2,colorred;大盘线:=70*(最高值(最高价,39)-收盘价)/(最高值(最高价,39)-最低值(最低价,39)),linethick1,color009900;{量选}aa:=成交量/求和(成交量,13);bb:=动态移动平均(收盘价,aa);cc:=成交量/求和(成交量,34);dd:=动态移动平均(收盘价,cc);{背离}var00:=获利盘比例(收盘价);var1:=线性回归预测值(var00,10);var2:=简单移动平均(var1,3);var3:=简单移动平均(var2,12);var4:=简单移动平均(var3,16);var5:=简单移动平均(var4,31);var6:=简单移动平均(var5,55);var7:=var5;var8:=var4>var2*1.11 and var3>var2*1.095;a:=var4/var2;b:=var3/var2;var9:=var2>var1*0.95;td:=var2/var1;var1h:=对应大盘收盘价;var2h:=简单移动平均(var1h,6);var3h:=简单移动平均(var1h,24);var4h:=简单移动平均(var1h,32);var5h:=简单移动平均(var1h,62);var6h:=简单移动平均(var1h,105);var7h:=var5h;var8h:=var4h>var2h*1.11 and var3h>var2h*1.095;var9h:=var2h>var1h*0.95;pt:=(条件函数(最高价=最低价 and 收盘价=开盘价 and 最低价=收盘价and 收盘价>0 and 向前引用(最高价,1)=向前引用(最低价,1)and 向前引用(收盘价,1)=向前引用(开盘价,1)and 向前引用(最高价,1)=向前引用(收盘价,1) and 向前引用(收盘价,1)>0,0,1))>0;g:=(var7h and var8h and var9h and 收盘价/成本分布(8)<=0.7985and (统计总数(收盘价=最低价,4)<3 or 收盘价>向前引用(收盘价,1)))and pt orvar7 and var8 and var9 and 收盘价/成本分布(5)<=0.8 and((var1>开盘价 or var1>向前引用(开盘价,1) or向前引用(var1,1)));背离:=var2<向前引用(var2,1) and a>向前引用(a,1);买入信号1:=var1>a and var2>b;买入信号2:=b>a and 1>b and a<1 and 最高价=最高值(最高价,21);buy:=统计总数(背离,20)>1 and 买入信号2=1 and 收盘价>开盘价 or 交叉函数(bb,dd);画图标(交叉函数(短波,hz2),中波,1);显示文字(交叉函数(主线,ma90) and 大盘线<36 and j>k and 强势线>向前引用(强势线,1) and 中势线>向前引用(中势线,1) and 短波-向前引用(短波,1)>0.088 and hz4-向前引用(hz4,1)>0.028 or 交叉函数(主线,ma120) and 大盘线<36 and j>k and 强势线>向前引用(强势线,1) and 中势线>向前引用(中势线,1) and 短波-向前引用(短波,1)>0.088 and hz4-向前引用(hz4,1)>0.028 or交叉函数(ma120,均线148天) and 大盘线<36 and j>k and 强势线>向前引用(强势线,1) and 中势线>向前引用(中势线,1) and 短波-向前引用(短波,1)>0.088 and hz4-向前引用(hz4,1)>0.028 or 交叉函数(中势线,33) and 短波>hz2 and 开盘价>向前引用(开盘价,1) and 收盘价>向前引用(收盘价,1) and j>d and j<65 and 大盘线<36 and 强势线>36 and 主线>向前引用(主线,1)and 强势线>向前引用(强势线,1) and 中势线>向前引用(中势线,1)and 中势线<70 and 收盘价>开盘价and ma34>向前引用(ma34,1) and 短波-向前引用(短波,1)>0.088 and hz4-向前引用(hz4,1)>0.028 or交叉函数(短波,hz2) and 大盘线<36 and 短波>中波and 中波>hz4 and 短波-向前引用(短波,1)>0.088 and hz4-向前引用(hz4,1)>0.028 orj>k and 大盘线<36 and 短波>hz2 and 交叉函数(强势线,36) or 交叉函数(短波,hz2) and 交叉函数(强势线,36) or 交叉函数(j,k) and 交叉函数(强势线,33)or 交叉函数(短波,hz2) and 交叉函数(强势线,54)or 交叉函数(j,k) and 大盘线<36 and j<65 and 收盘价>开盘价and 短波-向前引用(短波,1)>0.088 or交叉函数(j,k) and 短波>hz2 and j<68 and 短波>向前引用(短波,1) and hz2>向前引用(hz2,1) and 中势线>向前引用(中势线,1) and 短波-向前引用(短波,1)>0.088 or交叉函数(j,k) and 大盘线<36 and j<68 and 短波-向前引用(短波,1)>0.088 or 交叉函数(j,k) and 交叉函数(短波,hz2) and 大盘线<36 or交叉函数(短波,hz2) and 大盘线<36 and j>k and j<68 and 强势线>向前引用(强势线,1) and 中势线>向前引用(中势线,1) and 短波-向前引用(短波,1)>0.088 or交叉函数(短波,hz2) and 中波>ma120 and 中波>均线148天and hz2>ma120 and ma120>均线148天and 短波-向前引用(短波,1)>0.088 or交叉函数(j,k) and 强势线>54 and 强势线>向前引用(强势线,1) and j<68or 统计总数(背离,20)>1 and 短波>hz2 and 开盘价>向前引用(开盘价,1) and 收盘价>向前引用(收盘价,1) and j>d and j<65 and 买入信号2=1 and 主线>向前引用(主线,1)and 中势线>向前引用(中势线,1) and 中势线<70 and 收盘价>开盘价 or交叉函数(bb,dd) and j<74 and ma34>向前引用(ma34,1) and 短波-向前引用(短波,1)>0.088 or大盘线<36 and j>d and j<65 and 收盘价>开盘价 and 短波>向前引用(短波,1) and 交叉函数(hz2,中波) and 短波-向前引用(短波,1)>0.088 and 开盘价>向前引用(收盘价,1) or收盘价>开盘价 and 短波>向前引用(短波,1) and j>d and j<65 and 大盘线<36 and 交叉函数(中势线,33) and 中势线-向前引用(中势线,1)>0.23 and 短波-向前引用(短波,1)>0.088and 开盘价>向前引用(收盘价,1) and 强势线>12 or短波>hz2 and 中波>hz4 and 大盘线<36 and 交叉函数(j,k) and j<65 and 短波-向前引用(短波,1)>0.088 or短波>hz2 and 大盘线<36 and 交叉函数(j,k) and j<65 and 短波-向前引用(短波,1)>0.088 or 交叉函数(j,k) and 交叉函数(短波,hz2) and 大盘线<36 and j<56 or短波>hz2 and 中波>hz4 and 大盘线<36 and j>d and j<65 and 交叉函数(hz4,年线) and 短波-向前引用(短波,1)>0.088 or 短波>hz2 and hz2>hz4 and 大盘线<36 and j>d and j<65 and j<65 and 交叉函数(强势线,46) and 短波-向前引用(短波,1)>0.088 or 短波>hz2 and 大盘线<36 and j>d and j<65 and 交叉函数(中势线,36) and 短波-向前引用(短波,1)>0.088,hz2-0.18,'!逢低介入'),colorwhite;{好}显示文字(交叉函数(短波,hz2) and 收盘价>开盘价 and j>k and j>d and 大盘线<36 and 收盘价>hz4,最低价*1.09,'●'),coloryellow;显示文字(交叉函数(短波,hz2) and 收盘价>开盘价 and j>k and j>d and 大盘线<36 and 收盘价>hz4,最低价*1.12,'逢高减磅'), coloryellow;显示文字(交叉函数(短波,hz2),收盘价,'♂^^');显示文字(交叉函数 ( 中波,hz4),收盘价,'♂^^');显示文字(交叉函数 ( 中波,ma120),收盘价,'♂^^');显示文字(交叉函数 (hz4,ma120),收盘价,'♂^^');75.画渐变背景色(收盘价>0, RGB颜色值(0,140,150), RGB颜色值(0,30,0),1);Var1:=((收盘价-简单移动平均(收盘价,6))/简单移动平均(收盘价,6)*100+(收盘价-简单移动平均(收盘价,24))/简单移动平均(收盘价,24)*100+(收盘价-简单移动平均(收盘价,32))/简单移动平均(收盘价,32)*100)/3;跟随趋势活动: 条件函数(Var1>0,Var1,0), COLORMAGENTA,LINETHICK2;无事睡觉休息:20,colorCYAN;66.{公式取数据周期当日第一个K线值为计算,切换不同数据周期,结果不同,按照前面思路,切换为30分钟线即可}aa:=上一次条件成立位置(日期<>向前引用(日期,1));hh:=向前引用(最高价,aa);ll:=向前引用(最低价,aa);阻力1:=ll+(hh-ll)*0.328;阻力2:=ll+(hh-ll)*0.5;阻力3:=ll+(hh-ll)*0.618;支撑1:=hh-(hh-ll)*0.328;支撑2:=hh-(hh-ll)*0.5;支撑3:=hh-(hh-ll)*0.618;显示解盘数值(1,'【阻力位价一】:',阻力1,3,0),COLORGREEN;显示解盘数值(1,'【阻力位价二】:',阻力2,3,0),COLORGREEN;显示解盘数值(1,'【阻力位价三】:',阻力3,3,0),COLORGREEN;显示解盘数值(1,'【支撑位价一】:',支撑1,3,0),COLORRED;显示解盘数值(1,'【支撑位价二】:',支撑2,3,0),COLORRED;显示解盘数值(1,'【支撑位价三】:',支撑3,3,0),COLORRED;//叠加极限布林线BBI:=(简单移动平均(收盘价,3)+简单移动平均(收盘价,6)+简单移动平均(收盘价,12)+简单移动平均(收盘价,24))/4;UPR:BBI+3*估算标准差(BBI,10);DWN:BBI-3*估算标准差(BBI,10);//变形KDJTH:=移动平均(最高值(最高价,10),15,5);TL:=移动平均(最低值(最低价,10),15,5);T24:=(TH-TL)*0.24+TL;T76:=(TH-TL)*0.76+TL;//主图MACDDIFF1:=指数平滑移动平均(收盘价,4)-指数平滑移动平均(收盘价,10);DEA1:=指数平滑移动平均(DIFF1,5);DIFF:=DIFF1*4.5+指数平滑移动平均(收盘价,4)*0.9,COLORWHITE;DEA:=DEA1*4.5+指数平滑移动平均(收盘价,5)*0.9,COLORYELLOW;//看涨提示cc:=交叉函数(最低价,TL);画图标(cc,最低价,1);ee:=交叉函数(最高价,T24);画图标(ee,最低价,10),ALIGN0;gg:=(cc+ee and 收盘价=最高价);//决定行情的核心内容VAR1:=最高值(最高价,144);建仓区域:=最低值(最低价,144)*1.2,linethick2,colorgreen;逢低介入:=最低值(最低价,144),linethick3,colormagenta;出货区域:=条件函数(var1>最低值(最低价,233)*1.45 AND VAR1>最低价*1.3,VAR1*0.82,0),linethick4;逢高出局:=条件函数(var1>最低值(最低价,233)*1.45 AND VAR1>最低价*1.3,VAR1,0),linethick5;显示解盘数值(1,'【主力派发高点】=',逢高出局,2,0),COLORred;显示解盘数值(1,'【主力派发区域】=',出货区域,2,0),COLORyellow;显示解盘数值(1,'【主力底仓】=',逢低介入,2,0),COLORcyan;显示解盘数值(1,'【主力建仓】=',建仓区域,2,0),COLORgreen;//买卖提示Var1:=最低值(最低价,5)=最低值(最低价,45) AND 收盘价>=开盘价*1.04;Var2:=收盘价>(向前引用(最高价,1)+向前引用(最低价,1))/2;买入提示:=Var1 AND Var2,linethick0,colorred;Var3:=向前引用(收盘价,1);Var4:=移动平均(最大值(收盘价-Var3,0),6,1)/移动平均(绝对值(收盘价-Var3),6,1)*100;卖出提示:=交叉函数(80,Var4),linethick0,colorgreen;画图标(买入提示,最低价-0.01,1);画图标(卖出提示,最高价+0.1,2);//参考价格PT:=向前引用(最高价,1)-向前引用(最低价,1),linethick0;CDP:=(向前引用(最高价,1)+向前引用(最低价,1)+向前引用(收盘价,1)*2)/4linethick0;AH:=(CDP+PT);AL:=(CDP-PT);NH:=(2*CDP-最低价);NL:=(2*CDP-最高价),linethick0;近高值0:=条件函数(AH>NH,NH,AH),LINETHICK0;近低值0:=条件函数(AL<NL,NL,AL),LINETHICK0;最高值0:=条件函数(AH>NH,AH,NH),LINETHICK0;最低值0:=条件函数(AL<NL,AL,NL),LINETHICK0;显示解盘数值(介于(开盘价,近高值0,近低值0),'【盘局买入价参考】:',近低值0,2,0),colorred;显示解盘数值(介于(开盘价,近高值0,近低值0),'【盘局卖出价参考】:',近高值0,2,0),colorcyan;显示解盘数值(介于(开盘价,最高值0,近高值0)OR(开盘价>最高值0),'【盘局买入价参考】:',最高值0,2,0),colorgreen;显示解盘数值(介于(开盘价,最低值0,近低值0)OR(开盘价<最低值0),'【盘局卖出价参考】:',最低值0,2,0),colormagenta;//主力资金VAR1:=(扩展数据(4)-扩展数据(5))/100,linethick0;庄资金5:=指数平滑移动平均(VAR1,5) COLORRED,linethick0;庄资金13:=指数平滑移动平均(VAR1,13) COLORYELLOW,linethick0;庄资金34:=指数平滑移动平均(VAR1,34) COLORGREEN,linethick0;庄家OBV:=求和((扩展数据(4)-扩展数据(5)),0)/10000 COLORmagenta,linethick0;显示解盘数值(1=1,'【庄家资金5】=',庄资金5,2,0),COLORred;显示解盘数值(1=1,'【庄家资金34】=',庄资金34,2,0),COLORred;显示解盘数值(1=1,'【庄家资金OBV】=',庄家OBV,2,0),COLORred;//委托情况委卖OBV:=求和(扩展数据(7),0)/1000000 COLORmagenta,,linethick0;显示解盘数值(1=1,'【委卖OBV】=',委卖OBV,2,0),COLORred;委买OBV:=求和(扩展数据(6),0)/1000000 COLORmagenta,linethick0;显示解盘数值(1=1,'【委买OBV】=',委买OBV,2,0),COLORred;每日委卖量:=求和((委卖量(1)+委卖量(2)+委卖量(3)+委卖量(4)+委卖量(5)+委卖量(6)+委卖量(7)+委卖量(8)+委卖量(9)),0),LINETHICK0;显示解盘数值(1=1,'【每日委卖量】=',每日委卖量,2,0),COLORred;每日委买量:=求和((委买量(1)+委买量(2)+委买量(3)+委买量(4)+委买量(5)+委买量(6)+委买量(7)+委买量(8)+委买量(9)),0),LINETHICK0;显示解盘数值(1=1,'【每日委买量】=',每日委买量,2,0),COLORred;//资金情况VAR1:=(扩展数据(2)-扩展数据(3))/100,linethick0;资金5:=指数平滑移动平均(VAR1,5) COLORRED,linethick0;资金13:=指数平滑移动平均(VAR1,13) COLORYELLOW,linethick0;资金34:=指数平滑移动平均(VAR1,34) COLORGREEN,linethick0;显示解盘数值(1=1,'【资金5】=',资金5,2,0),COLORcyan;显示解盘数值(1=1,'【资金13】=',资金13,2,0),COLORcyan;显示解盘数值(1=1,'【资金34】=',资金34,2,0),COLORcyan;//能量牛熊OBV:=求和((扩展数据(2)-扩展数据(3)),0)/10000 COLORmagenta,linethick0;显示解盘数值(1=1,'【牛熊OBV】=',牛熊OBV,2,0),COLORred;//买卖盘每日卖单总和:=求和(主动性卖单,0),linethick0;每日买单总和:=求和(主动性买单,0),linethick0;每日庄卖:=求和(条件函数(主动性卖单>=100,成交量,0),0),linethick0;每日庄买:=求和(条件函数(主动性买单>=100,成交量,0),0),linethick0;显示解盘数值(1=1,'【每日卖单总和】=',每日卖单总和,2,0),COLORyellow;显示解盘数值(1=1,'【每日买单总和】=',每日买单总和,2,0),COLORgreen;显示解盘数值(1=1,'【每日庄卖】=',每日庄卖,2,0),COLORred;显示解盘数值(1=1,'【每日庄买】=',每日庄买,2,0),COLORcyan;//博弈成员A:=条件函数(收盘价>126.32,成交额/100000,成交量),linethick0;主力:=简单移动平均(A,4),COLORYELLOW,LINETHICK0;游资:=简单移动平均(A,8),COLORGREEN,LINETHICK0;大户:=简单移动平均(A,16),COLORRED,LINETHICK0;散户:=简单移动平均(A,32),COLORCYAN,LINETHICK0;主力参与比例:=四舍五入为整数(主力/(主力+游资+大户+散户)*100),coloryellow,linethick0;游资参与比例:=四舍五入为整数(游资/(主力+游资+大户+散户)*100),colorgreen,linethick0;大户参与比例:=四舍五入为整数(大户/(主力+游资+大户+散户)*100),colorred,linethick0;散户参与比例:=四舍五入为整数(散户/(主力+游资+大户+散户)*100),colorcyan,linethick0;警戒线:=简单移动平均(A,180),COLORMAGENTA,linethick0;显示解盘数值(1,'【主力】=',主力,2,0),COLORyellow;显示解盘数值(1,'【游资】=',游资,2,0),COLORgreen;显示解盘数值(1,'【大户】=',大户,2,0),COLORred;显示解盘数值(1,'【散户】=',散户,2,0),COLORcyan;显示解盘数值(1,'【主力参与比例】=',主力参与比例,2,0),COLORyellow;显示解盘数值(1,'【游资参与比例】=',游资参与比例,2,0),COLORgreen;显示解盘数值(1,'【大户参与比例】=',大户参与比例,2,0),COLORred;显示解盘数值(1,'【散户参与比例】=',散户参与比例,2,0),COLORcyan;显示解盘数值(1,'【警戒线】=',警戒线,2,0),COLORmagenta;//短线参考FL:=简单移动平均(收盘价,17)+绝对值(简单移动平均(收盘价,17)-向前引用(简单移动平均(收盘价,17),1)),colorf4e202,linethick0;FS:=简单移动平均(收盘价,17)+简单移动平均(收盘价,17)-向前引用(简单移动平均(收盘价,17),1),colorf4e202,linethick0;CG:=条件函数(简单移动平均(收盘价,17)<FS,FS,简单移动平均(收盘价,17)),colorf4e202,linethick0;显示解盘数值(1,'【短线卖出参考价1】=',fs,2,0),COLORgreen;显示解盘数值(1,'【短线卖出参考价2】=',cg,2,0),COLORyellow;显示解盘数值(1,'【短线卖出参考价3】=',fl,2,0),COLORred;VAR0:=(收盘价*2+最高价+最低价)/4*成交量;var1:=求和(VAR0,89)/求和(成交量,89);var2:=条件函数(统计总数(VAR0>0,2)>=2,简单移动平均(收盘价,89)*(1+(简单移动平均(VAR0,89)/向前引用(简单移动平均(VAR0,89),1)-1)/21),简单移动平均(收盘价,89));var3:=条件函数(统计总数(绝对值(收盘价-var1)>21,8)>=1 AND 统计总数(收盘价/向前引用(收盘价,1)<0.8,8)<1 AND 统计总数(VAR0>0,2)>=2,10,0);var4:=条件函数(收盘价>=var1 AND 统计总数(VAR0>0,2)>=2,var1*1.001,条件函数(VAR0<0.1 AND 统计总数(VAR0>0,2)<1.5,简单移动平均(收盘价,89),var1*0.999));var5:=条件函数(var3>0,var2,var4);var6:=简单移动平均(收盘价,89);搏杀生命线:=条件函数(var5/向前引用(var5,1)>1.1 OR var5/向前引用(var5,1)<0.9,VAR6,VAR5),colorff80ff,linethick0;显示解盘数值(1,'【多空搏杀临界点】=',搏杀生命线,2,0),COLORmagenta;a:=(收盘价*2+最高价+最低价)/4*成交量;b:=求和(a,1)/求和(成交量,1);b1:=指数平滑移动平均(b,17);资金:=(b-b1)*100/b,coloryellow,linethick0;强弱线:=0,color808080,linethick0;显示解盘数值(1,'【每日资金流向】=',资金,2,0),COLORwhite;VAR1:=成交量/((最高价-最低价)*2-绝对值(收盘价-开盘价));成交能量:=成交量,linethick0;主动买盘:=条件函数(收盘价>开盘价,VAR1*(最高价-最低价),条件函数(收盘价<开盘价,VAR1*((最高价-开盘价)+(收盘价-最低价)),成交量/2)),linethick0,colorred;主动卖盘:=条件函数(收盘价>开盘价,0-VAR1*((最高价-收盘价)+(开盘价-最低价)),条件函数(收盘价<开盘价,0-VAR1*(最高价-最低价),0-成交量/2)),linethick0,colorgreen;显示解盘数值(1,'【成交量】=',成交能量,2,0),COLORmagenta;显示解盘数值(1,'【主动买盘】=',主动买盘,2,0),COLORcyan;显示解盘数值(1,'【主动卖盘】=',主动卖盘,2,0),COLORyellow;持股线:=简单移动平均(最高价,21),coloryellow,linethick0;空仓线:=简单移动平均(最低价,21),colorgreen,linethick0;操盘趋势:=简单移动平均(收盘价,3),linethick0;显示解盘数值(1,'【突破压力价位】=',持股线,2,0),COLORyellow;显示解盘数值(1,'【短线回调价位】=',空仓线,2,0),COLORred;显示解盘数值(1,'【伺机出击价位】=',操盘趋势,2,0),COLORwhite;MA3:简单移动平均(收盘价,3) colorwhite;MA10:简单移动平均(收盘价,10)coloryellow;画区间彩带(简单移动平均(收盘价,3)>简单移动平均(收盘价,10),简单移动平均(收盘价,3),简单移动平均(收盘价,10))COLORyellow;画区间彩带(简单移动平均(收盘价,3)<简单移动平均(收盘价,10),简单移动平均(收盘价,3),简单移动平均(收盘价,10))COLORgreen;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

部分指标源代码多空博弈:趋势线: 3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,2 7))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1),COLORF0F000;买点准备: IF(趋势线&lt;=10,12,0),LINETHICK2,COLORFF00FF;A11:=MA(CLOSE,5);A12:=MA(CLOSE,10);A13:=MA(CLOSE,20);A14:=MA(CLOSE,30);均线多头排列:IF(A11&gt;A12 AND A12&gt;A13 AND CROSS(A13,A14) AND C&gt;O,18,0),STICK,LINETHICK2,COLOR00BBFF;DRAWTEXT(A11&gt;A12 AND A12&gt;A13 AND CROSS(A13,A14) AND C&gt;O,35,&#39;均线多头排列&#39;),COLOR00FFFF;VAR1:=HHV(HIGH,9)-LLV(LOW,9);VAR2:=HHV(HIGH,9)-CLOSE;VAR3:=CLOSE-LLV(LOW,9);VAR4:=VAR2/VAR1*100-70;VAR5:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60));VAR6:=(2*CLOSE+HIGH+LOW)/4;VAR7:=SMA(VAR3/VAR1*100,3,1);VAR8:=LLV(LOW,34);VAR9:=SMA(VAR7,3,1)-SMA(VAR4,9,1);VAR10:=IF(VAR9&gt;100,VAR9-100,0);VAR11:=HHV(HIGH,34);VAR12:=EMA((VAR6-VAR8)/(VAR11-VAR8)*100,13);VAR13:=EMA(0.667*REF(VAR12,1)+0.333*VAR12,2);VAR13,COLOR000000;STICKLINE(VAR12-VAR13&gt;0,VAR12,VAR13,8,0),COLOR0055FF;STICKLINE(VAR12-VAR13&lt;0,VAR12,VAR13,8,0),COLOR00FF00;A1:=HHV(HIGH,50)/LLV(LOW,100)&gt;1.5;A2:=(HHV(HIGH,50)-LOW)/(HHV(HIGH,50)-LLV(LOW,100));A3:=(LOW-LLV(LOW,100))/(HHV(HIGH,50)-LLV(LOW,100));A4:=HHVBARS(HIGH,50)&lt;LLVBARS(LOW,100);A5:=A1 AND A2&gt;0.5 AND A3&gt;0.3 AND A4;A6:=COUNT(A5,20)=1;抢反弹:IF(A6 AND A5 ,23,0),STICK,LINETHICK2,COLOR00FFFF;DRAWTEXT(抢反弹,35,&#39;抢反弹&#39;),COLOR00BBFF;VAR2W:=100-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));MW:= EMA(VAR2W,3);VAR3W:=EMA(VAR2W,7);M1:= EMA(VAR3W,5);MB1:=CROSS(MW,M1) AND M1&lt;20;抄底:IF((MB1),40,0),LINETHICK2,COLORFFFFFF;DRAWTEXT(抄底,62,&#39;★&#39;),COLOR00FFFF;DRAWTEXT(抄底,52,&#39;抄底&#39;),COLORFF00FF;买卖出击N:=20;N1:=7;N2:=69;T1:=IF((DATE&lt;=1341231),1,0);M3:=EMA(CLOSE,3);M8:EMA(CLOSE,8),COLOR008000;M13:EMA(M8,13),COLOR0000FF;M62:EMA(M8,55),COLORF0F000;VAR1:=EMA(M13,62);M81:EMA(M62,81),COLOR00FFFF;M144:EMA(VAR1,144),LINETHICK2,COLOR0000FF;M250:EMA(VAR1,250),POINTDOT,LINETHICK2,COLORF00FF0;VAR2:=(CLOSE+HIGH+LOW)/(3);VAR3:=(EMA(VAR2,10))*(T1);VAR4:=(REF(VAR3,1))*(T1);STICKLINE((VAR3&gt;VAR4),VAR3,VAR4,4,0),COLOR00FFFF;STICKLINE((VAR3&lt;VAR4),VAR3,VAR4,4,0),COLORFF0000;VAR5:=((REF(HIGH,1)+REF(LOW,1))/(2))*(T1);VAR6:=MA(CLOSE,N)+((2)*(STD(CLOSE,N)))*(T1);DRAWTEXT(CROSS(VAR3,VAR4),(VAR3)*(0.98),&#39;★&#39;),COLOR00FFFF; DRAWTEXT(CROSS(VAR5,VAR6),(HIGH)*(1.04),&#39;↓卖&#39;),COLOR008000; VAR7:=REF(CLOSE,1);VAR8:=((SMA(MAX(CLOSE-VAR7,0),N1,1))/(SMA(ABS(CLOSE-VAR7),N1,1)))*(100); VAR9:=CROSS(N2,VAR8);VARA:=(FILTER(VAR9,4))*(T1);DRAWTEXT(VARA,(HIGH)*(1.04),&#39;↓卖&#39;),COLORFFFFFF;VARB:=((2)*(CLOSE)+HIGH+LOW)/(4);VARC:=LLV(LOW,34);VARD:=HHV(HIGH,34);VARE:=(EMA(((VARB-VAR1)/(VAR5-VAR1))*(100),7))*(T1);VARF:=(EMA((0.667)*(REF(VARE,1))+(0.333)*(VARE),5))*(T1);DRAWTEXT(IF(((COUNT((CLOSE&lt;REF(CLOSE,1)),8))/(8)&gt;0.6) AND (VOL&gt;=(1.5)*(MA(VOL,5))) AND COUNT((VARE&gt;=VARF),3) AND (REF(LOW,1)=LLV(LOW,120)),1,0),LOW,&#39;●买进&#39;),COLORFF00FF;DRAWTEXT(IF(((COUNT((CLOSE&lt;REF(CLOSE,1)),13))/(13)&gt;0.6) AND COUNT((VARE&gt;VARF),6) AND (REF(LOW,5)=LLV(LOW,120)) AND REF((CLOSE&gt;=OPEN),4) AND REF((CLOSE&gt;OPEN),3) AND REF((CLOSE&gt;OPEN),2) AND REF((OPEN&gt;CLOSE),1) AND (OPEN&gt;REF(CLOSE,1)),1,0),LOW,&#39;●买进&#39;),COLOR00FFFF;VAR10:=(MA(CLOSE,80)-(MA(CLOSE,10))/(3))*(T1);DRAWTEXT(IF((CLOSE&lt;VAR10) AND ((VOL)/(240)&gt;(MA(VOL,5))/(240)) AND (CLOSE&gt;(REF(CLOSE,1))*(1.08)) AND (CLOSE&lt;(MA(CLOSE,13))*(1.3)),1,0),LOW,&#39;●抄底&#39;),COLOR0000FF;蛟龙出水配套指标AR1:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR2:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR3:=SUM(VAR1,5);VAR4:=SUM(VAR2,5);VAR5:=IF(VAR3&gt;VAR4,(VAR3-VAR4)/VAR3,IF(VAR3=VAR4,0,(VAR3-VAR4)/VAR4)); VAR6:=MA(VAR5,5);VAR8:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR9:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1))); VARA:=SUM(VAR8,3);VARB:=SUM(VAR9,3);VARC:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)); VARD:=MA(VARC,3);火: BARSLAST(EMA(CLOSE,5)&lt;REF(EMA(CLOSE,5),1)), COLORRED;VARE:=HHV(CLOSE,2);VARF:=BARSLAST(VARE&lt;REF(VARE,2));VAR10:=IF(VARF&gt;=1,LLV(VARE,VARF),LOW);VAR11:=VAR10+VAR10*VARF*0.5/100;VAR12:=IF(VAR11&lt;REF(VAR11,1),MA(LOW,3),VAR11);VAR13:=VAR10+VAR10*(VARF-1)*1.618/100;山: COUNT(EMA(CLOSE,5)&gt;REF(EMA(CLOSE,5),1),5);VAR14:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR15:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR16:=SUM(VAR8,3);VAR17:=SUM(VAR9,3);VAR18:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR19:=MA(VARC,3);买入或持股: STICKLINE(山&gt;0,火,0,2,0), COLORRED;VAR1A:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR1B:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR1C:=SUM(VAR8,3);VAR1D:=SUM(VAR9,3);VAR1E:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR1F:=MA(VARC,3);下跌→抛出: STICKLINE(山&gt;0,火,山,2,1), COLORF0F000;VAR20:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR21:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR22:=SUM(VAR8,3);VAR23:=SUM(VAR9,3);VAR24:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR25:=MA(VARC,3);观望: STICKLINE(山=0 AND 火=0,0,1,4,1), COLORBLUE;VAR26:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR27:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR28:=SUM(VAR8,3);VAR29:=SUM(VAR9,3);VAR2A:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR2B:=MA(VARC,3);植被: STICKLINE(山&lt;火,火,山,1,0), COLOR00FF00;VAR2C:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR2D:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR2E:=SUM(VAR8,3);VAR2F:=SUM(VAR9,3);VAR30:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR31:=MA(VARC,3);VAR32:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*10;K: SMA(SMA(VAR32,2,1),2,1),COLOR00FF00 ;D: SMA(SMA(SMA(VAR32,2,1),2,1),3,1), COLORYELLOW;J: (3*SMA(SMA(VAR32,2,1),2,1)-2*SMA(SMA(SMA(VAR32,2,1),2,1),3,1)), COLORF00FF0;VAR33:=IF(OPEN&lt;=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));VAR34:=IF(OPEN&gt;=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));VAR35:=SUM(VAR8,3);VAR36:=SUM(VAR9,3);VAR37:=IF(VARA&gt;VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB)) ;VAR38:=MA(VARC,3);STICKLINE(REF(山,1)=0 AND 山&gt;0,0,-1,2,0), COLORRED;DRAWTEXT(REF(火,3)&gt;0 AND REF(火,2)&gt;0 AND REF(火,1)&gt;0 AND 火=0 AND REF(火,1)&gt;山,REF(火,1),&#39;调整&#39;),COLORYELLOW ;龙十一万Q2:=(CLOSE-LLV(LOW, 18))/(HHV(HIGH, 18)-LLV(LOW, 18))*100;Q3:=SMA(Q2, 9, 1);Q4:=SMA(Q3, 3, 1);短期趋势:3*Q3-2*Q4,COLORWHITE,LINETHICK3;中期趋势:EMA(Q3, 3),COLORRED,LINETHICK3;DRAWTEXT(CROSS(中期趋势, 短期趋势) AND REF(短期趋势,1)&gt;80, REF(短期趋势,3), &#39;▼逢高派发&#39;), COLOR00FF00,LINETHICK5;▲逢低关注: DRAWTEXT(REF(CROSS(中期趋势,短期趋势),82) AND 中期趋势&gt;1.3*短期趋势,短期趋势,&#39;▲逢低关注&#39;), COLOR00FFFF, LINETHICK1;▲抄底: DRAWTEXT(REF(CROSS(短期趋势,中期趋势),1) AND 短期趋势&gt;1.3*中期趋势,中期趋势,&#39;▲抄底&#39;),COLORBLUE,LINETHICK1;VAR3:=PEAKBARS(3,5,1)&lt;10;VAR5:=IF(VAR3=1,2,0);顶:= IF(VAR5=2,2,0);顶A:IF(顶&gt;REF(顶,1),50,0),COLORGREEN, LINETHICK2;DRAWTEXT(顶A=50,45,&#39;小心&#39;),COLOR00FF00;敢死队-领头羊领头羊}ZF:=DYNAINFO(14)*100;{涨幅}LB:=DYNAINFO(17);{量比}HS:=DYNAINFO(37)*100;{换手}ZJ:=AMOUNT/10000;{资金}TM:=V-MA(V,10);{量填满}ZF&gt;=2 AND ZF&lt;=5 AND LB&gt;=2 AND ZJ&gt;=500 AND HS&gt;1 AND TM&gt;0;波段绝杀波段线:ZIG(3,10),COLORWHITE;涨:IF(波段线&gt;REF(波段线,1),波段线,DRAWNULL),COLORMAGENTA,LINETHICK2;跌:IF(波段线&lt;REF(波段线,1),波段线,DRAWNULL),COLORCYAN;波涨天数:=BARSLASTCOUNT(波段线&gt;REF(波段线,1)),NODRAW;VAR1:=(C-REF(C,波涨天数))/REF(C,波涨天数)*100;涨幅%:IF(波涨天数&gt;0,VAR1, DRAWNULL),NODRAW;波跌天数:BARSLASTCOUNT(波段线&lt;REF(波段线,1)),NODRAW;VAR2:=(C-REF(C,波跌天数))/REF(C,波跌天数)*100;跌幅%:IF(波跌天数&gt;0,VAR2, DRAWNULL),NODRAW;换手率:=VOL/CAPITAL*100,NODRAW;多头:IF(波涨天数&gt;=0,SUM(换手率,波涨天数+1),DRAWNULL),COLORRED;空头:IF(波跌天数&gt;=0,SUM(换手率,波跌天数+1),DRAWNULL),COLORGREEN; DRAWTEXT(CROSS(多头,空头),REF(空头,1)/1.1,&#39;买&#39;),COLORRED; DRAWTEXT(CROSS(空头,多头),REF(多头,1)/1.1,&#39;卖&#39;),COLORGREEN;鼎端选股器AA05:=MA(C,5);五日乖离率:=(C-AA05)/AA05*100;AA30:=MA(C,30);三拾日乖离率:=(C-AA30)/AA30*100;MR:=COUNT(CROSS(五日乖离率,0),3)&gt;=1 AND 三拾日乖离率&gt;REF(三拾日乖离率,1) AND AA05&gt;REF(AA05,1) AND (C/REF(C,1)-1)*100&gt;5 AND REF(C,1)&lt;AA30;买入:IF(FILTER(MR,10),1,0);翻倍黑马选股器MA1:=MA(CLOSE,20);MA2:=MA(CLOSE,40);MA3:=MA(CLOSE,60);{A1:=(OPEN&lt;MA1 AND OPEN&lt;MA2)OR A2:=(OPEN&lt;MA2 AND OPEN&lt;MA3)};A1:=OPEN&lt;MA1 OR OPEN&lt;MA2 OR OPEN&lt;MA3;A2:=C&gt;MAX(MA1,MAX(MA2,MA3));A3:=V/MA(V,30)&gt;1.2;A4:=C/REF(C,1)&gt;1.049;TJ:A1 AND A2 AND A3 AND A4;龙十一万2:=(CLOSE-LLV(LOW, 18))/(HHV(HIGH, 18)-LLV(LOW, 18))*100;Q3:=SMA(Q2, 9, 1);Q4:=SMA(Q3, 3, 1);短期趋势:3*Q3-2*Q4,COLORWHITE,LINETHICK3;中期趋势:EMA(Q3, 3),COLORRED,LINETHICK3;DRAWTEXT(CROSS(中期趋势, 短期趋势) AND REF(短期趋势,1)&gt;80, REF(短期趋势,3), &#39;▼逢高派发&#39;), COLOR00FF00,LINETHICK5;▲逢低关注: DRAWTEXT(REF(CROSS(中期趋势,短期趋势),82) AND 中期趋势&gt;1.3*短期趋势,短期趋势,&#39;▲逢低关注&#39;), COLOR00FFFF, LINETHICK1;▲抄底: DRAWTEXT(REF(CROSS(短期趋势,中期趋势),1) AND 短期趋势&gt;1.3*中期趋势,中期趋势,&#39;▲抄底&#39;),COLORBLUE,LINETHICK1;VAR3:=PEAKBARS(3,5,1)&lt;10;VAR5:=IF(VAR3=1,2,0);顶:= IF(VAR5=2,2,0);顶A:IF(顶&gt;REF(顶,1),50,0),COLORGREEN, LINETHICK2;DRAWTEXT(顶A=50,45,&#39;小心&#39;),COLOR00FF00;蹦级线蹦极线:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100,COLORYELLOW;超跌:-15.000,COLORWHITE;中度超跌:-20.000,COLORRED;严重超跌:-25.000,COLORGREEN;大盘诊断器大盘心脉:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100,COLORYELLOW;弱支撑:-5.000,COLORWHITE;强支撑:-9.000,COLORRED;大底:-12.000,COLORGREEN;百日就翻番A1:=3*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)-2*EMA((C-LLV(L,30))/(HHV(H ,30)-LLV(L,30))*100,5);A2:=LLV(L,21);A3:LLV(L,30);A4:=EMA(A1,5);A5:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34))*100;A6:MA(C,20);百日就翻番选股器A1:=3*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)-2*EMA((C-LLV(L,30))/(HHV(H ,30)-LLV(L,30))*100,5);A4:=EMA(A1,5);A5:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34))*100;DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA :=EMA(DIFF,9);建仓AA:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*1000;BB:=MA(AA,10);趋势线:=SMA(BB,3,1)/10;JNYY2:=(((CLOSE - LLV(LOW,26)) / (HHV(HIGH,26) - LLV(LOW,26))) * 100); 判断:=SMA(JNYY2,32,1)-20;建仓:CROSS(判断,趋势线);。

相关文档
最新文档