分时T+0买卖点 分时主图 源码分享
XG:HHV(H,480),DOTLINE,COLORCYAN;RQ:=DATETODAY(DATE)-DATETODAY(REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT))+1;JY:=BARSLAST((RQ-REF(RQ,1))!=WEEKDAY-REF(WEEKDAY,1) OR TOTALBARSCOUNT-CURRBARSCOUNT=0)+1;MA1:=REF(C,JY);MA2:=REF(MA1,JY);MA3:=REF(MA2,JY);MA4:=REF(MA3,JY);MA5:=REF(MA4,JY);MA6:=REF(MA5,JY);MA7:=REF(MA6,JY);MA8:=REF(MA7,JY);MA9:=REF(MA8,JY);H1:=MAX(DYNAINFO(3),DYNAINFO(5));L1:=MIN(DYNAINFO(3),DYNAINFO(6));P1:=H1-L1;阻力:L1+P1*8/9,COLORLIRED,DOTLINE;支撑:L1+P1*0.5/9,COLORGREEN,DOTLINE;均线:IF(BETWEEN(C/(SUM(AMOUNT,0)/SUM(VOL*100,0)),1.05,0.95)=0,MA(C,0),(SUM(AMOUNT,0)/SUM(VOL*100,0))),COLORYELLOW,DOTLINE;DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))+DYNAINFO(3);DEA:=EMA(DIF,9);MACD1:=10*(DIF-DEA);MACD2:=EMA(MACD1,2);STICKLINE(MACD1>=MACD2 AND MACD1>=0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLIGRAY;STICKLINE(MACD1<MACD2 AND MACD1>0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLICYAN;STICKLINE(MACD1>=MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLIGRAY;STICKLINE(MACD1<MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLIGREEN;XX:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(V*100,BARSCOUNT(CLOSE));主力:=EXPMA(CLOSE/XX,20);大户:=EXPMA(CLOSE/XX,60);散户:=EXPMA(CLOSE/XX,120);底:=1;1.022,NODRAW;高:=1.033;DRAWTEXT(CROSS(主力,1.02),C*0.999,' 拉'),COLORMAGENTA;DRAWICON(CROSS(主力,1.04),C,45);DRAWTEXT(CROSS(主力,1.04),C*0.999,' 冲'),COLORRED;A1:=(VOL/CLOSE)/3;A2:=SUM((IF(((A1>40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0);A3:=SUM((IF(((A1>40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0);A4:=SUM((IF(((A1<40) AND (CLOSE>(REF(CLOSE,1)))),A1,0)),0);A5:=SUM((IF(((A1<40) AND (CLOSE<(REF(CLOSE,1)))),A1,0)),0);A6:=((A2+A3)+A4)+A5;A7:=IF((BARSTATUS=2),((100*A2)/A6),0);A8:=((IF((BARSTATUS=2),((100*A3)/A6),0)));A9:=((IF((BARSTATUS=2),((100*A4)/A6),0)));A10:=((IF((BARSTATUS=2),((100*A5)/A6),0)));DRAWTEXT(LONGCROSS(支撑,C,2),C-0.01,' 买入'),COLOR0000FF;DRAWICON(LONGCROSS(支撑,C,2),C-0.01,1);STICKLINE(LONGCROSS(支撑,C,2),C,阻力,0,-1),COLORCYAN;DRAWTEXT(LONGCROSS(C,阻力,2),C+0.01,' 卖出'),COLORGREEN;DRAWICON(LONGCROSS(C,阻力,2),C+0.01,45);
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出XG:480日内H最高值,DOTLINE,画青色
RQ赋值:DATETODAY(DATE)-DATETODAY(TOTALBARSCOUNT- 到最后交易的周期日前的DATE)+1
JY赋值:上次(RQ-1日前的RQ距今天数!=WEEKDAY-1日前的WEEKDAY OR TOTALBARSCOUNT- 到最后交易的周期=0)+1
MA1赋值:JY日前的C
MA2赋值:JY日前的MA1
MA3赋值:JY日前的MA2
MA4赋值:JY日前的MA3
MA5赋值:JY日前的MA4
MA6赋值:JY日前的MA5
MA7赋值:JY日前的MA6
MA8赋值:JY日前的MA7
MA9赋值:JY日前的MA8
H1赋值:MAX(DYNAINFO(3),DYNAINFO(5))
L1赋值:MIN(DYNAINFO(3),DYNAINFO(6))
P1赋值:H1-L1
输出阻力:L1+P1*8/9,COLORLIRED,DOTLINE
输出支撑:L1+P1*0.5/9,画绿色,DOTLINE
输出均线:IF(BETWEEN(C/(0的成交额日累和/0的成交量*100日累和),1.05,0.95)=0,C的0日简单移动平均,(0的成交额日累和/0的成交量*100日累和)),画黄色,DOTLINE
DIF赋值:(收盘价的12日指数移动平均-收盘价的26日指数移动平均)+DYNAINFO(3)
DEA赋值:DIF的9日指数移动平均
MACD1赋值:10*(DIF-DEA)
MACD2赋值:MACD1的2日指数移动平均
STICKLINE(MACD1>=MACD2 AND MACD1>=0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLIGRAY
STICKLINE(MACD10,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLICYAN
STICKLINE(MACD1>=MACD2 AND MACD1<0,DYNAINFO(3),MACD1+DYNAINFO(3),0,-1),COLORLIGRAY
STICKLINE(MACD1XX赋值:SUM(成交额,收盘价的有效数据周期数)/SUM(V*100,收盘价的有效数据周期数)
主力赋值:收盘价/XX的20日指数移动平均
大户赋值:收盘价/XX的60日指数移动平均
散户赋值:收盘价/XX的120日指数移动平均
底赋值:1
1.022,NODRAW
高赋值:1.033
DRAWTEXT(主力上穿1.02,C*0.999,' 拉'),画洋红色
DRAWICON(主力上穿1.04,C,45)
DRAWTEXT(主力上穿1.04,C*0.999,' 冲'),画红色
A1赋值:(成交量/收盘价)/3
A2赋值:SUM((IF(((A1>40) AND (收盘价>(1日前的收盘价))),A1,0)),0)
A3赋值:SUM((IF(((A1>40) AND (收盘价<(1日前的收盘价))),A1,0)),0)
A4赋值:SUM((IF(((A1<40) AND (收盘价>(1日前的收盘价))),A1,0)),0)
A5赋值:SUM((IF(((A1<40) AND (收盘价<(1日前的收盘价))),A1,0)),0)
A6赋值:((A2+A3)+A4)+A5
A7赋值:IF((BARSTATUS=2),((100*A2)/A6),0)
A8赋值:((IF((BARSTATUS=2),((100*A3)/A6),0)))
A9赋值:((IF((BARSTATUS=2),((100*A4)/A6),0)))
A10:=((IF((BARSTATUS=2),((100*A5)/A6),0)))
DRAWTEXT(LONGCROSS(支撑,C,2),C-0.01,' 买入'),COLOR0000FF
DRAWICON(LONGCROSS(支撑,C,2),C-0.01,1)
STICKLINE(LONGCROSS(支撑,C,2),C,阻力,0,-1),画青色
DRAWTEXT(LONGCROSS(C,阻力,2),C+0.01,' 卖出'),画绿色
DRAWICON(LONGCROSS(C,阻力,2),C+0.01,45)