以下是通达信一个算卦的指标源码

一个算卦的指标。

 把最近6日的阴阳K线,转成阴阳爻。别问我有没有用。新鲜出炉,蛋疼写着玩的。

DRAWRECTREL(10,50,CONST(IF(C>REF(C,1),100,50)),100,255),NOFRAME;

DRAWRECTREL(60,50,100,100,255),NOFRAME;

DRAWRECTREL(10,150,CONST(IF(REF(C,1)>REF(C,2),100,50)),200,255),NOFRAME;

DRAWRECTREL(60,150,100,200,255),NOFRAME;

DRAWRECTREL(10,250,CONST(IF(REF(C,2)>REF(C,3),100,50)),300,255),NOFRAME;

DRAWRECTREL(60,250,100,300,255),NOFRAME;

DRAWRECTREL(10,350,CONST(IF(REF(C,3)>REF(C,4),100,50)),400,255),NOFRAME;

DRAWRECTREL(60,350,100,400,255),NOFRAME;

DRAWRECTREL(10,450,CONST(IF(REF(C,4)>REF(C,5),100,50)),500,255),NOFRAME;

DRAWRECTREL(60,450,100,500,255),NOFRAME;

DRAWRECTREL(10,550,CONST(IF(REF(C,5)>REF(C,6),100,50)),600,255),NOFRAME;

DRAWRECTREL(60,550,100,600,255),NOFRAME;

BM:=CONST(IF(C>REF(C,1),32,0))+

CONST(IF(REF(C,1)>REF(C,2),16,0))+

CONST(IF(REF(C,2)>REF(C,3),8,0))+

CONST(IF(REF(C,3)>REF(C,4),4,0))+

CONST(IF(REF(C,4)>REF(C,5),2,0))+

CONST(IF(REF(C,5)>REF(C,6),1,0));

DRAWTEXT_FIX(BM=0,0.15,0.20,0,’坤 坤为地 坤上坤下 《坤》:元亨。利牝马之贞。君子有攸往,先迷,后得主,利。西南得朋,东北丧朋。安贞吉。’);

DRAWTEXT_FIX(BM=1,0.15,0.20,0,’复 地雷复 坤上震下 《复》:亨。出入无疾。朋来无咎。反覆其道,七日来复,利有攸往。’);

DRAWTEXT_FIX(BM=2,0.15,0.20,0,’师 地水师 坤上坎下 《师》:贞丈人吉,无咎。’);

DRAWTEXT_FIX(BM=3,0.15,0.20,0,’临 地泽临 坤上兑下 《临》:元亨,利贞。至于八月有凶。’);

DRAWTEXT_FIX(BM=4,0.15,0.20,0,’谦 地山谦 坤上艮下 《谦》:亨。君子有终。’);

DRAWTEXT_FIX(BM=5,0.15,0.20,0,’明夷 地火明夷 坤上离下 《明夷》:利艰贞。’);

DRAWTEXT_FIX(BM=6,0.15,0.20,0,’升 地风升 坤上巽下 《升》:元亨。用见大人,勿恤。南征吉。’);

DRAWTEXT_FIX(BM=7,0.15,0.20,0,’泰 天地泰 坤上乾下 《泰》:小往大来,吉,亨。’);

DRAWTEXT_FIX(BM=8,0.15,0.20,0,’豫 雷地豫 震上坤下 《豫》:利建侯行师。’);

DRAWTEXT_FIX(BM=9,0.15,0.20,0,’震 震为雷 震上震下 《震》:亨。震来XIXI,笑言哑哑,震惊百里,不丧匕鬯。’);

DRAWTEXT_FIX(BM=10,0.15,0.20,0,’解 雷水解 震上坎下 《解》:利西南。无所往,其来复吉。有攸往,夙吉。’);

DRAWTEXT_FIX(BM=11,0.15,0.20,0,’归妹 雷泽归妹 震上兑下 《归妹》:征凶,无攸利。’);

DRAWTEXT_FIX(BM=12,0.15,0.20,0,’小过 雷山小过 震上艮下 《小过》:亨。利贞。可小事,不可大事。飞鸟遗之音,不宜上,宜下,大吉。’);

DRAWTEXT_FIX(BM=13,0.15,0.20,0,’丰 雷火丰 震上离下 《丰》:亨,王假之。勿忧,宜日中。’);

DRAWTEXT_FIX(BM=14,0.15,0.20,0,’恒 雷风恒 震上巽下 《恒》:亨。无咎。利贞。利有攸往。’);

DRAWTEXT_FIX(BM=15,0.15,0.20,0,’大壮 雷天大壮 震上乾下 《大壮》:利贞。’);

DRAWTEXT_FIX(BM=16,0.15,0.20,0,’比 水地比 坎上坤下 《比》:吉。原筮,元,永贞,无咎。不宁方来,后夫凶。’);

DRAWTEXT_FIX(BM=17,0.15,0.20,0,’屯 水雷屯 坎上震下 《屯》:元亨,利贞。勿用有攸往。利建侯。’);

DRAWTEXT_FIX(BM=18,0.15,0.20,0,’坎 坎为水 坎上坎下 《习坎》:有孚维心,亨。行有尚。’);

DRAWTEXT_FIX(BM=19,0.15,0.20,0,’节 水泽节 坎上兑下 《节》:亨。苦节,不可贞。’);

DRAWTEXT_FIX(BM=20,0.15,0.20,0,’蹇 水山蹇 坎上艮下 《蹇》:利西南,不利东北。利见大人。贞吉。’);

DRAWTEXT_FIX(BM=21,0.15,0.20,0,’既济 水火既济 坎上离下 《既济》:亨小,利贞。初吉终乱。’);

DRAWTEXT_FIX(BM=22,0.15,0.20,0,’井 水风井 坎上巽下 《井》:改邑不改井,无丧无得。往来井井。汔至,亦未JV井,羸其瓶,凶。’);

DRAWTEXT_FIX(BM=23,0.15,0.20,0,’需 水天需 坎上乾下 《需》:有孚,光亨。贞吉,利涉大川。’);

DRAWTEXT_FIX(BM=24,0.15,0.20,0,’萃 泽地萃 兑上坤下 《萃》:亨,王假有庙。利见大人。亨,利贞,用大牲吉。利有攸往。’);

DRAWTEXT_FIX(BM=25,0.15,0.20,0,’随 泽雷随 兑上震下 《随》:元亨,利贞,无咎。’);

DRAWTEXT_FIX(BM=26,0.15,0.20,0,’困 泽水困 兑上坎下 《困》:亨。贞大人吉,无咎。有言不信。’);

DRAWTEXT_FIX(BM=27,0.15,0.20,0,’兑 兑为泽 兑上兑下 《兑》:亨。利贞。’);

DRAWTEXT_FIX(BM=28,0.15,0.20,0,’咸 泽山咸 兑上艮下 《咸》:亨。利贞。取女吉。’);

DRAWTEXT_FIX(BM=29,0.15,0.20,0,’革 泽火革 兑上离下 《革》:已日乃孚。元亨。利贞,悔亡。’);

DRAWTEXT_FIX(BM=30,0.15,0.20,0,’大过 泽风大过 兑上巽下 《大过》:栋挠,利有攸往,亨。’);

DRAWTEXT_FIX(BM=31,0.15,0.20,0,’夬 泽天夬 兑上乾下 《夬》:扬于王庭,孚号。有厉,告自邑。不利即戎,利有攸往。’);

DRAWTEXT_FIX(BM=32,0.15,0.20,0,’剥 山地剥 艮上坤下 《剥》:不利有攸往。’);

DRAWTEXT_FIX(BM=33,0.15,0.20,0,’颐 山雷颐 艮上震下 《颐》:贞吉。观颐,自求口实。’);

DRAWTEXT_FIX(BM=34,0.15,0.20,0,’蒙 山水蒙 艮上坎下 《蒙》:亨。匪我求童蒙,童蒙求我。初筮告,再三渎,渎则不告。利贞。’);

DRAWTEXT_FIX(BM=35,0.15,0.20,0,’损 山泽损 艮上兑下 《损》:有孚,元吉,无咎。可贞,利有攸往。曷之用?二簋可用享。’);

DRAWTEXT_FIX(BM=36,0.15,0.20,0,’艮 艮为山 艮上艮下 《艮》:艮其背,不获其身,行其庭,不见其人,无咎。’);

DRAWTEXT_FIX(BM=37,0.15,0.20,0,’贲 山火贲 艮上离下 《贲》:亨。小利有攸往。’);

DRAWTEXT_FIX(BM=38,0.15,0.20,0,’蛊 山风蛊 艮上巽下 《蛊》:元亨。利涉大川,先甲三日,后甲三日。’);

DRAWTEXT_FIX(BM=39,0.15,0.20,0,’大畜 山天大畜 艮上乾下 《大畜》:利贞。不家食吉。利涉大川。’);

DRAWTEXT_FIX(BM=40,0.15,0.20,0,’晋 火地晋 离上坤下 《晋》:康侯用锡马蕃庶,昼日三接。’);

DRAWTEXT_FIX(BM=41,0.15,0.20,0,’噬嗑 火雷噬嗑 离上震下 《噬嗑》:亨。利用狱。’);

DRAWTEXT_FIX(BM=42,0.15,0.20,0,’未济 火水未济 离上坎下 《未济》:亨。小狐汔济,濡其尾,无攸利。’);

DRAWTEXT_FIX(BM=43,0.15,0.20,0,’睽 火泽睽 离上兑下 《睽》:小事吉。’);

DRAWTEXT_FIX(BM=44,0.15,0.20,0,’旅 火山旅 离上艮下 《旅》:小亨。旅贞吉。’);

DRAWTEXT_FIX(BM=45,0.15,0.20,0,’离 离为火 离上离下 《离》:利贞。亨。畜牝牛吉。’);

DRAWTEXT_FIX(BM=46,0.15,0.20,0,’鼎 火风鼎 离上巽下 《鼎》:元吉,亨。’);

DRAWTEXT_FIX(BM=47,0.15,0.20,0,’大有 火天大有 离上乾下 《大有》:元亨。’);

DRAWTEXT_FIX(BM=48,0.15,0.20,0,’观 风地观 巽上坤下 《观》:盥而不荐。有孚YONG若’);

DRAWTEXT_FIX(BM=49,0.15,0.20,0,’益 风雷益 巽上震下 《益》:利有攸往。利涉大川。’);

DRAWTEXT_FIX(BM=50,0.15,0.20,0,’涣 风水涣 巽上坎下 《涣》:亨。王假有庙。利涉大川,利贞。’);

DRAWTEXT_FIX(BM=51,0.15,0.20,0,’中孚 风泽中孚 巽上兑下 《中孚》:豚鱼,吉。利涉大川,利贞。’);

DRAWTEXT_FIX(BM=52,0.15,0.20,0,’渐 风山渐 巽上艮下 《渐》:女归吉,利贞。’);

DRAWTEXT_FIX(BM=53,0.15,0.20,0,’家人 风火家人 巽上离下 《家人》:利女贞。’);

DRAWTEXT_FIX(BM=54,0.15,0.20,0,’巽 巽为风 巽上巽下 《巽》:小亨。利有攸往。利见大人。’);

DRAWTEXT_FIX(BM=55,0.15,0.20,0,’小畜 风天小畜 巽上乾下 《小畜》:亨。密云不雨。自我西郊。’);

DRAWTEXT_FIX(BM=56,0.15,0.20,0,’否 地天否 乾上坤下 《否》:否之匪人,不利君子贞,大往小来。’);

DRAWTEXT_FIX(BM=57,0.15,0.20,0,’无妄 天雷无妄 乾上震下 《无妄》:元亨,利贞。其匪正有眚,不利有攸往。’);

DRAWTEXT_FIX(BM=58,0.15,0.20,0,’讼 天水讼 乾上坎下 《讼》:有孚窒惕,中吉,终凶。利见大人。不利涉大川。’);

DRAWTEXT_FIX(BM=59,0.15,0.20,0,’履 天泽履 乾上兑下 《履》:履虎尾,不咥人。亨。’);

DRAWTEXT_FIX(BM=60,0.15,0.20,0,’遁 天山遁 乾上艮下 《遁》:亨。小利贞。’);

DRAWTEXT_FIX(BM=61,0.15,0.20,0,’同人 天火同人 乾上离下 《同人》:同人于野,亨。利涉大川。利君子贞。’);

DRAWTEXT_FIX(BM=62,0.15,0.20,0,’姤 天风姤 乾上巽下 《姤》:女壮,勿用取女。’);

DRAWTEXT_FIX(BM=63,0.15,0.20,0,’乾 乾为天 乾上乾下 《乾》:元亨利贞。’);

谢谢各位打偿。写公式时,是写的副图。弄到主图里,卦画看起来不太好。可以添加在原来的某些副图指标后面。在原有指标后,加上一句

DRAWRECTREL(0,0,700,999,1),NOFRAME;留出空间,再复制上这个指标。

易经我也没法解释,写不出白话来。只有照搬原文的卦辞。受通达信指标输出个数限制,没更把爻辞写上
 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。