逍遥分时主图通达信分时主图 源码
N:=0;
M:=1;
J1:CLOSE,COLORWHITE;
J2:ZSTJJ,COLORYELLOW;
GSPT1:=SUM(CLOSE*VOL,240)/SUM(VOL,240);
GSPT2:=SUM(CLOSE*VOL,0)/SUM(VOL,0);
GSPT3:=SUM(CLOSE*VOL,240)/SUM(VOL,240);
GSPT4:=CLOSE>REF(CLOSE,1) AND CLOSE/J2>1+N/1000;
GSPT5:=CLOSE< REF(CLOSE,1) AND CLOSE/J2< 1-N/1000;
GSPT6:=CROSS(SUM(GSPT4,0),0.5);
GSPT7:=CROSS(SUM(GSPT5,0),0.5);
GSPT8:=SUM(GSPT6,0)*CROSS(COUNT(CLOSE< REF(CLOSE,1),BARSLAST(GSPT6)),0.5);
GSPT9:=SUM(GSPT7,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(GSPT7)),0.5);
F1:CONST(SUM(IF(GSPT8,REF(CLOSE,1),DRAWNULL),0)),DOTLINE,COLORWHITE;
F2:CONST(SUM(IF(GSPT9,REF(CLOSE,1),DRAWNULL),0)),DOTLINE,COLORGREEN;
GSPT10:=CROSS(SUM(GSPT4 AND CLOSE>F1*(1+M/100),0),0.5);
GSPT11:=CROSS(SUM(GSPT5 AND CLOSE< F2*(1-M/100),0),0.5);
GSPT12:=SUM(GSPT10,0)*CROSS(COUNT(CLOSE< REF(CLOSE,1),BARSLAST(GSPT10)),0.5);
GSPT13:=SUM(GSPT11,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(GSPT11)),0.5);
F3:CONST(SUM(IF(GSPT12,REF(CLOSE,1),DRAWNULL),0)),COLORWHITE;
F4:CONST(SUM(IF(GSPT13,REF(CLOSE,1),DRAWNULL),0)),COLORGREEN;
DRAWICON(GSPT8,REF(CLOSE*1.002,1),2);
DRAWICON(GSPT12,REF(CLOSE*1.002,1),35);
DRAWICON(GSPT9,REF(CLOSE*0.998,1),1);
DRAWICON(GSPT13,REF(CLOSE*0.998,1),34);
GSPT14:=CLOSE>REF(CLOSE,1) AND CLOSE/J2>1+5/100;
GSPT15:=CLOSE< REF(CLOSE,1) AND CLOSE/J2< 1-5/100;
GSPT16:=CROSS(SUM(GSPT14,0),0.5);
GSPT17:=CROSS(SUM(GSPT15,0),0.5);
GSPT18:=SUM(GSPT16,0)*CROSS(COUNT(CLOSE< REF(CLOSE,1),BARSLAST(GSPT16)),0.5);
GSPT19:=SUM(GSPT17,0)*CROSS(COUNT(CLOSE>REF(CLOSE,1),BARSLAST(GSPT17)),0.5);
GSPT20:=CONST(SUM(IF(GSPT18,REF(CLOSE,1),DRAWNULL),0));
GSPT21:=CONST(SUM(IF(GSPT19,REF(CLOSE,1),DRAWNULL),0));
DRAWICON(GSPT18,REF(CLOSE*1.002,1),15);
DRAWICON(GSPT19,REF(CLOSE*0.998,1),9);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:0
M赋值:1
输出J1:收盘价,画白色
输出J2:ZSTJJ,画黄色
GSPT1赋值:240的收盘价*成交量日累和/240的成交量日累和
GSPT2赋值:0的收盘价*成交量日累和/0的成交量日累和
GSPT3赋值:240的收盘价*成交量日累和/240的成交量日累和
GSPT4赋值:收盘价>1日前的收盘价 AND 收盘价/J2>1+N/1000
GSPT5赋值:收盘价< 1日前的收盘价 AND 收盘价/J2< 1-N/1000
GSPT6赋值:CROSS(0的GSPT4日累和,0.5)
GSPT7赋值:CROSS(0的GSPT5日累和,0.5)
GSPT8赋值:0的GSPT6日累和*CROSS(COUNT(收盘价< 1日前的收盘价,上次GSPT6距今天数),0.5)
GSPT9赋值:0的GSPT7日累和*CROSS(COUNT(收盘价>1日前的收盘价,上次GSPT7距今天数),0.5)
输出F1:CONST(SUM(IF(GSPT8,1日前的收盘价,DRAWNULL),0)),DOTLINE,画白色
输出F2:CONST(SUM(IF(GSPT9,1日前的收盘价,DRAWNULL),0)),DOTLINE,COLORGREEN
GSPT10:=CROSS(SUM(GSPT4 AND 收盘价>F1*(1+M/100),0),0.5)
GSPT11:=CROSS(SUM(GSPT5 AND 收盘价< F2*(1-M/100),0),0.5)
GSPT12:=0的GSPT10日累和*CROSS(COUNT(收盘价< 1日前的收盘价,上次GSPT10距今天数),0.5)
GSPT13:=0的GSPT11日累和*CROSS(COUNT(收盘价>1日前的收盘价,上次GSPT11距今天数),0.5)
输出F3:CONST(SUM(IF(GSPT12,1日前的收盘价,DRAWNULL),0)),画白色
输出F4:CONST(SUM(IF(GSPT13,1日前的收盘价,DRAWNULL),0)),COLORGREEN
DRAWICON(GSPT8,1日前的收盘价*1.002,2)
DRAWICON(GSPT12,1日前的收盘价*1.002,35)
DRAWICON(GSPT9,1日前的收盘价*0.998,1)
DRAWICON(GSPT13,1日前的收盘价*0.998,34)
GSPT14:=收盘价>1日前的收盘价 AND 收盘价/J2>1+5/100
GSPT15:=收盘价< 1日前的收盘价 AND 收盘价/J2< 1-5/100
GSPT16:=CROSS(0的GSPT14日累和,0.5)
GSPT17:=CROSS(0的GSPT15日累和,0.5)
GSPT18:=0的GSPT16日累和*CROSS(COUNT(收盘价< 1日前的收盘价,上次GSPT16距今天数),0.5)
GSPT19:=0的GSPT17日累和*CROSS(COUNT(收盘价>1日前的收盘价,上次GSPT17距今天数),0.5)
GSPT20:=CONST(SUM(IF(GSPT18,1日前的收盘价,DRAWNULL),0))
GSPT21:=CONST(SUM(IF(GSPT19,1日前的收盘价,DRAWNULL),0))
DRAWICON(GSPT18,1日前的收盘价*1.002,15)
DRAWICON(GSPT19,1日前的收盘价*0.998,9)