起点:=IF(取点=1,TROUGHBARS(L,之字幅度,1),PEAKBARS(H,之字幅度,1));
价位1:=CONST(IF(取点=1,HHV(H,PEAKBARS(H,之字幅度,1)),LLV(L,TROUGHBARS(L,之字幅度,1))));
L价位:=DRAWLINE(起点=0,L,ISLASTBAR,REF(L,BARSLAST(起点=0)),0);
H价位:=DRAWLINE(起点=0,H,ISLASTBAR,REF(H,BARSLAST(起点=0)),0);
价位2:=IF(取点=1,L价位,H价位);
价幅度:=ABS(价位1-价位2);
上限划位:=CONST(FINDHIGH(H,1,CONST(PEAKBARS(H,之字幅度,1)),1))*1.1;
下限划位:=CONST(FINDLOW(L,1,CONST(起点),1))*0.9;
上分0:=价位2+IF(分=1,0.191,1/6)*价幅度;
上分1:=价位2+IF(分=1,0.382,2/6)*价幅度;
上分2:=价位2+IF(分=1,0.5,3/6)*价幅度;
上分3:=价位2+IF(分=1,0.618,4/6)*价幅度;
上分4:=价位2+IF(分=1,0.809,5/6)*价幅度;
上分5:=价位2+IF(分=1,1,6/6)*价幅度;
上斜线0:=IF(BETWEEN(价位2+(斜率-360)*起点*0.001,上限划位,下限划位),价位2+(斜率-360)*起点*0.001,DRAWNULL);
上斜线1:=IF(BETWEEN(上分0+(斜率-360)*起点*0.001,上限划位,下限划位),上分0+(斜率-360)*起点*0.001,DRAWNULL);
上斜线2:=IF(BETWEEN(上分1+(斜率-360)*起点*0.001,上限划位,下限划位),上分1+(斜率-360)*起点*0.001,DRAWNULL);
上斜线3:=IF(BETWEEN(上分2+(斜率-360)*起点*0.001,上限划位,下限划位),上分2+(斜率-360)*起点*0.001,DRAWNULL);
上斜线4:=IF(BETWEEN(上分3+(斜率-360)*起点*0.001,上限划位,下限划位),上分3+(斜率-360)*起点*0.001,DRAWNULL);
上斜线5:=IF(BETWEEN(上分4+(斜率-360)*起点*0.001,上限划位,下限划位),上分4+(斜率-360)*起点*0.001,DRAWNULL);
上斜线6:=IF(BETWEEN(上分5+(斜率-360)*起点*0.001,上限划位,下限划位),上分5+(斜率-360)*起点*0.001,DRAWNULL);
下分0:=价位2-IF(分=1,0.191,1/6)*价幅度;
下分1:=价位2-IF(分=1,0.382,2/6)*价幅度;
下分2:=价位2-IF(分=1,0.5,3/6)*价幅度;
下分3:=价位2-IF(分=1,0.618,4/6)*价幅度;
下分4:=价位2-IF(分=1,0.809,5/6)*价幅度;
下分5:=价位2-IF(分=1,1,6/6)*价幅度;
下斜线0:=IF(BETWEEN(价位2-(斜率-360)*起点*0.001,上限划位,下限划位),价位2-(斜率-360)*起点*0.001,DRAWNULL);
下斜线1:=IF(BETWEEN(下分0-(斜率-360)*起点*0.001,上限划位,下限划位),下分0-(斜率-360)*起点*0.001,DRAWNULL);
下斜线2:=IF(BETWEEN(下分1-(斜率-360)*起点*0.001,上限划位,下限划位),下分1-(斜率-360)*起点*0.001,DRAWNULL);
下斜线3:=IF(BETWEEN(下分2-(斜率-360)*起点*0.001,上限划位,下限划位),下分2-(斜率-360)*起点*0.001,DRAWNULL);
下斜线4:=IF(BETWEEN(下分3-(斜率-360)*起点*0.001,上限划位,下限划位),下分3-(斜率-360)*起点*0.001,DRAWNULL);
下斜线5:=IF(BETWEEN(下分4-(斜率-360)*起点*0.001,上限划位,下限划位),下分4-(斜率-360)*起点*0.001,DRAWNULL);
下斜线6:=IF(BETWEEN(下分5-(斜率-360)*起点*0.001,上限划位,下限划位),下分5-(斜率-360)*起点*0.001,DRAWNULL);
{www.9m8.cn 九毛八公式指标网 股票软件下载网_通达信股票指标公式}
斜线0:IF(取点=1,上斜线0,下斜线0),COLORGREEN;
斜线1:IF(取点=1,上斜线1,下斜线1),COLORGREEN;
斜线2:IF(取点=1,上斜线2,下斜线2),COLORGREEN;
斜线3:IF(取点=1,上斜线3,下斜线3),COLORGREEN;
斜线4:IF(取点=1,上斜线4,下斜线4),COLORGREEN;
斜线5:IF(取点=1,上斜线5,下斜线5),COLORGREEN;
斜线6:IF(取点=1,上斜线6,下斜线6),COLORGREEN;
划分0:=IF(分=1,'0','0');
划分1:=IF(分=1,'0.191','1/6');
划分2:=IF(分=1,'0.382','2/6');
划分3:=IF(分=1,'0.5','3/6');
划分4:=IF(分=1,'0.618','4/6');
划分5:=IF(分=1,'0.809','5/6');
划分6:=IF(分=1,'1','6/6');
DRAWTEXT(起点=0,斜线0,划分0),COLORWHITE;
DRAWTEXT(起点=0,斜线1,划分1),COLORWHITE;
DRAWTEXT(起点=0,斜线2,划分2),COLORWHITE;
DRAWTEXT(起点=0,斜线3,划分3),COLORWHITE;
DRAWTEXT(起点=0,斜线4,划分4),COLORWHITE;
DRAWTEXT(起点=0,斜线5,划分5),COLORWHITE;
DRAWTEXT(起点=0,斜线6,划分6),COLORWHITE;