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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 经典的指标公式附源码


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

以下是经典的指标公式附源码

自用的3个自动解盘原码(幸福其实离你很近)!


K线诊断NO1

Var1:=ref(open,1)<>ref(close,1) and REF(CLOSE,2)/REF(OPEN,2) > 1.03 AND REF(OPEN,1) > REF(CLOSE,2) AND ABS(REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<0.02 AND CLOSE/OPEN<0.97 AND CLOSE<REF(CLOSE,2);
Var2:=ref(open,1)<>ref(close,1) and REF(CLOSE,2)/REF(OPEN,2) < 0.95 AND REF(OPEN,1) < REF(CLOSE,2) AND ABS(REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<0.03 AND CLOSE/OPEN>1.05 AND CLOSE>REF(CLOSE,2);
Var3:=MIN(OPEN,CLOSE)=LOW AND HIGH-LOW > 3*(MAX(OPEN,CLOSE)-LOW) AND CLOSE < MA(CLOSE,5);
Var4:= MAX(OPEN,CLOSE) AND HIGH-LOW > 3*(HIGH-MIN(OPEN,CLOSE)) AND CLOSE < MA(CLOSE,5);
Var5:=HIGH = MAX(OPEN,CLOSE) AND HIGH-LOW > 3*(HIGH-MIN(OPEN,CLOSE) AND CLOSE > MA(CLOSE,5));
Var6:=REF(CLOSE,1)/REF(OPEN,1)<0.97 AND CLOSE/OPEN>1.03 AND OPEN<REF(CLOSE,1) AND CLOSE>REF(CLOSE,1);
Var7:=(REF(CLOSE,1)/REF(OPEN,1)>1.03 AND CLOSE/OPEN<0.96 AND CLOSE<REF(OPEN,1) AND OPEN>REF(CLOSE,1)) OR (REF(CLOSE,1)/REF(OPEN,1)<0.97 AND CLOSE/OPEN>1.04 AND CLOSE>REF(OPEN,1) AND OPEN<REF(CLOSE,1));
Var8:=ABS(REF(CLOSE,1)-REF(OPEN,1))/REF(CLOSE,1) > 0.04 AND ABS(CLOSE-OPEN)/CLOSE<0.005 AND MAX(CLOSE,OPEN) < MAX(REF(CLOSE,1),REF(OPEN,1)) AND MIN(CLOSE,OPEN) > MIN(REF(CLOSE,1),REF(OPEN,1));
Var9:=ABS(REF(CLOSE,1)-REF(OPEN,1))/REF(CLOSE,1) > 0.04 AND CLOSE=OPEN AND CLOSE < MAX(REF(CLOSE,1),REF(OPEN,1)) AND CLOSE > MIN(REF(CLOSE,1),REF(OPEN,1));
'【K线诊断上】'+
IFS(Var1,'黄昏之星 -空方势盛 反转信号 跳空成弃婴;','')+
IFS(Var2,'晨星 -多方势盛 变盘信号;','')+
IFS(Var3,'倒转槌头 -高位抛压 低位多空争执;','')+
IFS(Var4,'槌头 -下影线有多头意义 在下降趋势之后看涨 注意反弹卖压;','')+
IFS(Var5,'吊颈线 -高档看跌;','')+
IFS(Var6,'曙光 -与乌云盖顶相反 行情将演化为V型反转或止跌横盘趋势;','')+
IFS(Var7,'穿头破脚 -若第一根K为阴(阳) 表强劲上涨(下跌)力量;','')+
IFS(Var8,'身怀六甲 -阴(阳)怀阳(阴)怪异的走势显示该股行情可能转向 若量由大转缩更明;','')+
IFS(Var9,'十字胎 -似身怀六甲 转向可能性更大 量缩观望为宜;','')+
IFS(ABS(HIGH-REF(HIGH,1))/HIGH<0.001,'平顶 -该高点有一定阻力;','')+
IFS(ABS(LOW-REF(LOW,1))/LOW<0.001 and abs(ref(low,1)-ref(low,2))/ref(low,1)<=0.001,'平底 -该低点有一定支撑;','')+
IFS(CLOSE/OPEN>1.05 AND HIGH/LOW < CLOSE/OPEN+0.018,'大阳烛 -上升行情中意味行情剧烈向上攀升 下跌行情中意味行情剧烈向上反弹;','')+
IFS(OPEN/CLOSE > 1.05 AND HIGH/LOW < OPEN/CLOSE+0.018,'大阴烛 -今日空方有绝对优势;','')+
IFS((REF(CLOSE,1)<REF(OPEN,1) AND CLOSE>OPEN AND ABS(CLOSE-REF(CLOSE,1))/CLOSE<0.002) OR (REF(CLOSE,1)>REF(OPEN,1) AND CLOSE<OPEN AND ABS(CLOSE-REF(CLOSE,1))/CLOSE<0.002),'友好反攻 -阴(阳)线结合极线 多方跳低(高)后反弹 有企稳迹象;','')+
IFS(HIGH<REF(LOW,1) OR LOW>REF(HIGH,1),'跳空缺口 -当日未补 有与跳空同向进行欲望强烈 三日为回补观察期;','')


K线诊断NO2MA5:=MA(C,5);
MA10:=MA(C,10);
MA20:=MA(C,20);
'【K线诊断下】'+
IFS(REF(CLOSE,2)>REF(OPEN,2) AND REF(CLOSE,1)>REF(OPEN,1) AND CLOSE>OPEN AND REF(CLOSE,1)>REF(CLOSE,2) AND CLOSE>REF(CLOSE,1),'三白兵 -多方气盛 在底部见底反弹可能;','')+
IFS(REF(CLOSE,2)<REF(OPEN,2) AND REF(CLOSE,1)<REF(OPEN,1) AND CLOSE<OPEN AND REF(CLOSE,1)<REF(CLOSE,2) AND CLOSE<REF(CLOSE,1),'三只乌鸦 -强烈转空趋势 三黑K价越深量越大越易下跌;','')+
IFS(REF(CLOSE,1)<REF(OPEN,1) AND CLOSE<OPEN AND CLOSE/OPEN<0.98,'双飞乌鸦 -多头力竭 行情走软;','')+
IFS(REF(CLOSE,4)/REF(OPEN,4)>1.03 AND REF(CLOSE,3)<REF(OPEN,3) AND REF(CLOSE,2)<REF(OPEN,2) AND REF(CLOSE,1)<REF(OPEN,1) AND REF(LOW,4)<REF(LOW,3) AND REF(LOW,4)<REF(LOW,2) AND REF(LOW,4)<REF(LOW,1) AND REF(HIGH,4)>REF(HIGH,3) AND REF(HIGH,4)>REF(HIGH,2) AND REF(HIGH,4)>REF(HIGH,1) AND CLOSE/OPEN>1.03 AND CLOSE>REF(CLOSE,4),'上升三部曲 -空方卖压被吸纳 趋势易顺势走涨;','')+
IFS(REF(CLOSE,4)/REF(OPEN,4)<0.97 AND REF(CLOSE,3)>REF(OPEN,3) AND REF(CLOSE,2)>REF(OPEN,2) AND REF(CLOSE,1)>REF(OPEN,1) AND REF(LOW,4)<REF(LOW,3) AND REF(LOW,4)<REF(LOW,2) AND REF(LOW,4)<REF(LOW,1) AND REF(HIGH,4)>REF(HIGH,3) AND REF(HIGH,4)>REF(HIGH,2) AND REF(HIGH,4)>REF(HIGH,1) AND CLOSE/OPEN<0.97 AND CLOSE<REF(CLOSE,4),'下跌三部曲 -多方弱势不堪一击 趋势易顺势走跌;','')+
IFS(CLOSE=OPEN AND HIGH<>close and low<>close and high <>close,'十字星 -警告信号 原趋势停顿或反转 依上下影线长度判后市;','')+
IFS((MIN(CLOSE,OPEN)-LOW)/(HIGH-LOW)>0.667,'长下影 -下档支撑强或空方试探进攻;','')+
IFS((HIGH-MAX(CLOSE,OPEN))/(HIGH-LOW)>0.667,'长上影 -上档阻力大或多方试探进攻;','')+
IFS(OPEN=REF(OPEN,1) AND (CLOSE-OPEN)*(REF(CLOSE,1)-REF(OPEN,1))<0,'分离 -两日开盘相同 一阴一阳 变盘前彻底整理;','')+
IFS(HIGH=CLOSE AND HIGH<>LOW,'光头阳线 -今日尾盘多方气盛 可能延续到明天;','')+
IFS(LOW=CLOSE AND HIGH<>LOW,'赤脚阴线 -尾盘空方胜 注意延续次日;','')+
IFS(REF(CLOSE,2)>REF(OPEN,2) AND (REF(CLOSE,2)-REF(OPEN,2))/REF(OPEN,2)>=2/100 AND REF(OPEN,1)>=REF(CLOSE,1) AND (REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<=2/100 AND REF(OPEN,1)<=REF(CLOSE,2) AND REF(CLOSE,1)>=REF(OPEN,2) AND C>=OPEN AND (CLOSE-OPEN)/OPEN>=2/100 AND CLOSE>=REF(OPEN,1) AND OPEN<=REF(CLOSE,1) AND (MAX(CLOSE,REF(C,2))-MIN(CLOSE,REF(CLOSE,2)))/MIN(CLOSE,REF(CLOSE,2))<=1/100,'二阳夹一阴 -必须从后续的走势来研判','')+
IFS(CLOSE=OPEN AND HIGH<>close and low<>close and HIGH/LOW > 1.03,'长十字 -多空激争 前途未明','')+
IFS(CLOSE=OPEN AND CLOSE=LOW AND CLOSE<>HIGH,'垂死十字 -在顶部时重要 表强力多头开始疲软','')+
IFS(REF(CLOSE,2)/REF(OPEN,2) < 0.95 AND REF(OPEN,1) < REF(CLOSE,2) AND REF(OPEN,1)=REF(CLOSE,1)AND CLOSE/OPEN>1.05 AND CLOSE>REF(CLOSE,2),'早晨十字 -同晨星 从看空平衡到看涨 转强 左右跳空曰弃婴','')+
IFS(REF(CLOSE,2)/REF(OPEN,2) > 1.05 AND REF(OPEN,1) > REF(CLOSE,2) AND REF(OPEN,1)=REF(CLOSE,1)AND CLOSE/OPEN<0.95 AND CLOSE<REF(CLOSE,2),'黄昏十字 -同夜星 从看多平衡到看空 转弱 左右跳空曰弃婴','')+
IFS(close<>open and MIN(OPEN,CLOSE)=LOW AND HIGH-LOW > 3*(MAX(OPEN,CLOSE)-LOW) AND CLOSE > MA(CLOSE,5),'射击之星 -如伴大量 上遇阻力 有短期见顶可能 转疲;','')+
IFS((ref(c,1)-ref(o,1)>0 AND c-o<0 AND c<ref(o,1) AND o>ref(c,1)),'阴线吞噬 -黑包红 向空反转;','')+
IFS((ref(c,1)-ref(o,1)>0 AND (ABS(ref(c,1)-ref(o,1)))/(ABS(ref(c,2)-ref(o,2)))>2.5 AND c-o<0 AND c>ref(o,1) AND c<(REF(CLOSE,1)+REF(OPEN,1))/2 AND o>ref(c,1)),'乌云罩顶 -上涨遇重大阻力 空头聚力;','')+
IFS((ref(c,2)-ref(o,2)>0 AND (ABS(ref(c,2)-ref(o,2)))/(ABS(ref(c,3)-ref(o,3)))>2.4 AND ABS(c-o)>3 AND ABS(ref(c,2)-ref(o,2))>(ABS(ref(c,1)-ref(o,1))) AND ref(c,1)-ref(o,1)>0 AND c-o<0 AND ref(o,1) >ref(c,2) AND o<ref(o,1) AND c<ref(c,2) AND c>ref(o,2)) OR (ref(c,2)-ref(o,2)>0 AND (ABS(ref(c,2)-ref(o,2)))/(ABS(ref(c,3)-ref(o,3)))>2.4 AND ABS(c-o)>3 AND (ABS(ref(c,2)-ref(o,2)))>(ABS(ref(c,1)-ref(o,1))) AND ref(c,1)-ref(o,1)<0 AND c-o<0 AND ref(c,1) >ref(c,2) AND c<ref(c,2) AND c>ref(o,2) AND o<ref(c,1)),'夜星 -从看多平衡到看空 转弱 转空;','')+
IFS((ref(c,1)-ref(o,1)>0 AND (ABS(ref(c,1)-ref(o,1)))/(ABS(ref(c,2)-ref(o,2)))>2.4 AND c-o<0 AND c>ref(o,1) AND ref(c,1)-o>2),'空头孕育线 --阳育阴 看空;','')+
IFS((ref(c,1)-ref(o,1)<0 AND c-o<0 AND c>ref(c,1) AND o<ref(o,1) AND o-c <6),'空头孕育线 -阴育阴 看空;','')+
IFS(ref(c,1)<ref(o,1) AND c-o>0 AND c>ref(H,1) AND o<ref(L,1) and ref(O,1)>ref(max(O,C),2) and ref(C,1)>ref(min(O,C),2) and ref(max(O,C),2)>ref(max(O,C),3),'双人殉情 在上升趋势中最后之空头吞噬 也就是所谓的不见长红不回头;','')+
IFS((ref(high,2) -ref(o,2))/ref(high,2)<=0.0003 AND (c-low)/o<=0.0003 AND ref(c,2)<ref(o,2) AND ref(c,2)>ref(o,1) AND ref(c,1)>o AND ref(c,1)<ref(o,1) AND ref(high,1)-ref(o,1)>0 AND ref(low,1)-ref(c,1)<0 AND high-o>0 AND ref(c,2)-ref(low,2)>0 AND c<o,'三胎鸦 -多头走势被扭转 黑K价愈深量愈大 跳空愈大 反转信号愈强;','')+
IFS(REF(CLOSE,1)-REF(OPEN,1)<0 AND CLOSE-OPEN>0 AND OPEN-REF(CLOSE,1)<0 AND CLOSE<REF(OPEN,1) AND CLOSE>REF(CLOSE,1) AND CLOSE>(REF(CLOSE,1)+REF(OPEN,1))/2,'贯穿线 -多头力道的反扑或是空单回补力道 长黑之后开低收在前天1/2之上 多头反转信号;','')+
IFS( c-o<0 AND ref(c,1)-ref(o,1)<0 AND c<ref(c,1) AND o>ref(o,1),'最后吞噬 -在下降趋势中 为一黑一红组合 多头吞噬 在上升趋势中 为一红一黑组合 空头吞噬;','')+
IFS((ref(c,1)-ref(o,1)>0 AND c-o<0 AND c<ref(o,1) AND o>ref(c,1)),'最后吞噬 -在下降趋势中 为一黑一红组合 多头吞噬 在上升趋势中 为一红一黑组合 空头吞噬;','')+
IFS((ref(c,1)-ref(o,1)<0 AND c-o>0 AND c<ref(o,1) AND o>ref(c,1)),'多头孕育线 -阴育阳 多头反转可能;','')+
IFS(REF(CLOSE,4)/REF(OPEN,4)>1.02 AND REF(CLOSE,3)<REF(OPEN,3) AND REF(CLOSE,2)<REF(OPEN,2) AND REF(CLOSE,1)<REF(OPEN,1) AND REF(close,4)<=REF(close,3) AND REF(high,2)<REF(high,3) AND REF(LOW,2)>=REF(open,4) AND REF(high,1)<REF(close,4) AND REF(low,1)>REF(open,4) AND CLOSE/OPEN>1.01 AND open>=REF(open,1) AND CLOSE>=REF(HIGH,3),'连续型态之执垫 -比上升三法更具多头意义;','')+
IFS((ref(c,1)-ref(o,1)<0 AND c-o>0 AND c>ref(o,1) AND o<ref(c,1)),'多头阳线吞噬 -红包黑 反转趋势 配合量;','')+
IFS(open<close and (ref(c,2)-ref(o,2)<0 AND (ref(c,1)-ref(o,1)>0 AND ref(c,1)<ref(o,2) AND ref(o,1)>ref(c,2) AND o>ref(o,2) AND c>ref(c,1))),'内困三日翻红 -一二母子 二量缩 三量增翻红;','')+
IFS((ref(c,2)-ref(o,2)<0 AND (ABS(ref(c,2)-ref(o,2)))/(ABS(ref(c,3)-ref(o,3)))>2.3 AND (ABS(ref(c,2)-ref(o,2)))>(ABS(ref(c,1)-ref(o,1))) AND ABS(c-o)/(ABS(ref(c,1)-ref(o,1)))>2 AND ABS(ABS(c-o)/(ABS(ref(c,2)-ref(o,2))))<2 AND ref(c,1)-ref(o,1)<0 AND c-o>0 AND ref(o,1) <ref(c,2) AND o>ref(o,1) AND c<ref(o,2) AND c>ref(c,2)) OR (ref(c,2)-ref(o,2)<0 AND (ABS(ref(c,2)-ref(o,2)))/(ABS(ref(c,3)-ref(o,3)))>2.3 AND (ABS(ref(c,2)-ref(o,2)))>(ABS(ref(c,1)-ref(o,1))) AND ABS(c-o)/(ABS(ref(c,1)-ref(o,1)))>2 AND ABS(ABS(c-o)/(ABS(ref(c,2)-ref(o,2))))<2 AND ref(c,1)-ref(o,1)>0 AND c-o>0 AND ref(c,1)<ref(c,2) AND c>ref(c,2) AND c<ref(o,2) AND o>ref(c,1)),'晨星 -反多信号;','')+
IFS((ref(c,1)-ref(o,1)>0 AND (ABS(ref(c,1)-ref(o,1)))/(ABS(ref(c,2)-ref(o,2)))>1.5 AND c-o<0 AND c>ref(o,1) AND c<ref(c,1) AND o>ref(c,1)),'乌云罩顶 -上涨遇重大阻力 空头聚力 三日内见九死一生或跌落一红K低点 反转走空;','')+
IFS((O>C and open>MA(C,5) and Open>MA(C,10) and O>MA(C,20) and Close<MA(C,5) and Close<MA(C,10) and Close<MA(C,20)) OR (O<C and open<MA(C,5) and Open<MA(C,10) and O<MA(C,20) and Close>MA(C,5) and Close>MA(C,10) and Close>MA(C,20)),'断头铡刀(出水芙蓉) -一根大阴(阳)线切断了三根均线 如果改变了其后均线的排列为空头(多头)排列 后势看空(多);','')+
IFS(ref(O,1)/ref(C,1) > 1.05 AND ref(H,1)/ref(L,1) < ref(O,1)/ref(C,1)+0.018 and C>O and O<ref(L,1) and C=ref(L,1),'颈上线 -下降趋势 若第二天大量 维持原趋势可能大增;','')+
IFS(ref(O,1)/ref(C,1) > 1.05 AND ref(H,1)/ref(L,1) < ref(O,1)/ref(C,1)+0.018 and C>O and O<ref(L,1) and C<ref(C,1)+(ref(O,1)-ref(C,1))*0.005 and C>ref(C,1)-(ref(O,1)-ref(C,1))*0.005,'颈内线 -下降趋势 比颈上线缓和 若第二天大量 维持原趋势可能大增;','')+
IFS(ref(O,1)/ref(C,1) > 1.05 AND ref(H,1)/ref(L,1) < ref(O,1)/ref(C,1)+0.018 and CLOSE/OPEN>1.05 AND HIGH/LOW < CLOSE/OPEN+0.018 and O<ref(L,1) and C<ref(C,1)+(ref(O,1)-ref(C,1))*0.5 and C>ref(C,1),'戮入线 -代表下跌市场中的失败涨升 下降趋势持续;','')

K线诊断NO3
{lsg 0000}
hh:=100*v/capital;
Var1:=ref(c,1);
var4:=(var1-l)/(h-l);
var5:=v*var4;
var2:=v*var4;
var3:=abs(var2);
var6:=abs(var5);
HSL:=vol/capital*100;
PT := REF(HIGH,1)-REF(LOW,1);
重心:=(HIGH + LOW + CLOSE)/3;
压力Ⅰ:= 2*重心-LOW;
压力Ⅱ:= 重心 + PT;
支撑Ⅰ:= 2.002*重心-HIGH;
支撑Ⅱ:= 重心 - PT;
'【换手率解盘】'+
IFS(hh<2 AND hh>0,'绝对地量:.成交低靡:1%—2%','')+
IFS(hh>=2 and hh<3,'成交温和:2%—3%','')+
IFS(hh>=3 and hh<5,'成交活跃:3%—5%','')+
IFS(hh>=5 and hh<8,'带量:5%—8%','') +
IFS(HSL<=2,'该股票少人关注,属于冷门股。','')+
IFS(HSL>2 AND HSL<3,'该股票成交温和,属于备份股。','')+
IFS(HSL>3 AND HSL<5,'该股票的交投越来越活跃,人们购买该股票的意愿高,属于热门股。','')+
IFS(HSL>5 AND HSL<8,'该股票带量!','')+
IFS(HSL>8 AND HSL<15,'该股票放量!','')+
IFS(HSL>15 AND HSL<25,'该股票巨量!','')+
IFS(HSL>=25,'该股票成交怪异!','')+
'【压力/支撑解盘】'+
IFS(压力Ⅰ=压力Ⅰ and 压力Ⅰ>0,'第一压力位:'+STR(压力Ⅰ,2),'')+
IFS(支撑Ⅰ=支撑Ⅰ and 支撑Ⅰ>0,' #第一支撑位:'+STR(支撑Ⅰ,2),'')+
IFS(压力Ⅱ=压力Ⅱ and 压力Ⅱ>0,' #第二压力位:'+STR(压力Ⅱ,2),'')+
IFS(支撑Ⅱ=支撑Ⅱ and 支撑Ⅱ>0,' #第二支撑位:'+STR(支撑Ⅱ,2),'')



回复

举报

QQ|

GMT+8, 2024-11-20 03:19

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