股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[飞狐] 时间周期


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-25 14:44:45

以下是时间周期

{时间周期}



drawtext(BARPOS=SYSPARAM(2),3,'菲波纳齐数:=1
2
3
5
8
13
21
34
55
89
144
233
377
610;





鲁卡斯数:=1
2
3
4
7
11
18
29
47
76
123
199
322
521
843\n





(*9or平方):=1
4
9
16
18
25
27
36
45
49
63
64
72
81
99
117
162
189
261
306
423
495
684
801'),colorblue;





drawtext(BARPOS=SYSPARAM(2),2.5,'神奇数字:=12345789
11
13
16
18
21
25
27
29
34
36





45
47
49
55
63
64
72
76
81
89
99
117
123
144
162
189
199
233
261
306
322
377
423
495
521
610
684
801'),colorblue;























ifdatatype=6thenbegin





//顶时间





顶时间0:=1071016;//最重要的顶





顶时间1:=1090804;//浪1@A





顶时间2:=1091124;//浪2@B





顶时间3:=1071016;//浪3@C





顶时间4:=1071016;//浪4





顶时间5:=1071016;//浪5





顶时间6:=1091207;//次重要时间点





顶时间7:=1071016;//次重要时间点





顶时间8:=1071016;//次重要时间点





顶时间9:=1071016;//次重要时间点





//底时间





底时间0:=1081028;//最重要的底





底时间1:=1090901;//浪1@A





底时间2:=1081028;//浪2@B





底时间3:=1081028;//浪3@C





底时间4:=1081028;//浪4





底时间5:=1081028;//浪5





底时间6:=1090924;
//次重要时间点





底时间7:=1091102;
//次重要时间点





底时间8:=1091127;
//次重要时间点





底时间9:=1081028;
//次重要时间点





//顶





顶时间尺0:=BARSLAST(DATE=顶时间0)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺1:=BARSLAST(DATE=顶时间1)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺2:=BARSLAST(DATE=顶时间2)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺3:=BARSLAST(DATE=顶时间3)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺4:=BARSLAST(DATE=顶时间4)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺5:=BARSLAST(DATE=顶时间5)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺6:=BARSLAST(DATE=顶时间6)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺7:=BARSLAST(DATE=顶时间7)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺8:=BARSLAST(DATE=顶时间8)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





顶时间尺9:=BARSLAST(DATE=顶时间9)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORCYAN;





DRAWTEXT(date=顶时间0,2,''+numtostr(顶时间尺0,0)),COLORCYAN;





DRAWTEXT(date=顶时间1,2,''+numtostr(顶时间尺1,0)),COLORCYAN;





DRAWTEXT(date=顶时间2,2,''+numtostr(顶时间尺2,0)),COLORCYAN;





DRAWTEXT(date=顶时间3,2,''+numtostr(顶时间尺3,0)),COLORCYAN;





DRAWTEXT(date=顶时间4,2,''+numtostr(顶时间尺4,0)),COLORCYAN;





DRAWTEXT(date=顶时间5,2,''+numtostr(顶时间尺5,0)),COLORCYAN;





DRAWTEXT(date=顶时间6,2,''+numtostr(顶时间尺6,0)),COLORCYAN;





DRAWTEXT(date=顶时间7,2,''+numtostr(顶时间尺7,0)),COLORCYAN;





DRAWTEXT(date=顶时间8,2,''+numtostr(顶时间尺8,0)),COLORCYAN;





DRAWTEXT(date=顶时间9,2,''+numtostr(顶时间尺9,0)),COLORCYAN;





//底





底时间尺0:=BARSLAST(DATE=底时间0)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺1:=BARSLAST(DATE=底时间1)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺2:=BARSLAST(DATE=底时间2)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺3:=BARSLAST(DATE=底时间3)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺4:=BARSLAST(DATE=底时间4)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺5:=BARSLAST(DATE=底时间5)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺6:=BARSLAST(DATE=底时间6)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺7:=BARSLAST(DATE=底时间7)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺8:=BARSLAST(DATE=底时间8)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





底时间尺9:=BARSLAST(DATE=底时间9)-BARSLAST(BARPOS=SYSPARAM(1))+1,COLORMAGENTA;





DRAWTEXT(date=底时间0,1,''+numtostr(底时间尺0,0)),COLORMAGENTA;





DRAWTEXT(date=底时间1,1,''+numtostr(底时间尺1,0)),COLORMAGENTA;





DRAWTEXT(date=底时间2,1,''+numtostr(底时间尺2,0)),COLORMAGENTA;





DRAWTEXT(date=底时间3,1,''+numtostr(底时间尺3,0)),COLORMAGENTA;





DRAWTEXT(date=底时间4,1,''+numtostr(底时间尺4,0)),COLORMAGENTA;





DRAWTEXT(date=底时间5,1,''+numtostr(底时间尺5,0)),COLORMAGENTA;





DRAWTEXT(date=底时间6,1,''+numtostr(底时间尺6,0)),COLORMAGENTA;





DRAWTEXT(date=底时间7,1,''+numtostr(底时间尺7,0)),COLORMAGENTA;





DRAWTEXT(date=底时间8,1,''+numtostr(底时间尺8,0)),COLORMAGENTA;





DRAWTEXT(date=底时间9,1,''+numtostr(底时间尺9,0)),COLORMAGENTA;





//到现在的时间





DRAWTEXT(BARPOS=SYSPARAM(3),1.5,''+numtostr((SYSPARAM(3)-SYSPARAM(1))+1,0)),Color0095BC,shift0,align2;





降1升0:=1;//或是0






if降1升0=1thenbegin





stickline(date=顶时间1,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间2,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间3,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间4,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间5,1.1,1.8,1,0),COLORgray;





stickline(date=底时间1,1.1,1.8,1,0),COLORgray;





stickline(date=底时间2,1.1,1.8,1,0),COLORgray;





stickline(date=底时间3,1.1,1.8,1,0),COLORgray;





stickline(date=底时间4,1.1,1.8,1,0),COLORgray;





stickline(date=底时间5,1.1,1.8,1,0),COLORgray;





drawline(date=顶时间1,1.5,date=底时间1,1.5,0),COLORCYAN;





drawline(date=底时间1,1.5,date=顶时间2,1.5,0),COLORMAGENTA;





drawline(date=顶时间2,1.5,date=底时间2,1.5,0),COLORCYAN;





drawline(date=底时间2,1.5,date=顶时间3,1.5,0),COLORMAGENTA;





drawline(date=顶时间3,1.5,date=底时间3,1.5,0),COLORCYAN;





drawline(date=底时间3,1.5,date=顶时间4,1.5,0),COLORMAGENTA;





drawline(date=顶时间4,1.5,date=底时间4,1.5,0),COLORCYAN;





drawline(date=底时间4,1.5,date=顶时间5,1.5,0),COLORMAGENTA;





drawline(date=顶时间5,1.5,date=底时间5,1.5,0),COLORCYAN;





DRAWTEXT(date=底时间1,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间1)-BARSLAST(DATE=底时间1)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=顶时间2,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间1)-BARSLAST(DATE=顶时间2)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=底时间2,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间2)-BARSLAST(DATE=底时间2)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=顶时间3,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间2)-BARSLAST(DATE=顶时间3)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=底时间3,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间3)-BARSLAST(DATE=底时间3)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=顶时间4,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间3)-BARSLAST(DATE=顶时间4)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=底时间4,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间4)-BARSLAST(DATE=底时间4)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=顶时间5,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间4)-BARSLAST(DATE=顶时间5)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=底时间5,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间5)-BARSLAST(DATE=底时间5)+1,0)),COLORCYAN,PXDN15,align2;



end;





if降1升0=0thenbegin





stickline(date=底时间1,1.1,1.8,1,0),COLORgray;





stickline(date=底时间2,1.1,1.8,1,0),COLORgray;





stickline(date=底时间3,1.1,1.8,1,0),COLORgray;





stickline(date=底时间4,1.1,1.8,1,0),COLORgray;





stickline(date=底时间5,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间1,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间2,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间3,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间4,1.1,1.8,1,0),COLORgray;





stickline(date=顶时间5,1.1,1.8,1,0),COLORgray;





drawline(date=底时间1,1.5,date=顶时间1,1.5,0),COLORCYAN;





drawline(date=顶时间1,1.5,date=底时间2,1.5,0),COLORMAGENTA;





drawline(date=底时间2,1.5,date=顶时间2,1.5,0),COLORCYAN;





drawline(date=顶时间2,1.5,date=底时间3,1.5,0),COLORMAGENTA;





drawline(date=底时间3,1.5,date=顶时间3,1.5,0),COLORCYAN;





drawline(date=顶时间3,1.5,date=底时间4,1.5,0),COLORMAGENTA;





drawline(date=底时间4,1.5,date=顶时间4,1.5,0),COLORCYAN;





drawline(date=顶时间4,1.5,date=底时间5,1.5,0),COLORMAGENTA;





drawline(date=底时间5,1.5,date=顶时间5,1.5,0),COLORCYAN;





DRAWTEXT(date=顶时间1,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间1)-BARSLAST(DATE=顶时间1)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=底时间2,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间1)-BARSLAST(DATE=底时间2)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=顶时间2,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间2)-BARSLAST(DATE=顶时间2)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=底时间3,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间2)-BARSLAST(DATE=底时间3)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=顶时间3,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间3)-BARSLAST(DATE=顶时间3)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=底时间4,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间3)-BARSLAST(DATE=底时间4)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=顶时间4,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间4)-BARSLAST(DATE=顶时间4)+1,0)),COLORCYAN,PXDN15,align2;





DRAWTEXT(date=底时间5,1.8,''+NUMTOSTR(BARSLAST(DATE=顶时间4)-BARSLAST(DATE=底时间5)+1,0)),COLORMAGENTA,PXDN15,align2;





DRAWTEXT(date=顶时间5,1.8,''+NUMTOSTR(BARSLAST(DATE=底时间5)-BARSLAST(DATE=顶时间5)+1,0)),COLORCYAN,PXDN15,align2;






end;





end;











//时间尺





GB:=SYSPARAM(1);





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift5;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift8;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift13;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift21;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift34;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift55;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift89;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift144;





stickline(BARPOS=GB,0,0.6,1,0),POINTDOT,Color0095BC,shift233;





DRAWTEXT(BARPOS=GB,0.5,'5'),Color0095BC,shift5;





DRAWTEXT(BARPOS=GB,0.5,'8'),Color0095BC,shift8;





DRAWTEXT(BARPOS=GB,0.5,'13'),Color0095BC,shift13;





DRAWTEXT(BARPOS=GB,0.5,'21'),Color0095BC,shift21;





DRAWTEXT(BARPOS=GB,0.5,'34'),Color0095BC,shift34;





DRAWTEXT(BARPOS=GB,0.5,'55'),Color0095BC,shift55;





DRAWTEXT(BARPOS=GB,0.5,'89'),Color0095BC,shift89;





DRAWTEXT(BARPOS=GB,0.5,'144'),Color0095BC,shift144;





DRAWTEXT(BARPOS=GB,0.5,'233'),Color0095BC,shift233;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift28;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift42;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift47;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift28;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift42;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift47;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift63;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift68;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift76;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift97;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift102;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift110;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift123;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift152;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift157;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift165;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift178;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift199;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift241;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift246;





stickline(BARPOS=GB,0,0.3,1,0),POINTDOT,Color0095BC,shift254;






回复

举报

QQ|

GMT+8, 2024-11-16 13:14

快速回复 返回顶部 返回列表