以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  请老师帮忙修改成金字塔可用  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=171466)

--  作者:lgxyp
--  发布时间:2019/8/5 17:35:45
--  请老师帮忙修改成金字塔可用
中区:0,COLORBLUE,NODRAW;
DIFF1: EMA(C,12) - EMA(C,26),COLOR0000FF,LINETHICK2;
DEA1: EMA(DIFF1,9),COLORC08000,LINETHICK2;
 
MACD :2*(DIFF1-DEA1), COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIFF1,DEA1),1));
A2:=BARSLAST(REF(CROSS(DEA1,DIFF1),1));
底背离:=REF(C,A1+1)>C AND DIFF1>REF(DIFF1,A1+1) AND CROSS(DIFF1,DEA1);
STICKLINE(底背离,0,DEA1,5.33,0),COLOR00FF00;
DRAWTEXT(底背离,DEA1,\' 底背离\'),COLOR00FFFF;
顶背离:=REF(C,A2+1)<C AND REF(DIFF1,A2+1)>DIFF1 AND CROSS(DEA1,DIFF1);
STICKLINE(顶背离,0,DEA1,5.33,0),COLOR00FF00;
DRAWTEXT(顶背离,DEA1,\' 顶背离\'),COLOR00FF00;
B1:=REF(C,A1+1)>C AND REF(DIFF1,A1+1)<DIFF1 AND CROSS(DIFF1,DEA1);
C1:=BARSLAST(REF(CROSS(DEA1,DIFF1),1));
D1:=REF(C,C1+1)<C AND REF(DIFF1,C1+1)>DIFF1 AND CROSS(DEA1,DIFF1);
PARTLINE(DEA1>MA(DEA1,2),DEA1),COLOR00FFFF,LINETHICK2;
PARTLINE(DIFF1<REF(DIFF1,1),DIFF1),COLOR008000,LINETHICK2;

VAR3:=(C-MA(C,6))/MA(C,6)*100; 
VAR4:=(C-MA(C,24))/MA(C,24)*100; 
VAR5:=(C-MA(C,32))/MA(C,32)*100; 
VAR6:=(VAR3+VAR4+VAR5)/3; 
VAR7:=EMA(VAR6,5); 
指标: EMA(EMA(VAR3,5),5)*3, COLORSTICK,NODRAW; 
VAR8:=IF(VAR6<=-20,10,0); 
VAR9:=HHV(VAR8,10); 
STICKLINE(VAR8=10,20,10,5,0),COLORFF6666; 
VARA:=IF(VAR9 AND CROSS(MA(C,3),MA(C,5)),20,0); 
换手: V/1*200,COLORGREEN,NODRAW; 
 

DRAWTEXT(VARA=20,((MACD)*2.5),\'底部\'),LINETHICK1,COLORWHITE; 
STICKLINE((VARA=20),0,0.4,5,0),COLORWHITE; 
VARC:=(ZIG(L,3.00,5.00)>REF(ZIG(L,3.00,5.00),1)) AND (REF(ZIG(L,3.00,5.00),1)<=REF(ZIG(L,3.00,5.00),2)) AND (REF(ZIG(L,3.00,5.00),2)<=REF(ZIG(L,3.00,5.00),3));
VARD:=(ZIG(H,3.00,5.00)<REF(ZIG(H,3.00,5.00),1)) AND (REF(ZIG(H,3.00,5.00),1)>=REF(ZIG(H,3.00,5.00),2)) AND (REF(ZIG(H,3.00,5.00),2)>=REF(ZIG(H,3.00,5.00),3));
STICKLINE((VARC=1),-((MACD)*2.5),0,4,0),COLOR0000FF,LINETHICK4;  
DRAWTEXT((VARC=1),-((MACD)*2.6),\'买\'),COLOR0000FF;
STICKLINE((VARD=1),((MACD)*2.5),0,4,0),COLOR00FF00,LINETHICK4; 
DRAWTEXT((VARD=1),((MACD)*2.6),\'卖\'),COLOR00FF00; 
VARE:=MA(100*(C-LLV(C,34))/(HHV(H,34)-LLV(L,34)),5)-20; 
VARF:=100-3*SMA((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1)+2*SMA(SMA 
((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1),15,1); 
VAR10:=100-3*SMA((O-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1)+2*SMA(SMA 
((O-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1),15,1); 
VAR11:=VARF<REF(VAR10,1) AND V>REF(V,1) AND C>REF(C,1); 
DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,((MACD)*2.5),\'金\'),COLOR00FFFF,LINETHICK7; 
STICKLINE(VAR11 AND COUNT(VAR11,30)=1,0,((MACD)*2.5),5,0),COLOR00FFFF,LINETHICK7; 
VAR12:=(H+L+C)/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:=(C-MA(C,13))/MA(C,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,-((MACD)*2.6),\'出\'),LINETHICK1,COLOR66CCFF; 
STICKLINE(VAR1C AND COUNT(VAR1C,30)=1,0,-((MACD)*2.5),5,0),COLOR66CCFF,LINETHICK4;


--  作者:wenarm
--  发布时间:2019/8/5 21:09:01
--  
请提供zig函数的参数说明。
--  作者:lgxyp
--  发布时间:2019/8/6 11:13:31
--  
参数不作调整,可根据品种不同而变动。是单日振幅度的系数。
[此贴子已经被作者于2019/8/6 11:15:12编辑过]