在飞狐分时窗口图叠MACD、BOLL、分笔分段公式,编辑MACD分时公式时,要选中主图叠加。 分时主图(悟多分笔分段,可以替换成其他主图公式) var1:="chzhshch@kxian"; var2:="chzhshch@bi";{处理笔关系} drawline(var2=1,h,var2=-1,l,0),linedot,coloryellow; drawline(var2=-1,l,var2=1,h,0),linedot,coloryellow; var3:="chzhshch@duan";{处理段关系} drawnumber(var3=1,h,h,2),pxup20,colormagenta,align2; drawnumber(var3=-1,l,l,2),pxdn5,colorgreen; drawline(var3=1,h,var3=-1,l,0),colorFF6600; drawline(var3=-1,l,var3=1,h,0),colorFF6600; 分时主图叠加BOLL副图叠加MACD,类似的可以替换成其他指标 iEnd:=DATACOUNT; R0:=DYNAINFO(3); Hd:=MAX(DYNAINFO(5)-R0,R0-DYNAINFO(6)); Y2:=R0-2*Hd*1.0125; Y3:=R0-3*Hd*1.041; DIFF:MA(CLOSE,12)-EMA(CLOSE,26); DEA:EMA(DIFF,9); MACD:(DIFF-DEA)*2; kh:=MAX(MAX(HHV(DIFF,0),HHV(DEA,0)),HHV(MACD,0)); kl:=MIN(MIN(LLV(DIFF,0),LLV(DEA,0)),LLV(MACD,0)); kb:=(Y2-Y3)/(kh-kL)*0.85; ky1:=(Y2+Y3-kb*(kh+kL))/2,color0000ff; ky:ky1[iEnd],color0000aa; MACD1:=MACD*kb[iEnd]+ky,color0000ff; STICKLINE(MACD1>=ky ,ky,MACD1,1,0),color0000ff; STICKLINE(MACD1>=ky and MACD1<=REF(MACD1,1),ky,MACD1,1,0),COLORYELLOW; STICKLINE(MACD1<=ky ,ky,MACD1,1,0),colorffff00; STICKLINE(MACD1<=ky and MACD1>=REF(MACD1,1),ky,MACD1,1,0),COLORFF00FF,LINETHICK2;
diff1:DIFF*kb[iEnd]+ky,coloraaaaaa; PARTLINE(diff1>REF(diff1,1),diff1),colorred,LINETHICK2; DEA1:DEA*kb[iEnd]+ky,color00aaaa;
MID : MA(CLOSE,20),COLORYELLOW,POINTDOT ,LINETHICK1; UPPER: MID + 2*STD(CLOSE,20),COLORYELLOW ,POINTDOT ,LINETHICK1; LOWER: MID - 2*STD(CLOSE,20),COLORYELLOW,POINTDOT ,LINETHICK1; 使用方法: 在分时窗口里,点击上面标准工具条最后一项的“切换实时图模式”,切换出副图到量比状态,然后敲出公式(象敲股票代码一样敲fsmacd),或者在管理面版的技术指标下点击公式,在分时图下面就显示出macd指标,上面分时线出现分笔分段线. |