以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  为什么编译会说底背离DAY未定义?  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=170997)

--  作者:OscarDeng
--  发布时间:2019/7/11 19:35:36
--  为什么编译会说底背离DAY未定义?

DIFFDAY:STKINDI(\'SH000001\',\'MACDViolate.DIFF(12,26,9)\',0,6,-1);
DIFF60MIN:STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,5,-1);
DIFF15MIN:STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,3,-1);
DIFF5MIN:STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,2,-1);
DIFF1MIN:STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,1,-1);
DEA1MIN:STKINDI(\'SH000001\',\'MACDVIOLATE.DEA(12,26,9)\',0,1,-1);
//POSITIVEV 代表底背离POSITIVE VIOLATION
底背离5MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,2,-1);
底背离5MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,2,-1);
底背离5MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,2,-1);
底背离5MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,2,-1);
底背离5MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,2,-1);

底背离15MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,3,-1);
底背离15MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,3,-1);
底背离15MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,3,-1);
底背离15MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,3,-1);
底背离15MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,3,-1);

底背离60MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,5,-1);
底背离60MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,5,-1);
底背离60MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,5,-1);
底背离60MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,5,-1);
底背离60MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,5,-1);

底背离DAY1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,6,-1);
底背离DAY2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,6,-1);
底背离DAY3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,6,-1);
底背离DAY4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,6,-1);
底背离DAY5:=STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,6,-1);

底背离5MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,2,-1);
底背离15MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,3,-1);
底背离60MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,5,-1);
底背离DAY:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,6,-1);

POSITIVE5MIN:底背离5MIN||底背离15MIN||底背离60MIN||底背离DAY;
POSITIVE15MIN:底背离5MIN2||底背离5MIN3||底背离5MIN4||底背离5MIN5||底背离15MIN||底背离60MIN||底背离DAY;
POSITIVE60MIN:底背离5MIN5||底背离15MIN2||底背离15MIN3||底背离15MIN4||底背离15MIN5||底背离60MIN||底背离DAY;
POSITIVEDAY:底背离15MIN4||底背离15MIN5||底背离60MIN2||底背离60MIN3||底背离60MIN4||底背离60MIN5||底背离DAY;
POSITIVEDAY2:底背离DAY5||底背离DAY4||底背离DAY3||底背离DAY2;


--  作者:FireScript
--  发布时间:2019/7/12 9:33:30
--  
名称改下就行了。
底背离DAY” 后面带这个day 导致的。编译器识别成某种函数了。

--  作者:OscarDeng
--  发布时间:2019/7/12 12:38:50
--  还有一个为什么POSITIVE5MIN, DIFF60MIN 等这些都能显示出来, 但是底背离1MIN 到 底背离PV60MIN 都显示不出来

还有一个为什么POSITIVE5MINDIFF60MIN 等这些都能显示出来, 但是底背离1MIN 到 底背离PV60MIN 都显示不出来, 把底背离三个字换成PV后也照样显示不出来数值, 就是了个是什么原因?  连AA也显示不出数值

 


DIFFDAY:=STKINDI(\'SH000001\',\'MACDViolate.DIFF(12,26,9)\',0,6,-1);
DIFF60MIN:=STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,5,-1);
DIFF15MIN:=STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,3,-1);
DIFF5MIN:=STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,2,-1);
DIFF1MIN:=STKINDI(\'SH000001\',\'MACDVIOLATE.DIFF(12,26,9)\',0,1,-1);
DEA1MIN:=STKINDI(\'SH000001\',\'MACDVIOLATE.DEA(12,26,9)\',0,1,-1);
//POSITIVEV 代表底背离POSITIVE VIOLATION,PV
PV5MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,2,-1);
PV5MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,2,-1);
PV5MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,2,-1);
PV5MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,2,-1);
PV5MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,2,-1);

PV15MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,3,-1);
PV15MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,3,-1);
PV15MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,3,-1);
PV15MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,3,-1);
PV15MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,3,-1);

PV60MIN1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,5,-1);
PV60MIN2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,5,-1);
PV60MIN3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,5,-1);
PV60MIN4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,5,-1);
PV60MIN5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,5,-1);

PVDAY1:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离1(12,26,9)\',0,6,-1);
PVDAY2:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离2(12,26,9)\',0,6,-1);
PVDAY3:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离3(12,26,9)\',0,6,-1);
PVDAY4:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离4(12,26,9)\',0,6,-1);
PVDAY5:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离5(12,26,9)\',0,6,-1);

PV5MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,2,-1);
PV15MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,3,-1);
PV60MIN:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,5,-1);
PVDAY6:STKINDI(\'SH00001\',\'MACDVIOLATE.底背离(12,26,9)\',0,6,-1);

POSITIVEV5MIN:=PV5MIN||PV15MIN||PV60MIN||PVDAY6;
POSITIVEV15MIN:=PV5MIN2||PV5MIN3||PV5MIN4||PV5MIN5||PV15MIN||PV60MIN||PVDAY6;
POSITIVEV60MIN:=PV5MIN5||PV15MIN2||PV15MIN3||PV15MIN4||PV15MIN5||PV60MIN||PVDAY6;
POSITIVEVDAY:=PV15MIN4||PV15MIN5||PV60MIN2||PV60MIN3||PV60MIN4||PV60MIN5||PVDAY6;
POSITIVEVDAY2:=PVDAY5||PVDAY4||PVDAY3||PVDAY2;
AA:PV5MIN1;


--  作者:FireScript
--  发布时间:2019/7/12 13:22:37
--  
 MACDVIOLATE.底背离1(12,26,9)


MACDVIOLATE这个指标里面有变量底背离1吗?另外你调用的品种有对应周期的数据吗?因为你调用的多个周期的数据,被调用的品种必须有这个周期的数据才行。
[此贴子已经被作者于2019/7/12 13:25:31编辑过]

--  作者:OscarDeng
--  发布时间:2019/7/12 16:06:01
--  调用的函数是有的
当然有这个函数和值, 不然肯定会说调用错误的!
--  作者:OscarDeng
--  发布时间:2019/7/12 16:15:25
--  

而且看附件可以看到被调用的函数是可以显示那些数值的,“底背离1”


图片点击可在新窗口打开查看此主题相关图片如下:qq图片20190712160812.png
图片点击可在新窗口打开查看

--  作者:wenarm
--  发布时间:2019/7/12 16:35:28
--  

1.跨周期引用的操作,被引用的公式是一个副本运行的,和你把被引用公式,加载到图表中使用的数据量时不一样的。

 

你上面没有结果,可能是因为数量量不足,你把k线加载扩充到30天以上之后再看。

[此贴子已经被作者于2019/7/12 16:35:36编辑过]

--  作者:OscarDeng
--  发布时间:2019/7/12 21:55:32
--  我用下面语句调用下面的技术指标, 同样的, DEA1MIN 就可以显示, 但是CC就显示不出来,

我自己也做了个测试, 我用下面语句调用下面的技术指标, 同样的, DEA1MIN 就可以显示, 但是CC就显示不出来, 不会是逻辑判断语句就不允许显示出来吧?  在文华8从来不会出现这些问题。 但是用了金字塔后发现很多莫名奇怪的原因。

DEA1MIN:STKINDI(\'SH000001\',\'test1.DEA(12,26,9)\',0,1,-1);
PV5MIN1:STKINDI(\'SH00001\',\'test1.CC(12,26,9)\',0,1,-1);

 

被调用技术指标

DIFF :EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA  :EMA(DIFF,M);
MACD:2*(DIFF-DEA),COLORSTICK;
MACDMAX:=MAX(C,O);
MACDMIN:=MIN(C,O);
MACDL:=LLV(MACDMIN,7);//8周期内最低收盘价

DIFFL:=(LLV(DIFF,7)+REF(DIFF,LLVBARS(DIFF,7)-1)+REF(DIFF,LLVBARS(DIFF,7)+1))/3;//4天到8周期的最低DIFF
GTMIN:=DEA>REF(DEA,1) AND REF(DEA,1)<REF(DEA,2) && DEA<0;//找DEA是最低的
A1:=BARSLAST(REF(GTMIN,1));//A1底背离,最低转折点到今天的周期数, 转折点单根K线为0
A2:=A1+REF(A1,A1+1);
A3:=A2+REF(A1,A2+2);
A4:=A3+REF(A1,A3+3);
A5:=A4+REF(A1,A4+4);
IGNOREMIN1:=ABS( REF(DIFFL,A1+1)/DIFFL/( MACDL/REF(MACDL,A1+1)) )>1.06;
IGNOREMIN2:=ABS( REF(DIFFL,A2+1)/DIFFL/( MACDL/REF(MACDL,A2+1)) )>1.06;
IGNOREMIN3:=ABS( REF(DIFFL,A3+1)/DIFFL/( MACDL/REF(MACDL,A4+1)) )>1.06;
IGNOREMIN4:=ABS( REF(DIFFL,A4+1)/DIFFL/( MACDL/REF(MACDL,A4+1)) )>1.06;
IGNOREMIN5:=ABS( REF(DIFFL,A5+1)/DIFFL/( MACDL/REF(MACDL,A5+1)) )>1.06;
CC:(REF(MACDL,A1+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A1+1))>=0 AND GTMIN AND IGNOREMIN1;


--  作者:OscarDeng
--  发布时间:2019/7/12 22:12:58
--  从图上可以看出来CC在副图指标是有返回值的,
从图上可以看出来CC在副图指标是有返回值的, 但是DEA1MIN 就有返回值, CC就没有返回值。
--  作者:FireScript
--  发布时间:2019/7/15 9:46:59
--  
 DEA1MIN:STKINDI(\'SH000001\',\'test1.DEA(12,26,9)\',0,1,-1);
PV5MIN1:STKINDI(\'SH00001\',\'test1.CC(12,26,9)\',0,1,-1);

你少了个0吧。