全息九宫格可能你没见过的公式 学习九宫写法 源码分享
QT1:=MOD(BARSLAST(BARSCOUNT(C)=5-1),5);
QHH:=CONST(HHV(H,0));QLL:=CONST(LLV(L,0));
STICKLINE(QT1=0,QHH,QLL,0.01,0);
T:=TOTALBARSCOUNT-CURRBARSCOUNT+1;
T5:=MOD(T,5);TXT:=IF(T5=0,'5T','');
DRAWTEXT(T5=0 AND PERIOD=5,L*0.98,TXT);
{画右侧空间距离色块,普通等系坐标,自下而上,颜色越深风险越大}
DRAWRECTREL(990,0.1,1000,009,RGB(255,0,0)),NOFRAME; {6}
DRAWRECTREL(990,1,1000,99,RGB(255,0,50)),NOFRAME; {5}
DRAWRECTREL(990,100,1000,199,RGB(255,0,100)),NOFRAME; {4}
DRAWRECTREL(990,200,1000,299,RGB(255,0,150)),NOFRAME; {3}
DRAWRECTREL(990,300,1000,399,RGB(255,0,200)),NOFRAME; {2}
DRAWRECTREL(990,400,1000,499,RGB(255,0,250)),NOFRAME; {1}
DRAWRECTREL(990,500,1000,599,RGB(255,0,255)),NOFRAME; {0}
DRAWRECTREL(990,600,1000,699,RGB(0,255,250)),NOFRAME; {1}
DRAWRECTREL(990,700,1000,799,RGB(0,255,200)),NOFRAME; {2}
DRAWRECTREL(990,800,1000,899,RGB(0,255,150)),NOFRAME; {3}
DRAWRECTREL(990,900,1000,999,RGB(0,255,100)),NOFRAME; {4}
DRAWRECTREL(990,999,1000,1001,RGB(0,255,50)),NOFRAME ; {5}
DRAWRECTREL(990,999.9,1000,1099,RGB(0,255,0)),NOFRAME; {6};
{画左侧空间距离色块,普通等系坐标,自下而上,颜色越深风险越大}
DRAWRECTREL(0,0.1,10,009,RGB(255,0,0)),NOFRAME; {6}
DRAWRECTREL(0,1,10,99,RGB(255,0,50)),NOFRAME; {5}
DRAWRECTREL(0,100,10,199,RGB(255,0,100)),NOFRAME; {4}
DRAWRECTREL(0,200,10,299,RGB(255,0,150)),NOFRAME; {3}
DRAWRECTREL(0,300,10,399,RGB(255,0,200)),NOFRAME; {2}
DRAWRECTREL(0,400,10,499,RGB(255,0,250)),NOFRAME; {1}
DRAWRECTREL(0,500,10,599,RGB(255,0,255)),NOFRAME; {0}
DRAWRECTREL(0,600,10,699,RGB(0,255,250)),NOFRAME; {1}
DRAWRECTREL(0,700,10,799,RGB(0,255,200)),NOFRAME; {2}
DRAWRECTREL(0,800,10,899,RGB(0,255,150)),NOFRAME; {3}
DRAWRECTREL(0,900,10,999,RGB(0,255,100)),NOFRAME; {4}
DRAWRECTREL(0,999,10,1001,RGB(0,255,50)),NOFRAME ; {5}
DRAWRECTREL(0,999.9,10,1099,RGB(0,255,0)),NOFRAME; {6};
{画九格等分坐标}
最高点:=REFDATE(CONST(REF(HHV(H,0),0)),DATE),LINETHICK1,COLORMAGENTA;
最低点:=REFDATE(CONST(REF(LLV(L,0),0)),DATE),LINETHICK1,COLORGREEN;
高低价差:=(最高点-最低点),DOTLINE;
区间1:=最高点-高低价差*0.90,DOTLINE;
区间2:=最高点-高低价差*0.80,DOTLINE;
区间3:=最高点-高低价差*0.70,DOTLINE;
区间4:=最高点-高低价差*0.60,DOTLINE;
区间5:=最高点-高低价差*0.50,DOTLINE;
区间6:=最高点-高低价差*0.40,DOTLINE;
区间7:=最高点-高低价差*0.30,DOTLINE;
区间8:=最高点-高低价差*0.20,DOTLINE;
区间9:=最高点-高低价差*0.10,DOTLINE;
{用文字来描述空间位置,便于快速识别}
DRAWTEXT(CURRBARSCOUNT=1,最低点,' 最低点位'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间1,' 低位一区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间2,' 低位二区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间3,' 低位三区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间4,' 中位四区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间5,' 中位五区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间6,' 中位六区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间7,' 高位七区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间8,' 高位八区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,区间9,' 高位九区'),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,最高点,' 最高点位'),COLORWHITE;
{重画K线}
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
WWWFXJGSWCOM:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
ZT:=C>REF(C,1)*1.090 AND C<REF(C,1)*1.105;
DT:=C<REF(C,1)*0.901 AND C>REF(C,1)*0.898;
STICKLINE(ZT,C,O,4,0),COLORRED;
STICKLINE(DT,C,O,4,0),COLORGREEN;
DRAWTEXT(ZT,L-0.1,'涨停'),COLORRED;
DRAWTEXT(DT,H+0.3,'跌停'),COLORGREEN;
STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;
{股票指标网 整理}
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
QT1赋值:MOD(上次C的有效数据周期数=5-1距今天数,5)
QHH赋值:CONST(0日内H最高值)
QLL赋值:CONST(0日内L最低值)
当满足条件QT1=0时,在QHH和QLL之间画柱状线
T赋值:TOTALBARSCOUNT-CURRBARSCOUNT+1
T5:=MOD(T,5)
如果T5=0返回'5T'否则返回''
当满足条件T5=0 AND PERIOD=5时,在L*0.98和TXT位置书写文字
{画右侧空间距离色块,普通等系坐标,自下而上,颜色越深风险越大}
DRAWRECTREL(990,0.1,1000,009,RGB(255,0,0)),NOFRAME
{6}
DRAWRECTREL(990,1,1000,99,RGB(255,0,50)),NOFRAME
{5}
DRAWRECTREL(990,100,1000,199,RGB(255,0,100)),NOFRAME
{4}
DRAWRECTREL(990,200,1000,299,RGB(255,0,150)),NOFRAME
{3}
DRAWRECTREL(990,300,1000,399,RGB(255,0,200)),NOFRAME
{2}
DRAWRECTREL(990,400,1000,499,RGB(255,0,250)),NOFRAME
{1}
DRAWRECTREL(990,500,1000,599,RGB(255,0,255)),NOFRAME
{0}
DRAWRECTREL(990,600,1000,699,RGB(0,255,250)),NOFRAME
{1}
DRAWRECTREL(990,700,1000,799,RGB(0,255,200)),NOFRAME
{2}
DRAWRECTREL(990,800,1000,899,RGB(0,255,150)),NOFRAME
{3}
DRAWRECTREL(990,900,1000,999,RGB(0,255,100)),NOFRAME
{4}
DRAWRECTREL(990,999,1000,1001,RGB(0,255,50)),NOFRAME
{5}
DRAWRECTREL(990,999.9,1000,1099,RGB(0,255,0)),NOFRAME
{6}
{画左侧空间距离色块,普通等系坐标,自下而上,颜色越深风险越大}
DRAWRECTREL(0,0.1,10,009,RGB(255,0,0)),NOFRAME
{6}
DRAWRECTREL(0,1,10,99,RGB(255,0,50)),NOFRAME
{5}
DRAWRECTREL(0,100,10,199,RGB(255,0,100)),NOFRAME
{4}
DRAWRECTREL(0,200,10,299,RGB(255,0,150)),NOFRAME
{3}
DRAWRECTREL(0,300,10,399,RGB(255,0,200)),NOFRAME
{2}
DRAWRECTREL(0,400,10,499,RGB(255,0,250)),NOFRAME
{1}
DRAWRECTREL(0,500,10,599,RGB(255,0,255)),NOFRAME
{0}
DRAWRECTREL(0,600,10,699,RGB(0,255,250)),NOFRAME
{1}
DRAWRECTREL(0,700,10,799,RGB(0,255,200)),NOFRAME
{2}
DRAWRECTREL(0,800,10,899,RGB(0,255,150)),NOFRAME
{3}
DRAWRECTREL(0,900,10,999,RGB(0,255,100)),NOFRAME
{4}
DRAWRECTREL(0,999,10,1001,RGB(0,255,50)),NOFRAME
{5}
DRAWRECTREL(0,999.9,10,1099,RGB(0,255,0)),NOFRAME
{6}
{画九格等分坐标}
最高点赋值:REFDATE(CONST(REF(0日内H最高值,0)),DATE),LINETHICK1,COLORMAGENTA
最低点赋值:REFDATE(CONST(REF(0日内L最低值,0)),DATE),LINETHICK1,画绿色
高低价差赋值:(最高点-最低点),DOTLINE
区间1赋值:最高点-高低价差*0.90,DOTLINE
区间2赋值:最高点-高低价差*0.80,DOTLINE
区间3赋值:最高点-高低价差*0.70,DOTLINE
区间4赋值:最高点-高低价差*0.60,DOTLINE
区间5赋值:最高点-高低价差*0.50,DOTLINE
区间6赋值:最高点-高低价差*0.40,DOTLINE
区间7赋值:最高点-高低价差*0.30,DOTLINE
区间8赋值:最高点-高低价差*0.20,DOTLINE
区间9赋值:最高点-高低价差*0.10,DOTLINE
当满足条件CURRBARSCOUNT=1时,在最低点和' 最低点位'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间1和' 低位一区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间2和' 低位二区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间3和' 低位三区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间4和' 中位四区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间5和' 中位五区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间6和' 中位六区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间7和' 高位七区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间8和' 高位八区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在区间9和' 高位九区'位置书写文字
当满足条件CURRBARSCOUNT=1时,在最高点和' 最高点位'位置书写文字
{重画K线}
DRAWKLINE(最高价,开盘价,最低价,收盘价)
WWWFXJGSWCOM赋值:成交量/((最高价-最低价)*2-收盘价-开盘价的绝对值)
ZT赋值:C>1日前的C*1.090 AND C<1日前的C*1.105
DT赋值:C<1日前的C*0.901 AND C>1日前的C*0.898
当满足条件ZT时,在C和O之间画柱状线
当满足条件DT时,在C和O之间画柱状线
当满足条件ZT时,在L-0.1和'涨停'位置书写文字
当满足条件DT时,在H+0.3和'跌停'位置书写文字
STICKLINE(C/1日前的C>1.095,C,O,2,0),画黄色
{股票指标网 整理}