以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (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=183564) |
-- 作者:TRADE580 -- 发布时间:2020/12/22 15:41:51 -- [求助]老师好,麻烦帮忙转换一个文华的公式 以下是文华的代码,转换成金字塔的 DK:=MA(C,10); ZN:=MA(C,20); //均线交叉波段 JC1:=CROSS(DK,ZN); SC1:=CROSSDOWN(DK,ZN); N11:=BARSLAST(JC1)+1; N21:=BARSLAST(SC1)+1; HH1:=BACKSET(REFX(SC1,1)||ISLASTBAR,HHVBARS(H,N11)+1); LL1:=BACKSET(REFX(JC1,1)||ISLASTBAR,LLVBARS(L,N21)+1); DRAWLINE1(CROSS(LL1,0.001),L,CROSS(HH1,0.001),H,0),COLORGRAY,DOT; DRAWLINE1(CROSS(HH1,0.001),H,CROSS(LL1,0.001),L,0),COLORGRAY,DOT; LL:=CROSS(LL1,0.001); HH:=CROSS(HH1,0.001); XXX:=LL && L<REF(L,SUMBARS(LL,2)-1) && REF(L,SUMBARS(LL,2)-1)<REF(L,SUMBARS(LL,3)-1) && REF(H,SUMBARS(HH,1)-1)<REF(H,SUMBARS(HH,2)-1); DRAWLINE3(CROSS(LL,0.001)&&XXX,L,0,1,REF(H,SUMBARS(CROSS(HH,0.001),1)-1),SUMBARS(CROSS(HH,0.001),1)-1,0),COLORGREEN,LINETHICK2; XXH:=HH && H>REF(H,SUMBARS(HH,2)-1) && REF(H,SUMBARS(HH,2)-1)>REF(H,SUMBARS(HH,3)-1)&& REF(L,SUMBARS(LL,1)-1)>REF(L,SUMBARS(LL,2)-1); DRAWLINE3(CROSS(HH,0.001)&&XXH,H,0,1,REF(L,SUMBARS(CROSS(LL,0.001),1)-1),SUMBARS(CROSS(LL,0.001),1)-1,0),COLORRED,LINETHICK2;
|
-- 作者:TRADE580 -- 发布时间:2020/12/22 15:50:36 -- 默认波段线用虚线绘制,满足XXX或XXH条件时的波段加粗并上色 |
-- 作者:FireScript -- 发布时间:2020/12/22 16:03:40 -- DK:=MA(C,10); ZN:=MA(C,20); //均线交叉波段 JC1:=CROSS(DK,ZN); SC1:=CROSS(ZN,DK); N11:=BARSLAST(JC1)+1; N21:=BARSLAST(SC1)+1; HH1:=BACKSET(REFX(SC1,1)||ISLASTBAR,HHVBARS(H,N11)+1); LL1:=BACKSET(REFX(JC1,1)||ISLASTBAR,LLVBARS(L,N21)+1); DRAWLINE(CROSS(LL1,0.001),L,CROSS(HH1,0.001),H,0,COLORGRAY,0,vtDASH); DRAWLINE(CROSS(HH1,0.001),H,CROSS(LL1,0.001),L,0,COLORGRAY,0,vtDASH); LL:=CROSS(LL1,0.001); HH:=CROSS(HH1,0.001); // //XXX:=LL && L<REF(L,SUMBARS(LL,2)-1) && REF(L,SUMBARS(LL,2)-1)<REF(L,SUMBARS(LL,3)-1) && REF(H,SUMBARS(HH,1)-1)<REF(H,SUMBARS(HH,2)-1); //DRAWLINE3(CROSS(LL,0.001)&&XXX,L,0,1,REF(H,SUMBARS(CROSS(HH,0.001),1)-1),SUMBARS(CROSS(HH,0.001),1)-1,0),COLORGREEN,LINETHICK2; // // //XXH:=HH && H>REF(H,SUMBARS(HH,2)-1) && REF(H,SUMBARS(HH,2)-1)>REF(H,SUMBARS(HH,3)-1)&& REF(L,SUMBARS(LL,1)-1)>REF(L,SUMBARS(LL,2)-1); //DRAWLINE3(CROSS(HH,0.001)&&XXH,H,0,1,REF(L,SUMBARS(CROSS(LL,0.001),1)-1),SUMBARS(CROSS(LL,0.001),1)-1,0),COLORRED,LINETHICK2; // 注释掉的这部分实现不了。DRAWLINE3 实现的效果无法等效替换。
|
-- 作者:TRADE580 -- 发布时间:2020/12/22 16:54:17 -- 用其他代码能 实现 当 满足XXX或XXH条件时的波段加粗并上色吗 |
-- 作者:FireScript -- 发布时间:2020/12/22 17:08:28 -- 因为是其他软件的函数,所以我们只能先试下看看吧。 |
-- 作者:TRADE580 -- 发布时间:2020/12/22 18:29:41 -- 好的,幸苦了 |