同花顺趋势轨迹指标公式

 

SHORT:=12;
LONG:=26;
M:=9;
DIFF := EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA_:= EMA(DIFF,M);
macd_ := 2*(DIFF-DEA_),COLORSTICK;
MacD:MACD_,colorwhite;
DIF:DIFF,colorwhite;
DEA:DEA_,coloryellow;
A1:=BArslAST(REF(crOSS(DIFF,DEA_),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA_);
A2:=BARSLAST(REF(CROSS("kdj.K"(9,3,3),"kdJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("rsi.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA_,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA_,DIFF);
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
MACD底背:IF(B1>0,-0.1,0),colorred,POINTDOT;
KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3>0,-0.1,0),coloryellow,POINTDOT;
MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),colorwhite,POINTDOT;
STICKLINE(MACD_>REF(MACD_,1) AND MACD_>0,0,MACD_,0,0),colorred;
STICKLINE(MACD_<=REF(MACD_,1) AND MACD_>0,0,MACD_,0,0),coloryellow;
STICKLINE(MACD_<REF(MACD_,1) AND MACD_<0,0,MACD_,0,0),colorcyan;
STICKLINE(MACD_>=REF(MACD_,1) AND MACD_<0,0,MACD_,0,0),colormagenta;
STICKLINE(C>0,0,0,50,1),colorblue;
PARTLINE(DIFF,DIFF>MA(DIFF,2),colorred,DIFF<MA(DIFF,2),colorwhite);
PARTLINE(DEA_,DEA_>MA(DEA_,2),colormagenta,DEA_<MA(DEA_,2),coloryellow);
A:=REF(DIFF,1)<REF(DIFF,2) AND REF(DIFF,2)<REF(DIFF,3) AND DIFF>REF(DIFF,1);
B:=REF(DIFF,1)>REF(DIFF,2) AND REF(DIFF,2)>REF(DIFF,3) AND DIFF<REF(DIFF,1);
买:IF(CROSS(DIFF,DEA_),DIFF,NULL),CIRCLEDOT,colorred;
卖:IF(CROSS(DEA_,DIFF),DIFF,NULL),CIRCLEDOT,colorgreen;




来函数检测结果如下
该公式没有未来函数


解密、定制、编写公式指标请联系QQ或微信同号:88652583
置顶指标

相关指标公式

SHORT赋值:12
LONG赋值:26
M赋值:9
赋值: 收盘价的SHORT日指数移动平均 - 收盘价的LONG日指数移动平均
DEA_赋值: DIFF的M日指数移动平均
赋值: 2*(DIFF-DEA_),COLORSTICK
输出平滑异同平均线:MACD_,画白色
输出DIF:DIFF,画白色
输出DEA:DEA_,画黄色
A1赋值:上次1日前的DIFF上穿DEA_距今天数
B1赋值:A1+1日前的收盘价>收盘价 AND A1+1日前的DIFFA2赋值:上次1日前的"KDJ的K"(9,3,3)上穿"KDJ的D"(9,3,3)距今天数
B2赋值:A2+1日前的收盘价>收盘价 AND A2+1日前的"KDJ的K"(9,3,3)<"KDJ的K"(9,3,3) AND "KDJ的K"(9,3,3)上穿"KDJ的D"(9,3,3)
A3赋值:上次1日前的"RSI的RSI1"(6,12,24)上穿"RSI的RSI2"(6,12,24)距今天数
B3赋值:A3+1日前的收盘价>收盘价 AND A3+1日前的"RSI的RSI1"(6,12,24)<"RSI的RSI1"(6,12,24) AND "RSI的RSI1"(6,12,24)上穿"RSI的RSI2"(6,12,24)
C1赋值:上次1日前的DEA_上穿DIFF距今天数
D1赋值:C1+1日前的收盘价<收盘价 AND C1+1日前的DIFF>DIFF AND DEA_上穿DIFF
C2赋值:上次1日前的"KDJ的D"(9,3,3)上穿"KDJ的K"(9,3,3)距今天数
D2赋值:C2+1日前的收盘价<收盘价 AND C2+1日前的"KDJ的K"(9,3,3)>"KDJ的K"(9,3,3) AND "KDJ的D"(9,3,3)上穿"KDJ的K"(9,3,3)
C3赋值:上次1日前的"RSI的RSI2"(6,12,24)上穿"RSI的RSI1"(6,12,24)距今天数
D3赋值:C3+1日前的收盘价<收盘价 AND C3+1日前的"RSI的RSI1"(6,12,24)>"RSI的RSI1"(6,12,24) AND "RSI的RSI2"(6,12,24)上穿"RSI的RSI1"(6,12,24)
输出MACD底背:如果B1>0,返回-0.1,否则返回0,画红色,POINTDOT
输出KDJ底背:如果B2>0,返回-0.1,否则返回0,COLORFF00FF,POINTDOT
输出RSI底背:如果B3>0,返回-0.1,否则返回0,画黄色,POINTDOT
输出MACD顶背:如果D1>0,返回0.1,否则返回0,COLOR00FF00,POINTDOT
输出KDJ顶背:如果D2>0,返回0.1,否则返回0,COLORFFCC66,POINTDOT
输出RSI顶背:如果D3>0,返回0.1,否则返回0,画白色,POINTDOT
当满足条件MACD_>1日前的MACD_ANDMACD_>0时,在0和MACD_位置之间画柱状线,宽度为0,0不为0则画空心柱.,画红色
当满足条件MACD_<=1日前的MACD_ANDMACD_>0时,在0和MACD_位置之间画柱状线,宽度为0,0不为0则画空心柱.,画黄色
当满足条件MACD_<1日前的MACD_ANDMACD_<0时,在0和MACD_位置之间画柱状线,宽度为0,0不为0则画空心柱.,画青色
当满足条件MACD_>=1日前的MACD_ANDMACD_<0时,在0和MACD_位置之间画柱状线,宽度为0,0不为0则画空心柱.,画洋红色
当满足条件收盘价>0时,在0和0位置之间画柱状线,宽度为50,1不为0则画空心柱.,画蓝色
[新]条件颜色线
[新]条件颜色线
A赋值:1日前的DIFF<2日前的DIFF AND 2日前的DIFF<3日前的DIFF AND DIFF>1日前的DIFF
B赋值:1日前的DIFF>2日前的DIFF AND 2日前的DIFF>3日前的DIFF AND DIFF<1日前的DIFF
输出买:如果DIFF上穿DEA_,返回DIFF,否则返回NULL,CIRCLEDOT,画红色
输出卖:如果DEA_上穿DIFF,返回DIFF,否则返回NULL,CIRCLEDOT,画绿色

指标安装下载帮助  |   联系我们  |  乐淘公式网  |  公式网   |  指标公式  |   加入收藏   |  设为主页

@2005-2025 浙ICP备2024071487号-1 乐淘公式网公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
免责声明:乐淘公式网所有指标公式及文章由网络收集,不保障实时性和真实性, 仅供学习研究并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。
QQ:88652583 微信 88652583
sitemap站点地图