当前位置:牛股网 > 牛股宝 >

将(WR、DMI)同图公式改成同花顺

  • 牛股宝
  • 2020-09-18 09:25
  • 牛股网

编写标准:

编写方式:网民寻求帮助:

求教师将(WR、DMI)同图公式改成大智慧公式

主要参数n:日均线之上可取7或14,分鐘图可取40。

源代码:

{DMI}

MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);

HD :=HIGH-REF(HIGH,1);

LD :=REF(LOW,1)-LOW;

DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);

DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);

PDI: DMP*100/MTR;

MDI: DMM*100/MTR;

DRAWBAND(PDI,RGB(100,0,50),MDI,RGB(256,96,96));

ADX:EXPMEMA((PDI-MDI)/(PDI MDI)*100,N),COLORFF00FF;

ADXR:EXPMEMA(ADX,N/2),COLOR00FF00;

{LTSH}

WR:100-100*(HHV(HIGH,40)-CLOSE)/(HHV(HIGH,40)-LLV(LOW,40)),COLORFFFFFF,LINETHICK2;

见顶:100,COLOR0000FF,LINETHICK2;

见底:0,COLOR00FF00,LINETHICK2;

STICKLINE(WR=100,101,110,5,0),COLOR0000FF;

STICKLINE(WR=0,101,110,5,0),COLOR00FF00;

STICKLINE(WR<100 AND WR>=99,101,110,5,1),COLOR00FFFF;

STICKLINE(WR<=0.6 AND WR>0,101,110,5,0),COLOR00FFFF;

解释以下:

{DMI}

N:=7;

MTR:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);

HD :=HIGH-REF(HIGH,1);

LD :=REF(LOW,1)-LOW;

DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),N);

DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),N);

PDI: DMP*100/MTR;

MDI: DMM*100/MTR;

FILLRGN(PDI,MDI,PDI>MDI,RGB(100,0,50),PDI<MDI,RGB(256,96,96));

ADX:EMA((PDI-MDI)/(PDI MDI)*100,N),COLORFF00FF;

ADXR:EMA(ADX,N/2),COLOR00FF00;

{LTSH}

WR:100-100*(HHV(HIGH,40)-CLOSE)/(HHV(HIGH,40)-LLV(LOW,40)),COLORFFFFFF,LINETHICK2;

见顶:100,COLOR0000FF,LINETHICK2;

见底:0,COLOR00FF00,LINETHICK2;

STICKLINE(WR=100,101,110,5,0),COLOR0000FF;

STICKLINE(WR=0,101,110,5,0),COLOR00FF00;

STICKLINE(WR<100 AND WR>=99,101,110,5,1),COLOR00FFFF;

STICKLINE(WR<=0.6 AND WR>0,101,110,5,0),COLOR00FFFF;

DZH

TDX

  • 关注微信

相关文章

微信公众号