以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (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=172002) |
-- 作者:lgxyp -- 发布时间:2019/9/10 14:21:12 -- 请老师帮忙修改成金字塔可用 Z1:=STRCAT(HYBLOCK,\' \'); Z2:=STRCAT(Z1,DYBLOCK); Z3:=STRCAT(Z2,\' \'); DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0; ZF:=ABS(100*(H-L)/REF(C,1))>3; DIF:=EMA(CLOSE,8)-EMA(CLOSE,13); DEA:=EMA(DIF,6); MACD:=2*(DIF-DEA); 金叉:=CROSS(DIF,DEA); 死叉:=CROSS(DEA,DIF); DIF下拐:=REF(DIF,3)<REF(DIF,2)AND REF(DIF,2)<REF(DIF,1)AND REF(DIF,1)>DIF=REF(DIF,1); MACD下拐:=REF(DIF,3)<REF(DIF,2)AND REF(MACD,2)<REF(MACD,1)AND REF(MACD,1)>MACD=REF(MACD,1); 下拐:=MAX(DIF下拐,MACD下拐); GD1:=EVERY(DIF>REF(DIF,1),BARSLASTCOUNT(DIF>DEA))AND DIF>DEA; GD2:=EVERY(MACD>REF(MACD,1),BARSLASTCOUNT(DIF>DEA))AND DIF>DEA; GD:=MAX(GD1,GD2); 高点1:=REF(MAX(C,O),BARSLAST(GD1)+1); 高点2:=REF(MAX(C,O),BARSLAST(GD2)+1); 高点:=IF(高点2>=高点1,高点2,高点1); AA:=HHV(IF(C>O,C,MAX(C,O)),BARSLASTCOUNT(高点)+1)=HHV(IF(C>O,C,MAX(C,O)),BARSLASTCOUNT(BBI>REF(BBI,1)AND C>BBI)); 压力:DRAWLINE(BARSLAST(AA)=0,IF(C>O,C,MAX(C,O)),BARSNEXT(AA),REF(IF(C>O,C,MAX(C,O)),BARSLAST(AA)),1),DOTLINE,COLORYELLOW; LD1:=EVERY(DIF<REF(DIF,1),BARSLASTCOUNT(DIF<DEA))AND DIF<DEA; LD2:=EVERY(MACD<REF(MACD,1),BARSLASTCOUNT(DIF<DEA))AND DIF<DEA; LD:=MIN(LD1,LD2); 低点1:=REF(MIN(C,O),BARSLAST(LD1)+1); 低点2:=REF(MIN(C,O),BARSLAST(LD2)+1); 低点:=IF(低点2<=低点1,低点1,低点2); BB:=LLV(IF(C<O,C,MIN(C,O)),BARSLASTCOUNT(LD)+1)=LLV(IF(C<O,C,MIN(C,O)),BARSLASTCOUNT(DIF<REF(DIF,1) AND BBI<REF(BBI,1)AND L<BBI)); 支撑:DRAWLINE(BARSLAST(BB)=0,IF(C<O,C,MIN(C,O)),BARSNEXT(BB),REF(IF(C<O,C,MIN(C,O)),BARSLAST(BB)),1),DOTLINE,COLORGREEN; PP1:=BARSLAST(AA)=1; YLX:=REF(MAX(C,O),BARSLAST(PP1)+1); 突破:CROSS(C,YLX),NODRAW,COLORWHITE; STICKLINE(突破,C,O,2,0),COLORWHITE; DIF突破:=REF(DIF,BARSLAST(PP1)+1); 有效突破:=突破 AND DIF>DIF突破; {STICKLINE(有效突破,C,O,2,0),COLORYELLOW}; PP2:=BARSLAST(BB)=1; ZCX:=REF(MIN(C,O),BARSLAST(PP2)+1); 破位:CROSS(ZCX,C),NODRAW,COLORLIGREEN; STICKLINE(破位,C,O,2,0),COLORLIGREEN; PP7:=BARSLAST(破位)=1; 破位K线:=REF(O,BARSLAST(PP7)+1); 突破破位:CROSS(C,破位K线),NODRAW,COLORLIMAGENTA; STICKLINE(突破破位 AND C>O AND MACD>REF(MACD,1),C,O,2,0),COLORLIMAGENTA; 六十天高点:=HHV(C,1)=HHV(C,60),NODRAW,COLORMAGENTA; 历史新高:=HHV(C,1)=HHV(C,0),NODRAW,COLORRED; 六十天低点:=MIN(O,C)<=LLV(MIN(O,C),60)NODRAW,COLORCYAN; 历史新低:=LLV(MIN(O,C),1)=LLV(MIN(O,C),0),NODRAW,COLORBLUE; STICKLINE(六十天高点 AND C>O,C,O,2,0),COLORMAGENTA; STICKLINE(六十天高点 AND C<O,O,(C+O)/2,2,0),COLORGREEN; STICKLINE(六十天高点 AND C<O,C,(C+O)/2,2,0),COLORMAGENTA; STICKLINE(六十天低点 AND C<O,C,O,2,0),COLORGREEN; STICKLINE(六十天低点 AND C>O,C,(C+O)/2,2,0),COLORMAGENTA; STICKLINE(六十天低点 AND C>O,O,(C+O)/2,2,0),COLORGREEN; STICKLINE(历史新高 AND C>O,C,O,2,0),COLORRED; STICKLINE(历史新高 AND C<O,O,(C+O)/2,2,0),COLORBLUE; STICKLINE(历史新高 AND C<O,C,(C+O)/2,2,0),COLORRED; STICKLINE(历史新低 AND C<O,C,O,2,0),COLORBLUE; STICKLINE(历史新低 AND C>O,C,(C+O)/2,2,0),COLORRED; STICKLINE(历史新低 AND C>O,O,(C+O)/2,2,0),COLORBLUE; 六十天压力:DRAWLINE(BARSLAST(六十天高点)=0,C,BARSNEXT(六十天高点),REF(C,BARSLAST(六十天高点)),1),DOTLINE,COLORMAGENTA; 历史压力:DRAWLINE(BARSLAST(历史新高)=0,C,BARSNEXT(历史新高),REF(C,BARSLAST(历史新高)),1),DOTLINE,COLORRED; 六十天支撑:DRAWLINE(BARSLAST(六十天低点)=0,MIN(C,O),BARSNEXT(六十天低点),REF(MIN(C,O),BARSLAST(六十天低点)),1),DOTLINE,COLORCYAN; 历史支撑:DRAWLINE(BARSLAST(历史新低)=0,MIN(C,O),BARSNEXT(历史新低),REF(MIN(C,O),BARSLAST(历史新低)),1),DOTLINE,COLORLIBLUE; 六十天前高:=六十天高点 AND REF(C,1)<C AND C>REFX(C,1); PP3:=BARSLAST(六十天前高)=1; 六十天前高点:=REF(C,BARSLAST(PP3)+1); 突破60天压力:CROSS(C,六十天前高点)NODRAW,COLORMAGENTA; 历史前高:=历史新高 AND REF(C,1)<C AND C>REFX(C,1); PP4:=BARSLAST(历史前高)=1; 历史高点:=REF(C,BARSLAST(PP4)+1); 突破历史压力:CROSS(C,历史高点)NODRAW,COLORRED; PP5:=BARSLAST(六十天低点)=1; 破60天低点:CROSS(REF(C,BARSLAST(PP5)+1),C)NODRAW,COLORGREEN; PP6:=BARSLAST(历史新低)=1; 破历史新低:CROSS(REF(C,BARSLAST(PP6)+1),C)NODRAW,COLORBLUE; 实体:=(C-O)/C=HHV((C-O)/C,15); 阳15:=C>O AND VOL>=HHV(VOL,15); 单阳:(C>REF(C,1)*1.035 OR 实体)AND C>O AND (阳15 OR VOL>REF(VOL,1)*1.9),NODRAW,COLORYELLOW; DRAWTEXT(CURRBARSCOUNT<100 AND 单阳,L*0.991,\'阳\'),COLOR00FFFF; STICKLINE(单阳,O,C,2,0),COLOR00FFFF; 高不破价:=REF(C,BARSLAST(单阳)); 低不破价:=REF(O,BARSLAST(单阳)); 单阳不破:=CURRBARSCOUNT<100 AND BARSLAST(单阳)<11 AND LLV(C,BARSLAST(单阳))>=低不破价; STICKLINE(单阳不破,低不破价,低不破价,4,0),COLORGREEN; STICKLINE(单阳不破,高不破价,高不破价,4,0),COLORWHITE; DRAWTEXT(BARSLAST(单阳)=01 AND 单阳不破,低不破价*0.99,\'1\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=02 AND 单阳不破,低不破价*0.99,\'2\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=03 AND 单阳不破,低不破价*0.99,\'3\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=04 AND 单阳不破,低不破价*0.99,\'4\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=05 AND 单阳不破,低不破价*0.99,\'5\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=06 AND 单阳不破,低不破价*0.99,\'6\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=07 AND 单阳不破,低不破价*0.99,\'7\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=08 AND 单阳不破,低不破价*0.99,\'8\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=09 AND 单阳不破,低不破价*0.99,\'9\'),COLORLIGRAY; DRAWTEXT(BARSLAST(单阳)=10 AND 单阳不破,低不破价*0.99,\'10\'),COLORLIGRAY; PP8:=BARSLAST(单阳不破)=0; ZCX1:=REF(低不破价,BARSLAST(PP8)+1); 破单阳:=CROSS(ZCX1,C),NODRAW,COLORLIGREEN; STICKLINE(破单阳,C,O,2,0),COLORLIGREEN; DRAWTEXT_FIX(C>O,0.01,0.9,0,\' WWW.CXH99.COM \'),COLORRED; DRAWTEXT_FIX(C>O,1,1,0,\'程序化交易模型\'),COLORRED;
|
-- 作者:FireScript -- 发布时间:2019/9/10 14:39:22 -- 尝试了下,里面有部分关键函数无法等效转换到金字塔里面用。单独写代码也没办法实现这个函数的效果。抱歉了。 |