当前位置:→ 股海网公式帮助 → 正文
  • 通达信指标变色线形的应用

  • 相关简介:通达信指标编辑之:变色线形的应用 一,单线变双色 VAR1:MA(C,30),COLORRED; 上升:IF(VAR1REF(VAR1,1),VAR1,DRAWNULL),COLORRED; 下降:IF(VAR1REF(VAR1,1),VAR1,DRAWNULL),COLORGREEN; 二,单线变三色 VAR1:MA(C,240),COLORRED; 上升:IF(VAR1REF(VAR1,1),VAR1,DRAWNULL),COLORRED; 走平:IF(VAR1=REF(VAR1,1),VA

  • 文章来源:股海网作者:股海网发布时间:2014-04-12浏览次数:下载次数:0

通达信指标编辑之:变色线形的应用
一,单线变双色
VAR1:MA(C,30),COLORRED;
上升:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),COLORRED;
下降:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),COLORGREEN;

二,单线变三色
VAR1:MA(C,240),COLORRED;
上升:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),COLORRED;
走平:IF(VAR1=REF(VAR1,1),VAR1,DRAWNULL),COLORRED;
下降:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),COLORGREEN;

三,技术指标变色
通达信公式中画分段线的方法
例如:KDJ分段线源码:
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),COLORWHITE;
D:SMA(K,3,1),COLORYELLOW;
J:3*K-2*D,COLORYELLOW;
IF(K<REF(K,1),K,DRAWNULL),COLORGREEN,LINETHICK1;
IF(D<REF(D,1),D,DRAWNULL),COLORGREEN,LINETHICK1;
IF(J<REF(J,1),J,DRAWNULL),COLORFFFF00,LINETHICK1;
IF(K>REF(K,1),K,DRAWNULL),COLORRED,LINETHICK1;
IF(D>REF(D,1),D,DRAWNULL),COLORRED,LINETHICK1;
IF(J>REF(J,1),J,DRAWNULL),COLORFF00FF,LINETHICK1;

四,MACD变色
附图公式,变色MACD
DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA1:=EMA(DIF1,9);
MACD1:=2*(DIF1-DEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
DIF:DIF1,COLOR33FF33;
DEA:DEA1,COLORYELLOW;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIF1>=DEA1,DIF1,DRAWNULL),COLORRED,LINETHICK2;

五,变色移动平均线
周:MA(C,5),COLORRED,LINETHICK2;
K1:=BACKSET(周<REF(周,1),2);
IF(K1,周,DRAWNULL),COLOR00CC33,LINETHICK2;
二周:MA(C,10),COLORRED,LINETHICK2;
K2:=BACKSET(二周<REF(二周,1),2);
IF(K2,二周,DRAWNULL),COLOR00CC33,LINETHICK2;
月:MA(C,30),COLOR9933CC,LINETHICK2;
K3:=BACKSET(月<REF(月,1),2);
IF(K3,月,DRAWNULL),COLORFFFFFF,LINETHICK2;
季:MA(C,60),COLORCYAN,LINETHICK1;
K4:=BACKSET(季<REF(季,1),2);
IF(K4,季,DRAWNULL),COLOR00FFFF,LINETHICK1;
半年:MA(C,120),CIRCLEDOT,COLOR6699FF,LINETHICK2;
K5:=BACKSET(半年<REF(半年,1),2);
IF(K5,半年,DRAWNULL),CIRCLEDOT,COLORFFFFCC,LINETHICK2;
年:MA(C,240),COLOR0000FF,CROSSDOT,LINETHICK2;
K6:=BACKSET(年<REF(年,1),2);
IF(K6,年,DRAWNULL),COLOR00FF00,CROSSDOT,LINETHICK2;
二年:MA(C,480),COLOR00FFFF,CROSSDOT,LINETHICK2;
K7:=BACKSET(二年<REF(二年,1),2);
IF(K7,二年,DRAWNULL),COLOR006633,CROSSDOT,LINETHICK3;
三年:MA(C,720),COLORFF00FF,CROSSDOT,LINETHICK2;
K8:=BACKSET(三年<REF(三年,1),2);
IF(K8,三年,DRAWNULL),COLORFF9900,CROSSDOT,LINETHICK2;

六,仿飞狐均线和K线
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);
STICKLINE(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,CLOSE,REF(CLOSE,1),3,1),COLORRED;{红1}
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);
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),3,0),COLORFFCC66;
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),4,1),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,REF(CLOSE,1),REF(CLOSE,2),4,2),COLOR00FF00{98FD};
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR00C8FF;
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2,0),COLOR10ECFF;
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2,0),COLOR10FFFF;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR00D900;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR93FF22;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),0,0),COLOR090FF2;
PMA:MA(C,5),COLORWHITE,LINETHICK2;
IF(PMA>REF(PMA,1),PMA,DRAWNULL),COLORRED,LINETHICK2;
IF(PMA<REF(PMA,1),PMA,DRAWNULL),COLORGREEN,LINETHICK2;
X:=(3*C+L+O+H)/6;
多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)
+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)
+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+
REF(X,20))/210,COLORFF00FF,LINETHICK2;
{用法:黄托底买进,绿压顶买出。}
DD:=多空线<REF(多空线,1);
IF(DD,多空线,DRAWNULL),COLOR00FFFF,LINETHICK2;
A:=(PMA>多空线);
IF(A,多空线,DRAWNULL),COLOR33FF33,POINTDOT,LINETHICK4;
七,变色YJE
AA:=REF(CLOSE,1);
BBB:=SMA(MAX(CLOSE-AA,0),21,1)/SMA(ABS(CLOSE-AA),21,1)*1000;
HHH:=BBB-LLV(BBB,27);
CCC:=LLV(BBB,27)-BBB;
QQ:(MA(HHH,2)*3+HHH*13)/16,COLOR0000FF,LINETHICK1;
SS:(MA(CCC,2)*3+CCC*13)/16,COLORFF00FF,LINETHICK1;
GG:MA(HHH,5),LINETHICK1,COLORGREEN;
MM:MA(CCC,5),LINETHICK1,COLORGREEN;
WW:IF(QQ<GG ,SS,MM),LINETHICK1, COLORCYAN;
EE:IF(SS<MM ,GG,QQ),COLORFFFFCC,LINETHICK1;
S:0,COLOR00FFFF;

补充一句:通达信没有飞狐分段画线函数,也没有分析家的条件画线函数,只好用引用函数中的无效数DRAWNULL这个函数。
[DRAWNULL 无效数
返回无效数。
用法: DRAWNULL
例如: IF(CLOSE>REF(CLOSE,1),CLOSE,DRAWNULL) 表示下跌时分析图上不画线。

 ☟问题反馈 ☞┄┄┄┄┄┄┄┄┄┄→收藏资源:

通达信指标变色线形的应用

  • 下载资源所需积分

    0

  • 当前拥有积分

    0

上传会员: 
股海网
文件大小: 
Bytes
上传时间: 
2014-04-12
下载积分: 
-
免责声明: 
请仔细阅读并同意后才能下载
本附件为用户分享上传,股海网没有对文件进行验证,不能保证下载资源的准确性、安全性和完整性,也不保证下载资源能正常安装和使用,且下载后扣除的积分无法退还,除非您充分理解并完全接受本声明,否则您无权下载。
本站对提供下载的软件、指标、资料等不拥有任何权利,其版权归该下载资源的合法拥有者所有。本附件仅供学习和研究使用,不得用于商业或者非法用途,如有侵犯您的版权, 请参看 《股海网侵权处理流程》《股海网免责声明条款》
点击下载无反应时,更换主流浏览器重新登录操作,如360浏览器、Edge浏览器、谷歌浏览器,个别浏览器有不兼容现象。
勾选以下表示您已经阅读并同意以上声明才能下载本文件,扣除积分无法退还!
我已阅读所有条款规定, 请点我同意 所有条款内容!我自愿下载!
提示:如下载失败,请点关闭刷新此页面或提交问题反馈给管理员→
关闭

关于我们 - 联系我们 - 隐私政策 - 免责声明 - 下载帮助 - 广告合作 - SiteMap - TOP
增值电信业务经营ICP许可证:湘B2-20210269 湘ICP备09016573号-10 湘公网安备43108102000040号
Copyright © 2021 铭网科技,All Rights Reserved.