通达信【猎豹分时T0】分时主图指标 做T神器 闪电狙击决胜分时 源码
{分时引用源码如下}
T0:=REF(CLOSE,1);
T1:=REF(MAX(HIGH,T0),1);
T2:=REF(MIN(LOW,T0),1);
MACS:(MA((((T1 - T2) / REF(CLOSE,2)) * 100),5) /9);
EMACS:(EMA((((T1 - T2) / REF(CLOSE,2)) * 100),5) /6);
NOTEXT前收盘价:REF(CLOSE,1);
NOTEXT上市周期:BARSSINCE(CLOSE);
NOTEXTMA5:MA(CLOSE,5);
NOTEXTMA10:MA(CLOSE,10);
NOTEXTMA20:MA(CLOSE,20);
NOTEXTMA60:MA(CLOSE,60);
NOTEXTRMA5:REF(MA(CLOSE,5),1);
NOTEXTRMA10:REF(MA(CLOSE,10),1);
NOTEXTRMA20:REF(MA(CLOSE,20),1);
NOTEXTRMA60:REF(MA(CLOSE,60),1);
NOTEXT大盘价位:INDEXC;
NOTEXT昨日大盘:REF(INDEXC,1);
{分时主图源码如下}
ATM:=150;
ATN:=2000.00;
ATV:=3000.00;
现价:CLOSE,COLORWHITE,LINETHICK2;
T1:=(BARSLAST(((HOUR = 9) AND (MINUTE = 31))) + 1);
T2:=SUM(CLOSE*VOL,BARSCOUNT(C))/SUM(VOL,BARSCOUNT(C));
T3:=(SUM((CLOSE * VOL),0) / SUM(VOL,0));
T4:=(((SETCODE = 0) OR (SETCODE = 1)) AND (CLOSE < 500));
均价:=IF(T4,T2,T3),COLORYELLOW;
T11:="分时引用.MACS#DAY";
T12:=(T11 * 1.3);
T15:=((CLOSE > REF(CLOSE,1)) AND ((CLOSE / 均价) > (1 + (T11 / 100))));
T16:=((CLOSE < REF(CLOSE,1)) AND ((CLOSE / 均价) < (1 - (T11 / 100))));
HH1:=((REF(SUM(T15,0),1) = 0) AND (SUM(T15,0) = 1));
LL1:=((REF(SUM(T16,0),1) = 0) AND (SUM(T16,0) = 1));
T19:=(SUM(HH1,0) * CROSS(COUNT((CLOSE < REF(CLOSE,1)),BARSLAST(HH1)),0.5));
T20:=(SUM(LL1,0) * CROSS(COUNT((CLOSE > REF(CLOSE,1)),BARSLAST(LL1)),0.5));
CS1:CONST(SUM(IF(T19,REF(CLOSE,1),DRAWNULL),0)),COLORGREEN,LINETHICK2;
CB1:CONST(SUM(IF(T20,REF(CLOSE,1),DRAWNULL),0)),COLORLIMAGENTA,LINETHICK2;
HH2:=CROSS(SUM((T15 AND (CLOSE > (CS1 * (1 + (T12 / 100))))),0),0.5);
LL2:=CROSS(SUM((T16 AND (CLOSE < (CB1 * (1 - (T12 / 100))))),0),0.5);
T25:=(SUM(HH2,0) * CROSS(COUNT((CLOSE < REF(CLOSE,1)),BARSLAST(HH2)),0.5));
T26:=(SUM(LL2,0) * CROSS(COUNT((CLOSE > REF(CLOSE,1)),BARSLAST(LL2)),0.5));
CS2:CONST(SUM(IF(T25,REF(CLOSE,1),DRAWNULL),0)),COLORGREEN,LINETHICK3;
CB2:CONST(SUM(IF(T26,REF(CLOSE,1),DRAWNULL),0)),COLORLIMAGENTA,LINETHICK3;
DRAWICON((HH1 OR HH2),(CLOSE * 1.001),2);
DRAWICON((LL1 OR LL2),(CLOSE * 0.999),1);
DRAWICON((T20 OR T26),(REF(CLOSE,1) * 0.999),42);
DRAWICON((T19 OR T25),(REF(CLOSE,1) * 1.001),43);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{分时引用源码如下}T0赋值:1日前的收盘价
T1赋值:REF(最高价和T0较大值,1)
T2赋值:REF(最低价和T0的较小值,1)
输出MACS:(MA((((T1 - T2) / 2日前的收盘价) * 100),5) /9)
E输出MACS:(EMA((((T1 - T2) / 2日前的收盘价) * 100),5) /6)
输出NOTEXT前收盘价:1日前的收盘价
输出NOTEXT上市周期:BARSSINCE(收盘价)
输出NOTEXTMA5:收盘价的5日简单移动平均
输出NOTEXTMA10:收盘价的10日简单移动平均
输出NOTEXTMA20:收盘价的20日简单移动平均
输出NOTEXTMA60:收盘价的60日简单移动平均
输出NOTEXTRMA5:REF(收盘价的5日简单移动平均,1)
输出NOTEXTRMA10:REF(收盘价的10日简单移动平均,1)
输出NOTEXTRMA20:REF(收盘价的20日简单移动平均,1)
输出NOTEXTRMA60:REF(收盘价的60日简单移动平均,1)
输出NOTEXT大盘价位:INDEXC
输出NOTEXT昨日大盘:1日前的INDEXC
{分时主图源码如下}ATM赋值:150
ATN赋值:2000.00
ATV赋值:3000.00
输出现价:收盘价,画白色, 线宽为2
T1赋值:(上次((HOUR = 9距今天数 AND (MINUTE = 31))) + 1)
T2赋值:SUM(收盘价*成交量,C的有效数据周期数)/SUM(成交量,C的有效数据周期数)
T3赋值:(SUM((收盘价 * 成交量),0) / SUM(成交量,0))
T4赋值:(((SETCODE = 0) OR (SETCODE = 1)) AND (收盘价 < 500))
如果T4返回T2否则返回T3
T11:="分时引用.MACS#DAY"
T12:=(T11 * 1.3)
T15:=((收盘价 > 1日前的收盘价) AND ((收盘价 / 均价) > (1 + (T11 / 100))))
T16:=((收盘价 < 1日前的收盘价) AND ((收盘价 / 均价) < (1 - (T11 / 100))))
HH1赋值:((REF(0的T15日累和,1) = 0) AND (0的T15日累和 = 1))
LL1赋值:((REF(0的T16日累和,1) = 0) AND (0的T16日累和 = 1))
T19:=(0的HH1日累和 * CROSS(COUNT((收盘价 < 1日前的收盘价),上次HH1距今天数),0.5))
T20:=(0的LL1日累和 * CROSS(COUNT((收盘价 > 1日前的收盘价),上次LL1距今天数),0.5))
输出CS1:CONST(SUM(IF(T19,1日前的收盘价,DRAWNULL),0)),画绿色, 线宽为2
输出CB1:CONST(SUM(IF(T20,1日前的收盘价,DRAWNULL),0)),COLORLIMAGENTA, 线宽为2
HH2赋值:CROSS(SUM((T15 AND (收盘价 > (CS1 * (1 + (T12 / 100))))),0),0.5)
LL2赋值:CROSS(SUM((T16 AND (收盘价 < (CB1 * (1 - (T12 / 100))))),0),0.5)
T25:=(0的HH2日累和 * CROSS(COUNT((收盘价 < 1日前的收盘价),上次HH2距今天数),0.5))
T26:=(0的LL2日累和 * CROSS(COUNT((收盘价 > 1日前的收盘价),上次LL2距今天数),0.5))
输出CS2:CONST(SUM(IF(T25,1日前的收盘价,DRAWNULL),0)),画绿色, 线宽为3
输出CB2:CONST(SUM(IF(T26,1日前的收盘价,DRAWNULL),0)),COLORLIMAGENTA, 线宽为3
DRAWICON((HH1 OR HH2),(收盘价 * 1.001),2)
DRAWICON((LL1 OR LL2),(收盘价 * 0.999),1)
DRAWICON((T20 OR T26),(1日前的收盘价 * 0.999),42)
DRAWICON((T19 OR T25),(1日前的收盘价 * 1.001),43)