手机端
当前位置:爱约股 > 公式技巧 > 把“峰谷价势”修改成同花顺公式

把“峰谷价势”修改成同花顺公式

看到“壹瓣”大师的“峰谷价势”很好,但其中有几个函数不能直接引用到同花顺中,比如PERIOD和DRAWBAND等,俺是菜鸟不知道在同花顺中用哪个函数替代,求老师帮改一下或告知对应的函数,谢谢!!!
源码:

{峰谷价势 - - 壹瓣杺埖 }
SS:=PERIOD;
自:=100*(HHV(H,6)-C)/(HHV(H,6)-LLV(L,6));
然:=100*(HHV(H,10)-C)/(HHV(H,10)-LLV(L,10));
峰1:=IF(自<50,自+70,120);
DRAWBAND(120,RGB(0,30,250),峰1,RGB(0,30,250));
谷1:=IF(自>50,自-50,0);
DRAWBAND(谷1,RGB(160,88,8),0,RGB(160,88,8));
R9:=IF(SS=2,80,9); RK3:=IF(SS=2,3,9); RD3:=IF(SS=2,10,9);
RSV:=(C-LLV(L,R9))/(HHV(H,R9)-LLV(L,R9))*100;
K:=SMA(RSV,RK3,1); D:=SMA(K,RD3,1); J:=3*K-2*D;
峰2:=IF(然<50,然+70,120);
谷2:=IF(然>50,然-50,0);
CS:=(C-LLV(L,8))/(HHV(H,8)-LLV(L,8))*100;
价:EMA(CS,3)*1.25,COLOR00FFFF,LINETHICK3;
价势:=J*1.1;
DRAWBAND(价,RGB(0,180,220),IF(价>峰2,峰2,价),RGB(0,180,220));
DRAWBAND(价势,RGB(120,8,138),IF(价势<谷1,谷1,价势),RGB(120,8,138));
DRAWBAND(价势,RGB(0,0,130),IF(价势>峰1,峰1,价势),RGB(0,0,130));
DRAWBAND(价,RGB(250,96,96),IF(价<谷2,谷2,价),RGB(250,96,96));
势:EMA((0.668*REF(价势,1)+0.333*价势),1),COLOR00EE00,LINETHICK2;
峰:峰2,COLOR8E00E8,LINETHICK2;
谷:谷2,COLORFFFFFF,LINETHICK2;

 

 

解答如下:

PERIOD:=COUNT(DATE<>REF(DATE,1),2)=2;
SS:=PERIOD;
自:=100*(HHV(H,6)-C)/(HHV(H,6)-LLV(L,6));
然:=100*(HHV(H,10)-C)/(HHV(H,10)-LLV(L,10));
峰1:=IF(自<50,自+70,120);
FILLRGN(120,峰1,120<峰1,RGB(0,30,250),120>峰1,RGB(0,30,250));
谷1:=IF(自>50,自-50,0);
FILLRGN(谷1,0,0<谷1,RGB(160,88,8),0>谷1,RGB(160,88,8));
R9:=IF(SS=2,80,9); RK3:=IF(SS=2,3,9); RD3:=IF(SS=2,10,9);
RSV:=(C-LLV(L,R9))/(HHV(H,R9)-LLV(L,R9))*100;
K:=SMA(RSV,RK3,1); D:=SMA(K,RD3,1); J:=3*K-2*D;
峰2:=IF(然<50,然+70,120);
谷2:=IF(然>50,然-50,0);
CS:=(C-LLV(L,8))/(HHV(H,8)-LLV(L,8))*100;
价:EMA(CS,3)*1.25,COLOR00FFFF,LINETHICK3;
价势:=J*1.1;
FILLRGN(价,峰2,价>峰2,RGB(0,180,220),价<峰2,RGB(0,180,220));
FILLRGN(价势,谷1,价势>谷1,RGB(120,8,138),价势<谷1,RGB(120,8,138));
FILLRGN(价势,峰1,价势>峰1,RGB(0,0,130),价势<峰1,RGB(0,0,130));
FILLRGN(价,谷2,价>谷2,RGB(250,96,96),价<谷2,RGB(250,96,96));
势:EMA((0.668*REF(价势,1)+0.333*价势),1),COLOR00EE00,LINETHICK2;
峰:峰2,COLOR8E00E8,LINETHICK2;
谷:谷2,COLORFFFFFF,LINETHICK2;

分享至:

相关推荐