欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 在调用跨周期的时候,近期或者近两三天的信号就不会出现的?

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有3090人关注过本帖树形打印复制链接

主题:在调用跨周期的时候,近期或者近两三天的信号就不会出现的?

帅哥哟,离线,有人找我吗?
OscarDeng
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:289 积分:0 威望:0 精华:0 注册:2019/4/29 11:42:41
在调用跨周期的时候,近期或者近两三天的信号就不会出现的?  发帖心情 Post By:2019/7/24 21:38:52    Post IP:113.68.192.109[显示全部帖子]

在调用跨周期的时候, 做检测我经常发现在信号从很久以前历史数据到几天前的历史数据都能够有效显示, 但是近期或者近两三天的信号就不会出现的? 我也专门下载了近三天的历史数据, 发现问题还是一直出现, 是什么原因造成的?

 回到顶部
帅哥哟,离线,有人找我吗?
OscarDeng
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:289 积分:0 威望:0 精华:0 注册:2019/4/29 11:42:41
我只是偏离了-1 , 但是不明白为什么为什么DIFF最后变成了直线,没有显示出来。  发帖心情 Post By:2019/7/25 9:54:27    Post IP:116.22.6.35[显示全部帖子]

我只是偏离了-1 , 但是不明白为什么为什么DIFF最后变成了直线,没有显示出来。 看附件, 附图有个MACD背离指标能显示两个底背离, 但是在图表程序化显示不出来。

 

//上证指数
SHDIFFDAY:STKINDI('SH000001','MACDViolate.DIFF(12,26,9)',0,6,-1),noaxis;
SHDIFF60MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,5,-1),noaxis;
SHDIFF15MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,3,-1),noaxis;
SHDIFF5MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,2,-1),noaxis;
SHDIFF1MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,1,-1),noaxis;
SHDEA1MIN:STKINDI('SH000001','MACDVIOLATE.DEA(12,26,9)',0,1,-1),noaxis;
//POSITIVEV, PV 代表底背离POSITIVE VIOLATION, 底背离
//PV 是调用底背离第几次,SHPOSITIVEVDAY是代表底背离的程度
SHPV5MIN1:STKINDI('SH000001','MACDVIOLATE.PV1(12,26,9)',0,2,-1),noaxis;
SHPV5MIN2:STKINDI('SH000001','MACDVIOLATE.PV2(12,26,9)',0,2,-1),noaxis;
SHPV5MIN3:STKINDI('SH000001','MACDVIOLATE.PV3(12,26,9)',0,2,-1),noaxis;
SHPV5MIN4:STKINDI('SH000001','MACDVIOLATE.PV4(12,26,9)',0,2,-1),noaxis;
SHPV5MIN5:STKINDI('SH000001','MACDVIOLATE.PV5(12,26,9)',0,2,-1),noaxis;


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

 回到顶部
帅哥哟,离线,有人找我吗?
OscarDeng
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:289 积分:0 威望:0 精华:0 注册:2019/4/29 11:42:41
我在2018年已经下载了该有的历史数据, 但是分钟级别在2018年根本就显示不出来, 只能显示日线的的信号。 这是为什么?  发帖心情 Post By:2019/7/25 11:25:12    Post IP:116.22.6.35[显示全部帖子]

这个是MACDVIOLATE 的公式,参数你自己设置

 

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周期内最低收盘价

{Variable:I=0;
Variable:DIFFLLV2=DIFF;
For I=0 to 7 do BEGIN
    iF i<>LLVBARS(DIFF,7) and DIFFLLV2>=REF(DIFF,I) THEN DIFFLLV2=REF(DIFF,I);
    I=I+1;
END}
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;

底背离1:=(REF(MACDL,A1+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A1+1))>=0 AND GTMIN AND IGNOREMIN1;
底背离2:=(REF(MACDL,A2+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A2+1))>=0 AND GTMIN AND IGNOREMIN2 AND (底背离1<>1) AND COUNT(CROSS(DEA,DIFF) && DEA>0,A2)<2;
底背离3:=(REF(MACDL,A3+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A3+1))>=0 AND GTMIN AND IGNOREMIN3 AND ((底背离1||底背离2)<>1) AND COUNT(CROSS(DEA,DIFF) && DEA>0,A3)<2;
底背离4:=(REF(MACDL,A4+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A4+1))>=0 AND GTMIN AND IGNOREMIN4 AND ((底背离1||底背离2||底背离3)<>1) AND COUNT(CROSS(DEA,DIFF) && DEA>0,A4)<2;
底背离5:=(REF(MACDL,A5+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A5+1))>=0 AND GTMIN AND IGNOREMIN5 AND ((底背离1||底背离2||底背离3||底背离4)<>1) AND COUNT(CROSS(DEA,DIFF) && DEA>0,A5)<2;
底背离:底背离1||底背离2||底背离3||底背离4||底背离5;

//PV POSITIVE VIOLATION 底背离的简称。 底背离和PV的区别是如果有底背离1, 那就没有底背离2. PV就是既可以有底背离1, 也可以有底背离2
PV1:=(REF(MACDL,A1+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A1+1))>=0 AND GTMIN AND IGNOREMIN1;
PV2:=(REF(MACDL,A2+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A2+1))>=0 AND GTMIN AND IGNOREMIN2 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A2)<2;
PV3:=(REF(MACDL,A3+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A3+1))>=0 AND GTMIN AND IGNOREMIN3 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A3)<2;
PV4:=(REF(MACDL,A4+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A4+1))>=0 AND GTMIN AND IGNOREMIN4 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A4)<2;
PV5:=(REF(MACDL,A5+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A5+1))>=0 AND GTMIN AND IGNOREMIN5 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A5)<2;

{文华8
DRAWLINE(底背离1,DEA,底背离1,REF(DEA,A1),0),COLORRED,LINETHICK2;
DRAWLINE(底背离2,DEA,底背离2,REF(DEA,A2),0),COLORRED,LINETHICK2;
DRAWLINE(底背离3,DEA,底背离3,REF(DEA,A3),0),COLORRED,LINETHICK2;
DRAWLINE(底背离4,DEA,底背离4,REF(DEA,A4),0),COLORRED,LINETHICK2;
DRAWLINE(底背离5,DEA,底背离5,REF(DEA,A5),0),COLORRED,LINETHICK2;}
VERTLINE(底背离1,DEA,REF(DEA,A1),COLORRED,LINETHICK2);
VERTLINE(底背离2,DEA,REF(DEA,A2),COLORRED,LINETHICK2);
VERTLINE(底背离3,DEA,REF(DEA,A3),COLORRED,LINETHICK2);
VERTLINE(底背离4,DEA,REF(DEA,A4),COLORRED,LINETHICK2);
VERTLINE(底背离5,DEA,REF(DEA,A5),COLORRED,LINETHICK2);
DRAWTEXT(底背离1,DEA,'底背离1'),COLORFF00FF;
DRAWTEXT(底背离2,DEA,'底背离2'),COLORFF00FF;
DRAWTEXT(底背离3,DEA,'底背离3'),COLORFF00FF;
DRAWTEXT(底背离4,DEA,'底背离4'),COLORFF00FF;
DRAWTEXT(底背离5,DEA,'底背离5'),COLORFF00FF;

 

 

这个是主函数, 分别60分钟, 5分钟, 15分钟, 天数调用, 还有一个问题, 我在2018年已经下载了该有的历史数据, 但是分钟级别在2018年根本就显示不出来, 只能显示日线的的信号。 这是为什么?

SHDIFFDAY:STKINDI('SH000001','MACDViolate.DIFF(12,26,9)',0,6,-1),noaxis;
SHDIFF60MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,5,-1),noaxis;
SHDIFF15MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,3,-1),noaxis;
SHDIFF5MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,2,-1),noaxis;
SHDIFF1MIN:STKINDI('SH000001','MACDVIOLATE.DIFF(12,26,9)',0,1,-1),noaxis;
SHDEA1MIN:STKINDI('SH000001','MACDVIOLATE.DEA(12,26,9)',0,1,-1),noaxis;
//POSITIVEV, PV 代表底背离POSITIVE VIOLATION, 底背离
//PV 是调用底背离第几次,SHPOSITIVEVDAY是代表底背离的程度
SHPV5MIN1:STKINDI('SH000001','MACDVIOLATE.PV1(12,26,9)',0,2,-1),noaxis;
SHPV5MIN2:STKINDI('SH000001','MACDVIOLATE.PV2(12,26,9)',0,2,-1),noaxis;
SHPV5MIN3:STKINDI('SH000001','MACDVIOLATE.PV3(12,26,9)',0,2,-1),noaxis;
SHPV5MIN4:STKINDI('SH000001','MACDVIOLATE.PV4(12,26,9)',0,2,-1),noaxis;
SHPV5MIN5:STKINDI('SH000001','MACDVIOLATE.PV5(12,26,9)',0,2,-1),noaxis;

SHPV15MIN1:STKINDI('SH000001','MACDVIOLATE.PV1(12,26,9)',0,3,-1),noaxis;
SHPV15MIN2:STKINDI('SH000001','MACDVIOLATE.PV2(12,26,9)',0,3,-1),noaxis;
SHPV15MIN3:STKINDI('SH000001','MACDVIOLATE.PV3(12,26,9)',0,3,-1),noaxis;
SHPV15MIN4:STKINDI('SH000001','MACDVIOLATE.PV4(12,26,9)',0,3,-1),noaxis;
SHPV15MIN5:STKINDI('SH000001','MACDVIOLATE.PV5(12,26,9)',0,3,-1),noaxis;

SHPV60MIN1:STKINDI('SH000001','MACDVIOLATE.PV1(12,26,9)',0,5,-1),noaxis;
SHPV60MIN2:STKINDI('SH000001','MACDVIOLATE.PV2(12,26,9)',0,5,-1),noaxis;
SHPV60MIN3:STKINDI('SH000001','MACDVIOLATE.PV3(12,26,9)',0,5,-1),noaxis;
SHPV60MIN4:STKINDI('SH000001','MACDVIOLATE.PV4(12,26,9)',0,5,-1),noaxis;
SHPV60MIN5:STKINDI('SH000001','MACDVIOLATE.PV5(12,26,9)',0,5,-1),noaxis;

SHPVDAY1:STKINDI('SH000001','MACDVIOLATE.PV1(12,26,9)',0,6,-1),noaxis;
SHPVDAY2:STKINDI('SH000001','MACDVIOLATE.PV2(12,26,9)',0,6,-1),noaxis;
SHPVDAY3:STKINDI('SH000001','MACDVIOLATE.PV3(12,26,9)',0,6,-1),noaxis;
SHPVDAY4:STKINDI('SH000001','MACDVIOLATE.PV4(12,26,9)',0,6,-1),noaxis;
SHPVDAY5:STKINDI('SH000001','MACDVIOLATE.PV5(12,26,9)',0,6,-1),noaxis;

SHPV5MIN:=STKINDI('SH000001','MACDVIOLATE.底背离(12,26,9)',0,2,-1),noaxis;
SHPV15MIN:=STKINDI('SH000001','MACDVIOLATE.底背离(12,26,9)',0,3,-1),noaxis;
SHPV60MIN:=STKINDI('SH000001','MACDVIOLATE.底背离(12,26,9)',0,5,-1),noaxis;
SHPVDAY6:=STKINDI('SH000001','MACDVIOLATE.底背离(12,26,9)',0,6,-1),noaxis;

 

//深圳指数
SZDIFFDAY:STKINDI('SZ000001','MACDViolate.DIFF(12,26,9)',0,6,-1),noaxis;
SZDIFF60MIN:STKINDI('SZ000001','MACDVIOLATE.DIFF(12,26,9)',0,5,-1),noaxis;
SZDIFF15MIN:STKINDI('SZ000001','MACDVIOLATE.DIFF(12,26,9)',0,3,-1),noaxis;
SZDIFF5MIN:STKINDI('SZ000001','MACDVIOLATE.DIFF(12,26,9)',0,2,-1),noaxis;
SZDIFF1MIN:STKINDI('SZ000001','MACDVIOLATE.DIFF(12,26,9)',0,1,-1),noaxis;
SZDEA1MIN:STKINDI('SZ000001','MACDVIOLATE.DEA(12,26,9)',0,1,-1),noaxis;
//POSITIVEV, PV 代表底背离POSITIVE VIOLATION, 底背离
//PV 是调用底背离第几次,POSITIVEVDAY是代表底背离的程度
SZPV5MIN1:=STKINDI('SZ000001','MACDVIOLATE.PV1(12,26,9)',0,2,-1),noaxis;
SZPV5MIN2:=STKINDI('SZ000001','MACDVIOLATE.PV2(12,26,9)',0,2,-1),noaxis;
SZPV5MIN3:=STKINDI('SZ000001','MACDVIOLATE.PV3(12,26,9)',0,2,-1),noaxis;
SZPV5MIN4:=STKINDI('SZ000001','MACDVIOLATE.PV4(12,26,9)',0,2,-1),noaxis;
SZPV5MIN5:=STKINDI('SZ000001','MACDVIOLATE.PV5(12,26,9)',0,2,-1),noaxis;

SZPV15MIN1:=STKINDI('SZ000001','MACDVIOLATE.PV1(12,26,9)',0,3,-1),noaxis;
SZPV15MIN2:=STKINDI('SZ000001','MACDVIOLATE.PV2(12,26,9)',0,3,-1),noaxis;
SZPV15MIN3:=STKINDI('SZ000001','MACDVIOLATE.PV3(12,26,9)',0,3,-1),noaxis;
SZPV15MIN4:=STKINDI('SZ000001','MACDVIOLATE.PV4(12,26,9)',0,3,-1),noaxis;
SZPV15MIN5:=STKINDI('SZ000001','MACDVIOLATE.PV5(12,26,9)',0,3,-1),noaxis;

SZPV60MIN1:=STKINDI('SZ000001','MACDVIOLATE.PV1(12,26,9)',0,5,-1),noaxis;
SZPV60MIN2:=STKINDI('SZ000001','MACDVIOLATE.PV2(12,26,9)',0,5,-1),noaxis;
SZPV60MIN3:=STKINDI('SZ000001','MACDVIOLATE.PV3(12,26,9)',0,5,-1),noaxis;
SZPV60MIN4:=STKINDI('SZ000001','MACDVIOLATE.PV4(12,26,9)',0,5,-1),noaxis;
SZPV60MIN5:=STKINDI('SZ000001','MACDVIOLATE.PV5(12,26,9)',0,5,-1),noaxis;

SZPVDAY1:=STKINDI('SZ000001','MACDVIOLATE.PV1(12,26,9)',0,6,-1),noaxis;
SZPVDAY2:=STKINDI('SZ000001','MACDVIOLATE.PV2(12,26,9)',0,6,-1),noaxis;
SZPVDAY3:=STKINDI('SZ000001','MACDVIOLATE.PV3(12,26,9)',0,6,-1),noaxis;
SZPVDAY4:=STKINDI('SZ000001','MACDVIOLATE.PV4(12,26,9)',0,6,-1),noaxis;
SZPVDAY5:=STKINDI('SZ000001','MACDVIOLATE.PV5(12,26,9)',0,6,-1),noaxis;

SZPV5MIN:=STKINDI('SZ000001','MACDVIOLATE.底背离(12,26,9)',0,2,-1),noaxis;
SZPV15MIN:=STKINDI('SZ000001','MACDVIOLATE.底背离(12,26,9)',0,3,-1),noaxis;
SZPV60MIN:=STKINDI('SZ000001','MACDVIOLATE.底背离(12,26,9)',0,5,-1),noaxis;
SZPVDAY6:=STKINDI('SZ000001','MACDVIOLATE.底背离(12,26,9)',0,6,-1),noaxis;


 回到顶部
帅哥哟,离线,有人找我吗?
OscarDeng
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:289 积分:0 威望:0 精华:0 注册:2019/4/29 11:42:41
为什么我要用: , 不能用:=。 如果我用:= , 使用 STKINDI 调用这个值就不能被输出。  发帖心情 Post By:2019/8/3 13:00:32    Post IP:14.120.224.5[显示全部帖子]

我想问一下, 为什么我要用: , 不能用:=。  如果我用:= , 使用  STKINDI 调用这个值就不能被输出。  

 

必须是这样,不能使用:=。 这些值才能被调用输出

底背离:底背离1||底背离2||底背离3||底背离4||底背离5;

PV1:(REF(MACDL,A1+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A1+1))>=0 AND GTMIN AND IGNOREMIN1;
PV2:(REF(MACDL,A2+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A2+1))>=0 AND GTMIN AND IGNOREMIN2 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A2)<2;
PV3:(REF(MACDL,A3+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A3+1))>=0 AND GTMIN AND IGNOREMIN3 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A3)<2;
PV4:(REF(MACDL,A4+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A4+1))>=0 AND GTMIN AND IGNOREMIN4 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A4)<2;
PV5:(REF(MACDL,A5+1)-MACDL)/MACDL>=-0.01 AND (DIFFL-REF(DIFFL,A5+1))>=0 AND GTMIN AND IGNOREMIN5 AND COUNT(CROSS(DEA,DIFF) && DEA>0,A5)<2;


 回到顶部