DRAWGBK(CLOSE>0, COLORRGB(1,8888,8888), COLORRGB(1,3333,6666),3);
v2:=简单移动平均(最高价,3)*1.03;
v3:=简单移动平均(最低价,3)*0.97;
{v6}小通道上:傅立叶变换(v2,30);
{v7}小通道下:傅立叶变换(v3,30);
A2:=小通道上-向前引用(小通道上,1);
A3:=小通道下-向前引用(小通道下,1);
画分段线(A2>0,小通道上) LINETHICK2 COLORRED,,linethick2;
画分段线(A2=0,小通道上) LINETHICK1 COLORWHITE,linethick2;
画分段线(A2<0,小通道上) LINETHICK1 COLORYELLOW,linethick2;
画分段线(A3>0,小通道下) LINETHICK2 COLORRED,linethick2;
画分段线(A3=0,小通道下) LINETHICK1 COLORWHITE,linethick2;
画分段线(A3<0,小通道下) LINETHICK1 COLORYELLOW,linethick2;MID:=简单移动平均(收盘价,20);{市场主导}
FD:=(HIGH-LOW)/3;{分段}
OPEN1:=OPEN>FD*2+LOW;
OPEN3:=OPEN
CLOSE1:=CLOSE>FD*2+LOW;
CLOSE3:=CLOSE
DFZD:=CLOSE1 OR (OPEN3 AND CLOSE2);{多方主导}
WQS1:=OPEN2 AND CLOSE2;{中性}
KFZD:=NOT(DFZD OR WQS1);{空方主导}
{趋势}
ZD:=(HIGH+LOW)/2;{中点}
QSXS:=ZD>REF(HIGH,1);{趋势向上}
QSXX:=ZD
WQS2:=NOT(QSXS OR QSXX);{无趋势}
{跳动量}
{由于无数据可用,改用成交量和成交金额替代}
ZTDL:=vol>REF(VOL,1)*1.1 OR AMOUNT>REF(AMOUNT,1)*1.5;{正跳动量}
FTDL:=VOL
ZTDL2:=ZTDL AND FTDL<1;{修正跳动量}
FTDL2:=FTDL AND ZTDL<1;{修负跳动量}
{市场促进指数}
mfi1:=(HIGH-LOW)/(VOL/10000);{用VOL计算MFI}
MFI2:=(HIGH-LOW)/(AMOUNT/1000000);{用AMOUNT计算MFI}
ZMFI1:=MFI1>REF(MFI1,1);
ZMFI2:=MFI2>REF(MFI2,1);
ZMFI:=ZMFI1 OR ZMFI2;{正MFI,只要有一项成立就成立}
FMFI:=NOT(ZMFI);{负MFI}
{MFI与交易量}
LD:=ZTDL2 AND ZMFI;{绿灯}
ST:=FTDL2 AND FMFI;{衰退}
WZ:=FTDL2 AND ZMFI;{伪装}
QF:=ZTDL2 AND FMFI;{蛰伏}
{分形}
A1:=REF(HIGH,2);
A2:=FILTER(HHV(HIGH,5)=A1,2);{向上分形成立}
A3:=BacKSET(A2,3);
A4:=IF(FILTER(A3,2),HIGH,0);
A5:=SUM(A4,3);
C1:=REF(LOW,2);
C2:=FILTER(LLV(LOW,5)=C1,2);{向下分形成立}
C3:=BACKSET(C2,3);
C4:=IF(FILTER(C3,2),LOW,0);
C5:=SUM(C4,3);
{信号}
XHWZ1:=HIGH*1.003;
XHWZ2:=LOW*0.998;
XHWZ3:=IF(QSXX,XHWZ2,IF(QSXS,XHWZ1,IF(DFZD,XHWZ1,XHWZ2)));
{ _飞狐股票指标公式}
XHWZ4:=IF(ZD
S1:=DFZD AND QSXS ;{行情向上}
S2:=KFZD AND QSXX ;{行情向下}
S3:=DFZD AND QSXX;
S4:=KFZD AND QSXS;
S5:=DFZD AND WQS2;
S6:=KFZD AND WQS2;
S7:=WQS1 AND (QSXS OR QSXX OR WQS2);
{作图}
STICKLINE(1,LOW,HIGH,0.5,0 ),COLOR00FFFF;
STICKLINE(S2 ,close ,open,7,0 ),COLORFF2020;
STICKLINE(S1,close,open,7 ,0 ),COLOR2020FF;
STICKLINE(S3,CLOSE,OPEN,7,0),COLORYELLOW;
STICKLINE(S4,CLOSE,OPEN,7,0),COLORCYAN;
STICKLINE(S5,CLOSE,OPEN,7,0),COLORMAGENTA;
STICKLINE(S6,CLOSE,OPEN,7,0),COLORGREEN;
STICKLINE(S7,CLOSE,OPEN,7,0),COLORGRAY;
STICKLINE(1,CLOSE,OPEN,2,0),COLORWHITE;
STICKLINE(LD,XHWZ3,XHWZ3*0.999,3,0),COLORGREEN;{绿灯}
STICKLINE(ST,XHWZ3,XHWZ3*0.999,3,0),COLORMAGENTA;{衰退}
STICKLINE(WZ,XHWZ3,XHWZ3*0.999,3,0),COLORYELLOW;{伪装}
STICKLINE(QF,XHWZ3,XHWZ3*0.999,3,0),COLORRED;{蛰伏}
STICKLINE(A5>0.1,A5,A5*1.0001,6,0);{向上分形}
STICKLINE(C5>0.1,C5,C5*1.0001,6,0);{向下分形成立}
Var1:=(OPEN+LOW+HIGH+CLOSE)/4;
支撑1: EMA(Var1,5),colorwhite;
压力1: HHV(支撑1,13), colorcccc00;
压力2: HHV(支撑1,60),colorblue;
支撑2: LLV(支撑1,13),colorgreen;
支撑3: LLV(LOW,60)*1.02 ,colorred;
压力3: HHV(HIGH,60)*0.98,colorgreen;
PARTLINE(支撑1>ref(支撑1,1),支撑1),colorred,linethick2;
PARTLINE(支撑2>ref(支撑2,1),支撑2),coloryellow,linethick1;
PARTLINE(压力1>ref(压力1,1),压力1),colormagenta,linethick2;
PARTLINE(压力2>ref(压力2,1),压力2),coloryellow,linethick2;
PARTLINE(支撑2=ref(支撑2,1),支撑2),colorred;
PARTLINE(压力1=ref(压力1,1),压力1),colorred;
PARTLINE(压力2=ref(压力2,1),压力2),colorred;
PARTLINE(压力3=ref(压力3,1),压力3),colorred;
STICKLINE(1,var1,var1,6,0),COLORwhite;