编辑公式的【目的】就是想知道将来是涨.是跌.现在就用比较价咯差和价咯重心来判断涨跌. 【A】价咯差:XJ:(2*C+H+L)/4+(2*C-H-L);就是是收盘价与最高最低价的比较. 【B】价咯重心;重心:AMOUNT/vol/100;是成交量与成交金額的比较. 我们认为只有今天【A】和【B】的数据两个方面同时大于昨天才有上涨的可能,反之就会下跌,依据这个原理编辑公式如下:------------ 【DRAWGBK(XJ>=ref(XJ,1) AND 重心>REF(重心,1),STRIP(RGB(0,0,255),RGB(120,0,120),0))】; 这就是涨跌波段的公式源码,其中参数【K】要根据股性及时改变的以适合构成波段要求. ---------【请注意】这个公式在横盘阶段不好用-----
{重心价差}
INPUT:K(10,0,500);
DRAWGBKlast(c>0,strip(RGB(60,60,60),RGB(0,0,80),0));
DRAWTEXTABS(5,2,'■价咯差【FORCAST((2*C+H+L)/4+(2*C-H-L),K)】的参数【K='+K+'】'),COLOR0066FF,LINETHICK2,LAYER0;
DRAWTEXTABS(5,22,'■价咯重心【FORCAST(AMOUNT/VOL/100,K)】的参数【K='+K+'】'),COLOR00FFFF,LINETHICK2,LAYER0;
C,DOTLINE,Color00FFFF;
XJ:FORCAST(EMA((2*C+H+L)/4+(2*C-H-L),2),K);
partline(XJ,XJ>=ref(XJ,1),rgb(255,80,0),XJ<ref(XJ,1),rgb(0,255,80)),linethick2,LAYER0;
LLX:=LLV(XJ,2);
WINN:=(XJ-REF(XJ,1));;
STICKLINE(WINN>=0,XJ,XJ+WINN,6,0),Color000088;
STICKLINE(WINN>=0,XJ,XJ+WINN,4,0),Color0000AA;
STICKLINE(WINN>=0,XJ,XJ+WINN,2,0),Color0000DD;
STICKLINE(WINN>=0,XJ,XJ+WINN,1,0),Color0000FF;
STICKLINE(WINN<0,XJ,XJ+WINN,6,0),Color008800;
STICKLINE(WINN<0,XJ,XJ+WINN,4,0),Color00AA00;
STICKLINE(WINN<0,XJ,XJ+WINN,2,0),Color00DD00;
STICKLINE(WINN<0,XJ,XJ+WINN,1,0),Color00FF00;
重心:FORCAST(EMA(AMOUNT/vol/100,2),K),LINETHICK0;
PARTLINE(重心,(重心>REF(重心,1))-1,rgb(0,120,255),1,rgb(255,155,0) ),POINTDOT,LINETHICK7,LAYER0;
PARTLINE(重心,(重心>REF(重心,1))-1,rgb(0,120,255),1,rgb(255,155,0) ),DOTLINE,LAYER0;
DRAWGBK(XJ>=ref(XJ,1) AND 重心>REF(重心,1),STRIP(RGB(0,0,255),RGB(120,0,120),0)),LAYER3;{------};
■【注意】-----补【通达信】的源码和附图;因为我根本不用通达信软件 所以我不太会编辑通达信的公式.仅供参照;------参数【K】通达信需填入表内---
XJ:FORCAST(EMA((2*C+H+L)/4+(2*C-H-L),2),K);
LLX:=LLV(XJ,2);
重心:FORCAST(EMA(AMOUNT/VOL/100,2),K);
STICKLINE(XJ>REF(XJ,1) AND 重心>REF(重心,1),REFDATE(HHV(H,0),DATE),REFDATE(LLV(L,0),DATE),6,0),COLOR003303; {-------波段背景------};
C,DOTLINE,COLOR00FFFF;
FORCAST(EMA((2*C+H+L)/4+(2*C-H-L),2),K),COLOR00FF00,LINETHICK2;
IF(XJ>REF(XJ,1),XJ,DRAWNULL),COLOR0000FF,LINETHICK2;
WINN:=(XJ-REF(XJ,1));
STICKLINE(WINN>=0,XJ,XJ+WINN,3,0),COLOR000088;
STICKLINE(WINN>=0,XJ,XJ+WINN,2,0),COLOR0000AA;
STICKLINE(WINN>=0,XJ,XJ+WINN,1,0),COLOR0000DD;
STICKLINE(WINN>=0,XJ,XJ+WINN,0,0),COLOR0000FF;
STICKLINE(WINN<0,XJ,XJ+WINN,3,0),COLOR008800;
STICKLINE(WINN<0,XJ,XJ+WINN,2,0),COLOR00AA00;
STICKLINE(WINN<0,XJ,XJ+WINN,1,0),COLOR00DD00;
STICKLINE(WINN<0,XJ,XJ+WINN,0,0),COLOR00FF00;
FORCAST(EMA(AMOUNT/VOL/100,2),K),COLOR0099FF,DOTLINE;
FORCAST(EMA(AMOUNT/VOL/100,2),K),COLORFF9900,POINTDOT,LINETHICK7;
IF(重心>REF(重心,1),重心,DRAWNULL),COLOR00FFFF,POINTDOT,LINETHICK7;
---------------通达信参数要填入表格里的 K ( 0,500,10)----------------
|