搜索
紧急:明日1只100%涨停推荐一只涨停板股票中线单股之创业板里的“茅台”A股十年启示录
【直播】中美贸易战如何捞金今日头条:明日暴涨牛股已公开炒股七大制胜法宝金融书籍5折包邮
实盘开启稳定获利【惠天财经】在线视频教育港股佣金0.08%支持融资融券洞察主力动向 精准短线操作
123
返回列表 发新帖
楼主: 道可道2088

[个股交流] 通达信 年月日 干支 显示

[复制链接]

发表于 2017-7-1 22:37 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
金币:
奖励:
热心:
注册时间:
2006-10-16

回复 使用道具 举报

签到天数: 132 天

中华占星将上证指数拆解到底行云流水话投资群组家园功能咨询专群

发表于 2017-7-1 22:59 | 显示全部楼层
本帖最后由 jinzi2954 于 2017-7-1 23:05 编辑
道可道2088 发表于 2017-6-20 18:48
逛了很久的论坛, 学到不少, 没有做什么贡献, 所以花了点时间 编了 这个通达信 公式 .

多谢分享。已经看到纳音的公式了,多谢
金币:
奖励:
热心:
注册时间:
2005-4-14

回复 使用道具 举报

签到天数: 132 天

中华占星将上证指数拆解到底行云流水话投资群组家园功能咨询专群

发表于 2017-7-1 23:10 | 显示全部楼层
道可道2088 发表于 2017-6-29 13:38
不用安装, 直接在通达信里面导入公式 就可以.
主要是代码太长 ,

郁闷,导入通达信失败,不兼容
金币:
奖励:
热心:
注册时间:
2005-4-14

回复 使用道具 举报

签到天数: 1 天

 楼主| 发表于 2017-7-2 20:21 | 显示全部楼层

STICKLINE(ISLASTBAR,-1.5,7.5,3,0),COLORBLUE;



{算八字: 干支从1开始, 1970到1900天数 25567+1 ,1990.12.19到1900的天数 33224+1 ,0.375是收盘修正}
{DD    :=DATEC;}
DD   :=DATE;
{距日  :=DATETOD1970(DD)  +  25568 - 0.375 +1 ,NODRAW;}
距日 :=DATETODAY(DD)    +  33225 - 0.375 +1,NODRAW;
哪年  :=INTPART(DD/10000),NODRAW;
哪节  :=( MOD(INTPART(DD/100),100) -1 ) *2 ,NODRAW;
积日  :=365.242*哪年+6.15+15.2226*哪节-1.9*SIN(0.262*哪节) ,NODRAW;
积日春:=365.242*哪年+6.15+15.2226*  2 -1.9*SIN(0.262* 2  ) ,NODRAW;

年干:MOD(  哪年 -(距日<积日春) +6 ,10) +1 ,NODRAW;
年支:MOD(  哪年 -(距日<积日春)+12 ,12) +1 ,NODRAW;
月干:MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日) +2 ,10) +1 ,NODRAW;
月支:=MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日)    ,12) +1 ,NODRAW;
{日干:MOD(DATETOD1970(DD) +7,10) +1 ,NODRAW;}
{日支:MOD(DATETOD1970(DD) +5,12) +1 ,NODRAW;}
日干:=MOD(DATETODAY(DD) +4,10) +1 ,NODRAW;
日支:=MOD(DATETODAY(DD) +6,12) +1 ,NODRAW;





{算八字: 显示}
NGW:=IF(年干=1,'甲',IF(年干=2,'乙',IF(年干=3,'丙',IF(年干=4,'丁',IF(年干=5,'戊',
     IF(年干=6,'己',IF(年干=7,'庚',IF(年干=8,'辛',IF(年干=9,'壬','癸')))))))));
NZW:=IF(年支=1,'子',IF(年支=2,'丑',IF(年支=3,'寅',IF(年支=4,'卯',IF(年支=5,'辰',IF(年支=6,'巳',
     IF(年支=7,'午',IF(年支=8,'未',IF(年支=9,'申',IF(年支=10,'酉',IF(年支=11,'戌','亥')))))))))));
YGW:=IF(月干=1,'甲',IF(月干=2,'乙',IF(月干=3,'丙',IF(月干=4,'丁',IF(月干=5,'戊',
     IF(月干=6,'己',IF(月干=7,'庚',IF(月干=8,'辛',IF(月干=9,'壬','癸')))))))));
YZW:=IF(月支=1,'子',IF(月支=2,'丑',IF(月支=3,'寅',IF(月支=4,'卯',IF(月支=5,'辰',IF(月支=6,'巳',
     IF(月支=7,'午',IF(月支=8,'未',IF(月支=9,'申',IF(月支=10,'酉',IF(月支=11,'戌','亥')))))))))));
RGW:=IF(日干=1,'甲',IF(日干=2,'乙',IF(日干=3,'丙',IF(日干=4,'丁',IF(日干=5,'戊',
     IF(日干=6,'己',IF(日干=7,'庚',IF(日干=8,'辛',IF(日干=9,'壬','癸')))))))));
RZW:=IF(日支=1,'子',IF(日支=2,'丑',IF(日支=3,'寅',IF(日支=4,'卯',IF(日支=5,'辰',IF(日支=6,'巳',
     IF(日支=7,'午',IF(日支=8,'未',IF(日支=9,'申',IF(日支=10,'酉',IF(日支=11,'戌','亥')))))))))));


DRAWTEXT(1,7,YZW),COLOR00FF00;
DRAWTEXT(1,6,RGW),COLOR00FFFF;
DRAWTEXT(1,5,RZW),COLOR00FFFF;


{显示纳音}
NYS1:= MOD(   (6-(日支-日干)/2)*10+日干  ,60) ,NODRAW;
NYS2:= MOD(   (6-(月支-月干)/2)*10+月干  ,60) ,NODRAW;
{显示纳音 : 月}
E0:=3.5;
Z1金:=NYS2=1 OR NYS2=2 OR NYS2=9 OR NYS2=10 OR NYS2=17 OR NYS2=18 OR NYS2=31 OR NYS2=32 OR NYS2=39 OR
NYS2=40 OR NYS2=47 OR NYS2=48;
Z1火:=NYS2=3 OR NYS2=4 OR NYS2=11 OR NYS2=12 OR NYS2=25 OR NYS2=26 OR NYS2=33 OR NYS2=34 OR NYS2=41 OR
NYS2=42 OR NYS2=55 OR NYS2=56;
Z1木:=NYS2=5 OR NYS2=6 OR NYS2=19 OR NYS2=20 OR NYS2=27 OR NYS2=28 OR NYS2=35 OR NYS2=36 OR NYS2=49 OR
NYS2=50 OR NYS2=57 OR NYS2=58;
Z1土:=NYS2=7 OR NYS2=8 OR NYS2=15 OR NYS2=16 OR NYS2=23 OR NYS2=24 OR NYS2=37 OR NYS2=38 OR NYS2=45 OR
NYS2=46 OR NYS2=53 OR NYS2=54;
Z1水:=NYS2=13 OR NYS2=14 OR NYS2=21 OR NYS2=22 OR NYS2=29 OR NYS2=30 OR NYS2=43 OR NYS2=44 OR NYS2=51 OR
NYS2=52 OR NYS2=59 OR NYS2=0;
DRAWTEXT(Z1火,E0,'火'),COLORWHITE;
DRAWTEXT(Z1木,E0,'木'),COLORWHITE;
DRAWTEXT(Z1土,E0,'土'),COLORWHITE;
DRAWTEXT(Z1水,E0,'水'),COLORWHITE;
DRAWTEXT(Z1金,E0,'金'),COLORWHITE;

{显示纳音 : 日子}
E1:=2.5;
DRAWTEXT(NYS1=1 OR NYS1=2,E1,'海'),COLORWHITE;
DRAWTEXT(NYS1=3 OR NYS1=4,E1,'炉'),COLORRED;
DRAWTEXT(NYS1=5 OR NYS1=6,E1,'大'),COLORGREEN;
DRAWTEXT(NYS1=7 OR NYS1=8,E1,'路'),COLORYELLOW;
DRAWTEXT(NYS1=9 OR NYS1=10,E1,'剑'),COLORWHITE;
DRAWTEXT(NYS1=11 OR NYS1=12,E1,'山'),COLORRED;
DRAWTEXT(NYS1=13 OR NYS1=14,E1,'涧'),COLORFFCC00;
DRAWTEXT(NYS1=15 OR NYS1=16,E1,'城'),COLOR0099FF;
DRAWTEXT(NYS1=17 OR NYS1=18,E1,'白'),COLORWHITE;
DRAWTEXT(NYS1=19 OR NYS1=20,E1,'杨'),COLORGREEN;
DRAWTEXT(NYS1=21 OR NYS1=22,E1,'泉'),COLORCYAN;
DRAWTEXT(NYS1=23 OR NYS1=24,E1,'屋'),COLORYELLOW;
DRAWTEXT(NYS1=25 OR NYS1=26,E1,'霹'),COLORRED;
DRAWTEXT(NYS1=27 OR NYS1=28,E1,'松'),COLORGREEN;
DRAWTEXT(NYS1=29 OR NYS1=30,E1,'长'),COLORFFCC00;
DRAWTEXT(NYS1=31 OR NYS1=32,E1,'沙'),COLORWHITE;
DRAWTEXT(NYS1=33 OR NYS1=34,E1,'山'),COLORRED;
DRAWTEXT(NYS1=35 OR NYS1=36,E1,'平'),COLORGREEN;
DRAWTEXT(NYS1=37 OR NYS1=38,E1,'壁'),COLOR0099FF;
DRAWTEXT(NYS1=39 OR NYS1=40,E1,'金'),COLORWHITE;
DRAWTEXT(NYS1=41 OR NYS1=42,E1,'覆'),COLORRED;
DRAWTEXT(NYS1=43 OR NYS1=44,E1,'天'),COLORFFCC00;
DRAWTEXT(NYS1=45 OR NYS1=46,E1,'大'),COLOR0099FF;
DRAWTEXT(NYS1=47 OR NYS1=48,E1,'钗'),COLORWHITE;
DRAWTEXT(NYS1=49 OR NYS1=50,E1,'桑'),COLORGREEN;
DRAWTEXT(NYS1=51 OR NYS1=52,E1,'大'),COLORFFCC00;
DRAWTEXT(NYS1=53 OR NYS1=54,E1,'沙'),COLORGREEN;
DRAWTEXT(NYS1=55 OR NYS1=56,E1,'天'),COLORRED;
DRAWTEXT(NYS1=57 OR NYS1=58,E1,'石'),COLORGREEN;
DRAWTEXT(NYS1=59 OR NYS1=0,E1,'大'),COLORFFCC00;

E2:=1.5;   
DRAWTEXT(NYS1=2 OR NYS1=1,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=4 OR NYS1=3,E2,'中'),COLORRED;
DRAWTEXT(NYS1=6 OR NYS1=5,E2,'林'),COLORGREEN;
DRAWTEXT(NYS1=8 OR NYS1=7,E2,'旁'),COLORYELLOW;
DRAWTEXT(NYS1=10 OR NYS1=9,E2,'锋'),COLORWHITE;
DRAWTEXT(NYS1=12 OR NYS1=11,E2,'头'),COLORRED;
DRAWTEXT(NYS1=14 OR NYS1=13,E2,'下'),COLORFFCC00;
DRAWTEXT(NYS1=16 OR NYS1=15,E2,'头'),COLOR0099FF;
DRAWTEXT(NYS1=18 OR NYS1=17,E2,'蜡'),COLORWHITE;
DRAWTEXT(NYS1=20 OR NYS1=19,E2,'柳'),COLORGREEN;
DRAWTEXT(NYS1=22 OR NYS1=21,E2,'中'),COLORCYAN;
DRAWTEXT(NYS1=24 OR NYS1=23,E2,'上'),COLORYELLOW;
DRAWTEXT(NYS1=26 OR NYS1=25,E2,'雷'),COLORRED;
DRAWTEXT(NYS1=28 OR NYS1=27,E2,'柏'),COLORGREEN;
DRAWTEXT(NYS1=30 OR NYS1=29,E2,'流'),COLORFFCC00;
DRAWTEXT(NYS1=32 OR NYS1=31,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=34 OR NYS1=33,E2,'下'),COLORRED;
DRAWTEXT(NYS1=36 OR NYS1=35,E2,'地'),COLORGREEN;
DRAWTEXT(NYS1=38 OR NYS1=37,E2,'上'),COLOR0099FF;
DRAWTEXT(NYS1=40 OR NYS1=39,E2,'箔'),COLORWHITE;
DRAWTEXT(NYS1=42 OR NYS1=41,E2,'灯'),COLORRED;
DRAWTEXT(NYS1=44 OR NYS1=43,E2,'河'),COLORFFCC00;
DRAWTEXT(NYS1=46 OR NYS1=45,E2,'驿'),COLOR0099FF;
DRAWTEXT(NYS1=48 OR NYS1=47,E2,'钏'),COLORWHITE;
DRAWTEXT(NYS1=50 OR NYS1=49,E2,'柘'),COLORGREEN;
DRAWTEXT(NYS1=52 OR NYS1=51,E2,'溪'),COLORFFCC00;
DRAWTEXT(NYS1=54 OR NYS1=53,E2,'中'),COLORGREEN;
DRAWTEXT(NYS1=56 OR NYS1=55,E2,'上'),COLORRED;
DRAWTEXT(NYS1=58 OR NYS1=57,E2,'榴'),COLORGREEN;
DRAWTEXT(NYS1=0 OR NYS1=59,E2,'海'),COLORFFCC00;
E3:=0.5;
Z金:=NYS1=1 OR NYS1=2 OR NYS1=9 OR NYS1=10 OR NYS1=17 OR NYS1=18 OR NYS1=31 OR NYS1=32 OR NYS1=39 OR
NYS1=40 OR NYS1=47 OR NYS1=48;
Z火:=NYS1=3 OR NYS1=4 OR NYS1=11 OR NYS1=12 OR NYS1=25 OR NYS1=26 OR NYS1=33 OR NYS1=34 OR NYS1=41 OR
NYS1=42 OR NYS1=55 OR NYS1=56;
Z木:=NYS1=5 OR NYS1=6 OR NYS1=19 OR NYS1=20 OR NYS1=27 OR NYS1=28 OR NYS1=35 OR NYS1=36 OR NYS1=49 OR
NYS1=50 OR NYS1=57 OR NYS1=58;
Z土:=NYS1=7 OR NYS1=8 OR NYS1=15 OR NYS1=16 OR NYS1=23 OR NYS1=24 OR NYS1=37 OR NYS1=38 OR NYS1=45 OR
NYS1=46 OR NYS1=53 OR NYS1=54;
Z水:=NYS1=13 OR NYS1=14 OR NYS1=21 OR NYS1=22 OR NYS1=29 OR NYS1=30 OR NYS1=43 OR NYS1=44 OR NYS1=51 OR
NYS1=52 OR NYS1=59 OR NYS1=0;
DRAWTEXT(Z火,E3,'火'),COLORRED;
DRAWTEXT(Z木,E3,'木'),COLORGREEN;
DRAWTEXT(Z土,E3,'土'),COLORYELLOW;
DRAWTEXT(Z水,E3,'水'),COLORFFCC00;
DRAWTEXT(Z金,E3,'金'),COLORWHITE;

E4:=-1;

JAZ:=MOD(DATETODAY(DATE)+2,7);
DRAWTEXT(JAZ=0,E4,'一'),COLORYELLOW;
DRAWTEXT(JAZ=1,E4,'二'),COLORYELLOW;
DRAWTEXT(JAZ=2,E4,'三'),COLORYELLOW;
DRAWTEXT(JAZ=3,E4,'四'),COLORYELLOW;
DRAWTEXT(JAZ=4,E4,'五'),COLORYELLOW;










金币:
奖励:
热心:
注册时间:
2014-5-28

回复 使用道具 举报

签到天数: 1 天

 楼主| 发表于 2017-7-2 20:22 | 显示全部楼层

STICKLINE(ISLASTBAR,-1.5,7.5,3,0),COLORBLUE;



{算八字: 干支从1开始, 1970到1900天数 25567+1 ,1990.12.19到1900的天数 33224+1 ,0.375是收盘修正}
{DD    :=DATEC;}
DD   :=DATE;
{距日  :=DATETOD1970(DD)  +  25568 - 0.375 +1 ,NODRAW;}
距日 :=DATETODAY(DD)    +  33225 - 0.375 +1,NODRAW;
哪年  :=INTPART(DD/10000),NODRAW;
哪节  :=( MOD(INTPART(DD/100),100) -1 ) *2 ,NODRAW;
积日  :=365.242*哪年+6.15+15.2226*哪节-1.9*SIN(0.262*哪节) ,NODRAW;
积日春:=365.242*哪年+6.15+15.2226*  2 -1.9*SIN(0.262* 2  ) ,NODRAW;

年干:MOD(  哪年 -(距日<积日春) +6 ,10) +1 ,NODRAW;
年支:MOD(  哪年 -(距日<积日春)+12 ,12) +1 ,NODRAW;
月干:MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日) +2 ,10) +1 ,NODRAW;
月支:=MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日)    ,12) +1 ,NODRAW;
{日干:MOD(DATETOD1970(DD) +7,10) +1 ,NODRAW;}
{日支:MOD(DATETOD1970(DD) +5,12) +1 ,NODRAW;}
日干:=MOD(DATETODAY(DD) +4,10) +1 ,NODRAW;
日支:=MOD(DATETODAY(DD) +6,12) +1 ,NODRAW;





{算八字: 显示}
NGW:=IF(年干=1,'甲',IF(年干=2,'乙',IF(年干=3,'丙',IF(年干=4,'丁',IF(年干=5,'戊',
     IF(年干=6,'己',IF(年干=7,'庚',IF(年干=8,'辛',IF(年干=9,'壬','癸')))))))));
NZW:=IF(年支=1,'子',IF(年支=2,'丑',IF(年支=3,'寅',IF(年支=4,'卯',IF(年支=5,'辰',IF(年支=6,'巳',
     IF(年支=7,'午',IF(年支=8,'未',IF(年支=9,'申',IF(年支=10,'酉',IF(年支=11,'戌','亥')))))))))));
YGW:=IF(月干=1,'甲',IF(月干=2,'乙',IF(月干=3,'丙',IF(月干=4,'丁',IF(月干=5,'戊',
     IF(月干=6,'己',IF(月干=7,'庚',IF(月干=8,'辛',IF(月干=9,'壬','癸')))))))));
YZW:=IF(月支=1,'子',IF(月支=2,'丑',IF(月支=3,'寅',IF(月支=4,'卯',IF(月支=5,'辰',IF(月支=6,'巳',
     IF(月支=7,'午',IF(月支=8,'未',IF(月支=9,'申',IF(月支=10,'酉',IF(月支=11,'戌','亥')))))))))));
RGW:=IF(日干=1,'甲',IF(日干=2,'乙',IF(日干=3,'丙',IF(日干=4,'丁',IF(日干=5,'戊',
     IF(日干=6,'己',IF(日干=7,'庚',IF(日干=8,'辛',IF(日干=9,'壬','癸')))))))));
RZW:=IF(日支=1,'子',IF(日支=2,'丑',IF(日支=3,'寅',IF(日支=4,'卯',IF(日支=5,'辰',IF(日支=6,'巳',
     IF(日支=7,'午',IF(日支=8,'未',IF(日支=9,'申',IF(日支=10,'酉',IF(日支=11,'戌','亥')))))))))));


DRAWTEXT(1,7,YZW),COLOR00FF00;
DRAWTEXT(1,6,RGW),COLOR00FFFF;
DRAWTEXT(1,5,RZW),COLOR00FFFF;


{显示纳音}
NYS1:= MOD(   (6-(日支-日干)/2)*10+日干  ,60) ,NODRAW;
NYS2:= MOD(   (6-(月支-月干)/2)*10+月干  ,60) ,NODRAW;
{显示纳音 : 月}
E0:=3.5;
Z1金:=NYS2=1 OR NYS2=2 OR NYS2=9 OR NYS2=10 OR NYS2=17 OR NYS2=18 OR NYS2=31 OR NYS2=32 OR NYS2=39 OR
NYS2=40 OR NYS2=47 OR NYS2=48;
Z1火:=NYS2=3 OR NYS2=4 OR NYS2=11 OR NYS2=12 OR NYS2=25 OR NYS2=26 OR NYS2=33 OR NYS2=34 OR NYS2=41 OR
NYS2=42 OR NYS2=55 OR NYS2=56;
Z1木:=NYS2=5 OR NYS2=6 OR NYS2=19 OR NYS2=20 OR NYS2=27 OR NYS2=28 OR NYS2=35 OR NYS2=36 OR NYS2=49 OR
NYS2=50 OR NYS2=57 OR NYS2=58;
Z1土:=NYS2=7 OR NYS2=8 OR NYS2=15 OR NYS2=16 OR NYS2=23 OR NYS2=24 OR NYS2=37 OR NYS2=38 OR NYS2=45 OR
NYS2=46 OR NYS2=53 OR NYS2=54;
Z1水:=NYS2=13 OR NYS2=14 OR NYS2=21 OR NYS2=22 OR NYS2=29 OR NYS2=30 OR NYS2=43 OR NYS2=44 OR NYS2=51 OR
NYS2=52 OR NYS2=59 OR NYS2=0;
DRAWTEXT(Z1火,E0,'火'),COLORWHITE;
DRAWTEXT(Z1木,E0,'木'),COLORWHITE;
DRAWTEXT(Z1土,E0,'土'),COLORWHITE;
DRAWTEXT(Z1水,E0,'水'),COLORWHITE;
DRAWTEXT(Z1金,E0,'金'),COLORWHITE;

{显示纳音 : 日子}
E1:=2.5;
DRAWTEXT(NYS1=1 OR NYS1=2,E1,'海'),COLORWHITE;
DRAWTEXT(NYS1=3 OR NYS1=4,E1,'炉'),COLORRED;
DRAWTEXT(NYS1=5 OR NYS1=6,E1,'大'),COLORGREEN;
DRAWTEXT(NYS1=7 OR NYS1=8,E1,'路'),COLORYELLOW;
DRAWTEXT(NYS1=9 OR NYS1=10,E1,'剑'),COLORWHITE;
DRAWTEXT(NYS1=11 OR NYS1=12,E1,'山'),COLORRED;
DRAWTEXT(NYS1=13 OR NYS1=14,E1,'涧'),COLORFFCC00;
DRAWTEXT(NYS1=15 OR NYS1=16,E1,'城'),COLOR0099FF;
DRAWTEXT(NYS1=17 OR NYS1=18,E1,'白'),COLORWHITE;
DRAWTEXT(NYS1=19 OR NYS1=20,E1,'杨'),COLORGREEN;
DRAWTEXT(NYS1=21 OR NYS1=22,E1,'泉'),COLORCYAN;
DRAWTEXT(NYS1=23 OR NYS1=24,E1,'屋'),COLORYELLOW;
DRAWTEXT(NYS1=25 OR NYS1=26,E1,'霹'),COLORRED;
DRAWTEXT(NYS1=27 OR NYS1=28,E1,'松'),COLORGREEN;
DRAWTEXT(NYS1=29 OR NYS1=30,E1,'长'),COLORFFCC00;
DRAWTEXT(NYS1=31 OR NYS1=32,E1,'沙'),COLORWHITE;
DRAWTEXT(NYS1=33 OR NYS1=34,E1,'山'),COLORRED;
DRAWTEXT(NYS1=35 OR NYS1=36,E1,'平'),COLORGREEN;
DRAWTEXT(NYS1=37 OR NYS1=38,E1,'壁'),COLOR0099FF;
DRAWTEXT(NYS1=39 OR NYS1=40,E1,'金'),COLORWHITE;
DRAWTEXT(NYS1=41 OR NYS1=42,E1,'覆'),COLORRED;
DRAWTEXT(NYS1=43 OR NYS1=44,E1,'天'),COLORFFCC00;
DRAWTEXT(NYS1=45 OR NYS1=46,E1,'大'),COLOR0099FF;
DRAWTEXT(NYS1=47 OR NYS1=48,E1,'钗'),COLORWHITE;
DRAWTEXT(NYS1=49 OR NYS1=50,E1,'桑'),COLORGREEN;
DRAWTEXT(NYS1=51 OR NYS1=52,E1,'大'),COLORFFCC00;
DRAWTEXT(NYS1=53 OR NYS1=54,E1,'沙'),COLORGREEN;
DRAWTEXT(NYS1=55 OR NYS1=56,E1,'天'),COLORRED;
DRAWTEXT(NYS1=57 OR NYS1=58,E1,'石'),COLORGREEN;
DRAWTEXT(NYS1=59 OR NYS1=0,E1,'大'),COLORFFCC00;

E2:=1.5;   
DRAWTEXT(NYS1=2 OR NYS1=1,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=4 OR NYS1=3,E2,'中'),COLORRED;
DRAWTEXT(NYS1=6 OR NYS1=5,E2,'林'),COLORGREEN;
DRAWTEXT(NYS1=8 OR NYS1=7,E2,'旁'),COLORYELLOW;
DRAWTEXT(NYS1=10 OR NYS1=9,E2,'锋'),COLORWHITE;
DRAWTEXT(NYS1=12 OR NYS1=11,E2,'头'),COLORRED;
DRAWTEXT(NYS1=14 OR NYS1=13,E2,'下'),COLORFFCC00;
DRAWTEXT(NYS1=16 OR NYS1=15,E2,'头'),COLOR0099FF;
DRAWTEXT(NYS1=18 OR NYS1=17,E2,'蜡'),COLORWHITE;
DRAWTEXT(NYS1=20 OR NYS1=19,E2,'柳'),COLORGREEN;
DRAWTEXT(NYS1=22 OR NYS1=21,E2,'中'),COLORCYAN;
DRAWTEXT(NYS1=24 OR NYS1=23,E2,'上'),COLORYELLOW;
DRAWTEXT(NYS1=26 OR NYS1=25,E2,'雷'),COLORRED;
DRAWTEXT(NYS1=28 OR NYS1=27,E2,'柏'),COLORGREEN;
DRAWTEXT(NYS1=30 OR NYS1=29,E2,'流'),COLORFFCC00;
DRAWTEXT(NYS1=32 OR NYS1=31,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=34 OR NYS1=33,E2,'下'),COLORRED;
DRAWTEXT(NYS1=36 OR NYS1=35,E2,'地'),COLORGREEN;
DRAWTEXT(NYS1=38 OR NYS1=37,E2,'上'),COLOR0099FF;
DRAWTEXT(NYS1=40 OR NYS1=39,E2,'箔'),COLORWHITE;
DRAWTEXT(NYS1=42 OR NYS1=41,E2,'灯'),COLORRED;
DRAWTEXT(NYS1=44 OR NYS1=43,E2,'河'),COLORFFCC00;
DRAWTEXT(NYS1=46 OR NYS1=45,E2,'驿'),COLOR0099FF;
DRAWTEXT(NYS1=48 OR NYS1=47,E2,'钏'),COLORWHITE;
DRAWTEXT(NYS1=50 OR NYS1=49,E2,'柘'),COLORGREEN;
DRAWTEXT(NYS1=52 OR NYS1=51,E2,'溪'),COLORFFCC00;
DRAWTEXT(NYS1=54 OR NYS1=53,E2,'中'),COLORGREEN;
DRAWTEXT(NYS1=56 OR NYS1=55,E2,'上'),COLORRED;
DRAWTEXT(NYS1=58 OR NYS1=57,E2,'榴'),COLORGREEN;
DRAWTEXT(NYS1=0 OR NYS1=59,E2,'海'),COLORFFCC00;
E3:=0.5;
Z金:=NYS1=1 OR NYS1=2 OR NYS1=9 OR NYS1=10 OR NYS1=17 OR NYS1=18 OR NYS1=31 OR NYS1=32 OR NYS1=39 OR
NYS1=40 OR NYS1=47 OR NYS1=48;
Z火:=NYS1=3 OR NYS1=4 OR NYS1=11 OR NYS1=12 OR NYS1=25 OR NYS1=26 OR NYS1=33 OR NYS1=34 OR NYS1=41 OR
NYS1=42 OR NYS1=55 OR NYS1=56;
Z木:=NYS1=5 OR NYS1=6 OR NYS1=19 OR NYS1=20 OR NYS1=27 OR NYS1=28 OR NYS1=35 OR NYS1=36 OR NYS1=49 OR
NYS1=50 OR NYS1=57 OR NYS1=58;
Z土:=NYS1=7 OR NYS1=8 OR NYS1=15 OR NYS1=16 OR NYS1=23 OR NYS1=24 OR NYS1=37 OR NYS1=38 OR NYS1=45 OR
NYS1=46 OR NYS1=53 OR NYS1=54;
Z水:=NYS1=13 OR NYS1=14 OR NYS1=21 OR NYS1=22 OR NYS1=29 OR NYS1=30 OR NYS1=43 OR NYS1=44 OR NYS1=51 OR
NYS1=52 OR NYS1=59 OR NYS1=0;
DRAWTEXT(Z火,E3,'火'),COLORRED;
DRAWTEXT(Z木,E3,'木'),COLORGREEN;
DRAWTEXT(Z土,E3,'土'),COLORYELLOW;
DRAWTEXT(Z水,E3,'水'),COLORFFCC00;
DRAWTEXT(Z金,E3,'金'),COLORWHITE;

E4:=-1;

JAZ:=MOD(DATETODAY(DATE)+2,7);
DRAWTEXT(JAZ=0,E4,'一'),COLORYELLOW;
DRAWTEXT(JAZ=1,E4,'二'),COLORYELLOW;
DRAWTEXT(JAZ=2,E4,'三'),COLORYELLOW;
DRAWTEXT(JAZ=3,E4,'四'),COLORYELLOW;
DRAWTEXT(JAZ=4,E4,'五'),COLORYELLOW;










金币:
奖励:
热心:
注册时间:
2014-5-28

回复 使用道具 举报

签到天数: 1 天

 楼主| 发表于 2017-7-2 20:22 | 显示全部楼层
这个是版本6编写的.
金币:
奖励:
热心:
注册时间:
2014-5-28

回复 使用道具 举报

签到天数: 1 天

 楼主| 发表于 2017-7-2 20:23 | 显示全部楼层
源码如下:

STICKLINE(ISLASTBAR,-1.5,7.5,3,0),COLORBLUE;



{算八字: 干支从1开始, 1970到1900天数 25567+1 ,1990.12.19到1900的天数 33224+1 ,0.375是收盘修正}
{DD    :=DATEC;}
DD   :=DATE;
{距日  :=DATETOD1970(DD)  +  25568 - 0.375 +1 ,NODRAW;}
距日 :=DATETODAY(DD)    +  33225 - 0.375 +1,NODRAW;
哪年  :=INTPART(DD/10000),NODRAW;
哪节  :=( MOD(INTPART(DD/100),100) -1 ) *2 ,NODRAW;
积日  :=365.242*哪年+6.15+15.2226*哪节-1.9*SIN(0.262*哪节) ,NODRAW;
积日春:=365.242*哪年+6.15+15.2226*  2 -1.9*SIN(0.262* 2  ) ,NODRAW;

年干:MOD(  哪年 -(距日<积日春) +6 ,10) +1 ,NODRAW;
年支:MOD(  哪年 -(距日<积日春)+12 ,12) +1 ,NODRAW;
月干:MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日) +2 ,10) +1 ,NODRAW;
月支:=MOD(  哪年*12+  MOD(INTPART(DD/100),100) -(距日<积日)    ,12) +1 ,NODRAW;
{日干:MOD(DATETOD1970(DD) +7,10) +1 ,NODRAW;}
{日支:MOD(DATETOD1970(DD) +5,12) +1 ,NODRAW;}
日干:=MOD(DATETODAY(DD) +4,10) +1 ,NODRAW;
日支:=MOD(DATETODAY(DD) +6,12) +1 ,NODRAW;





{算八字: 显示}
NGW:=IF(年干=1,'甲',IF(年干=2,'乙',IF(年干=3,'丙',IF(年干=4,'丁',IF(年干=5,'戊',
     IF(年干=6,'己',IF(年干=7,'庚',IF(年干=8,'辛',IF(年干=9,'壬','癸')))))))));
NZW:=IF(年支=1,'子',IF(年支=2,'丑',IF(年支=3,'寅',IF(年支=4,'卯',IF(年支=5,'辰',IF(年支=6,'巳',
     IF(年支=7,'午',IF(年支=8,'未',IF(年支=9,'申',IF(年支=10,'酉',IF(年支=11,'戌','亥')))))))))));
YGW:=IF(月干=1,'甲',IF(月干=2,'乙',IF(月干=3,'丙',IF(月干=4,'丁',IF(月干=5,'戊',
     IF(月干=6,'己',IF(月干=7,'庚',IF(月干=8,'辛',IF(月干=9,'壬','癸')))))))));
YZW:=IF(月支=1,'子',IF(月支=2,'丑',IF(月支=3,'寅',IF(月支=4,'卯',IF(月支=5,'辰',IF(月支=6,'巳',
     IF(月支=7,'午',IF(月支=8,'未',IF(月支=9,'申',IF(月支=10,'酉',IF(月支=11,'戌','亥')))))))))));
RGW:=IF(日干=1,'甲',IF(日干=2,'乙',IF(日干=3,'丙',IF(日干=4,'丁',IF(日干=5,'戊',
     IF(日干=6,'己',IF(日干=7,'庚',IF(日干=8,'辛',IF(日干=9,'壬','癸')))))))));
RZW:=IF(日支=1,'子',IF(日支=2,'丑',IF(日支=3,'寅',IF(日支=4,'卯',IF(日支=5,'辰',IF(日支=6,'巳',
     IF(日支=7,'午',IF(日支=8,'未',IF(日支=9,'申',IF(日支=10,'酉',IF(日支=11,'戌','亥')))))))))));


DRAWTEXT(1,7,YZW),COLOR00FF00;
DRAWTEXT(1,6,RGW),COLOR00FFFF;
DRAWTEXT(1,5,RZW),COLOR00FFFF;


{显示纳音}
NYS1:= MOD(   (6-(日支-日干)/2)*10+日干  ,60) ,NODRAW;
NYS2:= MOD(   (6-(月支-月干)/2)*10+月干  ,60) ,NODRAW;
{显示纳音 : 月}
E0:=3.5;
Z1金:=NYS2=1 OR NYS2=2 OR NYS2=9 OR NYS2=10 OR NYS2=17 OR NYS2=18 OR NYS2=31 OR NYS2=32 OR NYS2=39 OR
NYS2=40 OR NYS2=47 OR NYS2=48;
Z1火:=NYS2=3 OR NYS2=4 OR NYS2=11 OR NYS2=12 OR NYS2=25 OR NYS2=26 OR NYS2=33 OR NYS2=34 OR NYS2=41 OR
NYS2=42 OR NYS2=55 OR NYS2=56;
Z1木:=NYS2=5 OR NYS2=6 OR NYS2=19 OR NYS2=20 OR NYS2=27 OR NYS2=28 OR NYS2=35 OR NYS2=36 OR NYS2=49 OR
NYS2=50 OR NYS2=57 OR NYS2=58;
Z1土:=NYS2=7 OR NYS2=8 OR NYS2=15 OR NYS2=16 OR NYS2=23 OR NYS2=24 OR NYS2=37 OR NYS2=38 OR NYS2=45 OR
NYS2=46 OR NYS2=53 OR NYS2=54;
Z1水:=NYS2=13 OR NYS2=14 OR NYS2=21 OR NYS2=22 OR NYS2=29 OR NYS2=30 OR NYS2=43 OR NYS2=44 OR NYS2=51 OR
NYS2=52 OR NYS2=59 OR NYS2=0;
DRAWTEXT(Z1火,E0,'火'),COLORWHITE;
DRAWTEXT(Z1木,E0,'木'),COLORWHITE;
DRAWTEXT(Z1土,E0,'土'),COLORWHITE;
DRAWTEXT(Z1水,E0,'水'),COLORWHITE;
DRAWTEXT(Z1金,E0,'金'),COLORWHITE;

{显示纳音 : 日子}
E1:=2.5;
DRAWTEXT(NYS1=1 OR NYS1=2,E1,'海'),COLORWHITE;
DRAWTEXT(NYS1=3 OR NYS1=4,E1,'炉'),COLORRED;
DRAWTEXT(NYS1=5 OR NYS1=6,E1,'大'),COLORGREEN;
DRAWTEXT(NYS1=7 OR NYS1=8,E1,'路'),COLORYELLOW;
DRAWTEXT(NYS1=9 OR NYS1=10,E1,'剑'),COLORWHITE;
DRAWTEXT(NYS1=11 OR NYS1=12,E1,'山'),COLORRED;
DRAWTEXT(NYS1=13 OR NYS1=14,E1,'涧'),COLORFFCC00;
DRAWTEXT(NYS1=15 OR NYS1=16,E1,'城'),COLOR0099FF;
DRAWTEXT(NYS1=17 OR NYS1=18,E1,'白'),COLORWHITE;
DRAWTEXT(NYS1=19 OR NYS1=20,E1,'杨'),COLORGREEN;
DRAWTEXT(NYS1=21 OR NYS1=22,E1,'泉'),COLORCYAN;
DRAWTEXT(NYS1=23 OR NYS1=24,E1,'屋'),COLORYELLOW;
DRAWTEXT(NYS1=25 OR NYS1=26,E1,'霹'),COLORRED;
DRAWTEXT(NYS1=27 OR NYS1=28,E1,'松'),COLORGREEN;
DRAWTEXT(NYS1=29 OR NYS1=30,E1,'长'),COLORFFCC00;
DRAWTEXT(NYS1=31 OR NYS1=32,E1,'沙'),COLORWHITE;
DRAWTEXT(NYS1=33 OR NYS1=34,E1,'山'),COLORRED;
DRAWTEXT(NYS1=35 OR NYS1=36,E1,'平'),COLORGREEN;
DRAWTEXT(NYS1=37 OR NYS1=38,E1,'壁'),COLOR0099FF;
DRAWTEXT(NYS1=39 OR NYS1=40,E1,'金'),COLORWHITE;
DRAWTEXT(NYS1=41 OR NYS1=42,E1,'覆'),COLORRED;
DRAWTEXT(NYS1=43 OR NYS1=44,E1,'天'),COLORFFCC00;
DRAWTEXT(NYS1=45 OR NYS1=46,E1,'大'),COLOR0099FF;
DRAWTEXT(NYS1=47 OR NYS1=48,E1,'钗'),COLORWHITE;
DRAWTEXT(NYS1=49 OR NYS1=50,E1,'桑'),COLORGREEN;
DRAWTEXT(NYS1=51 OR NYS1=52,E1,'大'),COLORFFCC00;
DRAWTEXT(NYS1=53 OR NYS1=54,E1,'沙'),COLORGREEN;
DRAWTEXT(NYS1=55 OR NYS1=56,E1,'天'),COLORRED;
DRAWTEXT(NYS1=57 OR NYS1=58,E1,'石'),COLORGREEN;
DRAWTEXT(NYS1=59 OR NYS1=0,E1,'大'),COLORFFCC00;

E2:=1.5;   
DRAWTEXT(NYS1=2 OR NYS1=1,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=4 OR NYS1=3,E2,'中'),COLORRED;
DRAWTEXT(NYS1=6 OR NYS1=5,E2,'林'),COLORGREEN;
DRAWTEXT(NYS1=8 OR NYS1=7,E2,'旁'),COLORYELLOW;
DRAWTEXT(NYS1=10 OR NYS1=9,E2,'锋'),COLORWHITE;
DRAWTEXT(NYS1=12 OR NYS1=11,E2,'头'),COLORRED;
DRAWTEXT(NYS1=14 OR NYS1=13,E2,'下'),COLORFFCC00;
DRAWTEXT(NYS1=16 OR NYS1=15,E2,'头'),COLOR0099FF;
DRAWTEXT(NYS1=18 OR NYS1=17,E2,'蜡'),COLORWHITE;
DRAWTEXT(NYS1=20 OR NYS1=19,E2,'柳'),COLORGREEN;
DRAWTEXT(NYS1=22 OR NYS1=21,E2,'中'),COLORCYAN;
DRAWTEXT(NYS1=24 OR NYS1=23,E2,'上'),COLORYELLOW;
DRAWTEXT(NYS1=26 OR NYS1=25,E2,'雷'),COLORRED;
DRAWTEXT(NYS1=28 OR NYS1=27,E2,'柏'),COLORGREEN;
DRAWTEXT(NYS1=30 OR NYS1=29,E2,'流'),COLORFFCC00;
DRAWTEXT(NYS1=32 OR NYS1=31,E2,'中'),COLORWHITE;
DRAWTEXT(NYS1=34 OR NYS1=33,E2,'下'),COLORRED;
DRAWTEXT(NYS1=36 OR NYS1=35,E2,'地'),COLORGREEN;
DRAWTEXT(NYS1=38 OR NYS1=37,E2,'上'),COLOR0099FF;
DRAWTEXT(NYS1=40 OR NYS1=39,E2,'箔'),COLORWHITE;
DRAWTEXT(NYS1=42 OR NYS1=41,E2,'灯'),COLORRED;
DRAWTEXT(NYS1=44 OR NYS1=43,E2,'河'),COLORFFCC00;
DRAWTEXT(NYS1=46 OR NYS1=45,E2,'驿'),COLOR0099FF;
DRAWTEXT(NYS1=48 OR NYS1=47,E2,'钏'),COLORWHITE;
DRAWTEXT(NYS1=50 OR NYS1=49,E2,'柘'),COLORGREEN;
DRAWTEXT(NYS1=52 OR NYS1=51,E2,'溪'),COLORFFCC00;
DRAWTEXT(NYS1=54 OR NYS1=53,E2,'中'),COLORGREEN;
DRAWTEXT(NYS1=56 OR NYS1=55,E2,'上'),COLORRED;
DRAWTEXT(NYS1=58 OR NYS1=57,E2,'榴'),COLORGREEN;
DRAWTEXT(NYS1=0 OR NYS1=59,E2,'海'),COLORFFCC00;
E3:=0.5;
Z金:=NYS1=1 OR NYS1=2 OR NYS1=9 OR NYS1=10 OR NYS1=17 OR NYS1=18 OR NYS1=31 OR NYS1=32 OR NYS1=39 OR
NYS1=40 OR NYS1=47 OR NYS1=48;
Z火:=NYS1=3 OR NYS1=4 OR NYS1=11 OR NYS1=12 OR NYS1=25 OR NYS1=26 OR NYS1=33 OR NYS1=34 OR NYS1=41 OR
NYS1=42 OR NYS1=55 OR NYS1=56;
Z木:=NYS1=5 OR NYS1=6 OR NYS1=19 OR NYS1=20 OR NYS1=27 OR NYS1=28 OR NYS1=35 OR NYS1=36 OR NYS1=49 OR
NYS1=50 OR NYS1=57 OR NYS1=58;
Z土:=NYS1=7 OR NYS1=8 OR NYS1=15 OR NYS1=16 OR NYS1=23 OR NYS1=24 OR NYS1=37 OR NYS1=38 OR NYS1=45 OR
NYS1=46 OR NYS1=53 OR NYS1=54;
Z水:=NYS1=13 OR NYS1=14 OR NYS1=21 OR NYS1=22 OR NYS1=29 OR NYS1=30 OR NYS1=43 OR NYS1=44 OR NYS1=51 OR
NYS1=52 OR NYS1=59 OR NYS1=0;
DRAWTEXT(Z火,E3,'火'),COLORRED;
DRAWTEXT(Z木,E3,'木'),COLORGREEN;
DRAWTEXT(Z土,E3,'土'),COLORYELLOW;
DRAWTEXT(Z水,E3,'水'),COLORFFCC00;
DRAWTEXT(Z金,E3,'金'),COLORWHITE;

E4:=-1;

JAZ:=MOD(DATETODAY(DATE)+2,7);
DRAWTEXT(JAZ=0,E4,'一'),COLORYELLOW;
DRAWTEXT(JAZ=1,E4,'二'),COLORYELLOW;
DRAWTEXT(JAZ=2,E4,'三'),COLORYELLOW;
DRAWTEXT(JAZ=3,E4,'四'),COLORYELLOW;
DRAWTEXT(JAZ=4,E4,'五'),COLORYELLOW;










参与人数 1奖励 +8 热心 +3 时间 理由
cgf9999 + 8 + 3 2017-11-28 15:12 MACD有楼主更精彩!^_^

查看全部评分

金币:
奖励:
热心:
注册时间:
2014-5-28

回复 使用道具 举报

发表于 2017-7-18 09:07 | 显示全部楼层
能不能显示在主图上 最好有个版本5的公式 多谢楼主
金币:
奖励:
热心:
注册时间:
2008-3-26

回复 使用道具 举报

签到天数: 1292 天

发表于 2017-11-28 15:12 | 显示全部楼层
感谢分享.
金币:
奖励:
热心:
注册时间:
2006-1-28

回复 使用道具 举报

签到天数: 89 天

发表于 2017-11-29 08:54 | 显示全部楼层
道可道2088 发表于 2017-7-2 20:22
这个是版本6编写的.

你好。请问股票上市日如何编译呢?带农历的更好。谢谢~~!!
参与人数 1奖励 +8 热心 +3 时间 理由
cgf9999 + 8 + 3 2017-11-29 09:07 MACD有楼主更精彩!^_^

查看全部评分

金币:
奖励:
热心:
注册时间:
2008-10-30

回复 使用道具 举报

签到天数: 2 天

发表于 2017-12-27 06:20 来自手机 | 显示全部楼层
已收藏,感谢老师!
金币:
奖励:
热心:
注册时间:
2006-3-11

回复 使用道具 举报

签到天数: 73 天

股市捉妖记梅花小孩金融易学家园

发表于 2017-12-29 22:00 来自手机 | 显示全部楼层
感谢楼主,我在通达信手机是复制了楼主的代码,可以用,非常棒!感谢楼主的付出!请问楼主,股票的代码之和在通达信手机上用什么函数写?
金币:
奖励:
热心:
注册时间:
2005-3-15

回复 使用道具 举报

签到天数: 2 天

发表于 2017-12-29 23:19 来自手机 | 显示全部楼层
谢谢了!
金币:
奖励:
热心:
注册时间:
2006-3-11

回复 使用道具 举报

签到天数: 11 天

发表于 2018-5-16 16:20 | 显示全部楼层
功德无量,真心感谢楼主。
金币:
奖励:
热心:
注册时间:
2010-8-3

回复 使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

本站声明:1、本站所有广告均与MACD无关;2、MACD仅提供交流平台,网友发布信息非MACD观点与意思表达,因网友发布的信息造成任何后果,均与MACD无关。
MACD金融网(1997-2016)官方域名:macd.cn   MACD金融网校(2006-2016)官方域名:macdwx.com
值班热线[9:00—18:00]:020-85551719   24小时网站应急电话:18292674919
找回密码、投诉QQ:89918815 友情链接QQ:95008905 广告商务联系QQ:17017506 电话:18292674919
ICP证: 粤ICP备05022117 中华人民共和国增值电信业务经营许可证:粤B2-20070280 茂名市网警备案编号: 4409023010508
安全联盟

粤公网安备 44010602000651号

举报|Archiver|手机版|MACD股票论坛 ( 粤ICP备05022117

GMT+8, 2018-5-26 04:22 , Processed in 0.060593 second(s), 8 queries , MemCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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