A. 求通達信軟體選股公式,高手請進~~~~~
要求太多了,我只找到一個接近要求的,圖片演示在下面網址里.
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL>0,A4,A3);
均價線:=IF(A<=CONST(A2),A5,DRAWNULL);
分鍾有效周期:=IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,DRAWNULL))));
分時價:=TFILT(CLOSE,CURRBARSCOUNT,00,CURRBARSCOUNT,00);
分時判斷:=IF(分時價=DRAWNULL,1,IF(分鍾有效周期=DRAWNULL,DRAWNULL,1));
{-----------------------------由MACD定位頂底 -------------------------------}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
KX:=BARSSINCE(CLOSE);{←首次開盤價距金的天數}
HHN:=CONST(HHV(DIFF,KX));
HLN:=CONST(LLV(DEA,KX));
RC1:=CONST((HHN+HLN)/2);
SS:=((HHN-HLN)/200);
MACD底部:=(-100*SS+RC1)+-(-100*SS+RC1),COLOR669999;
MACD頂部:=(100*SS+RC1)+-(-100*SS+RC1),COLORFF0033;
MACD中軸:=0+-(-100*SS+RC1);
DIFF修正:=DIFF+-(-100*SS+RC1),COLOR008080;
DEA修正:=DEA+-(-100*SS+RC1),COLOR00FF00;
MACD修正:=2*(DIFF修正-DEA修正)+MACD中軸,COLOR0000BB,NODRAW;
MACD超跌:=CONST(LLV(MACD修正,KX));
MACD超跌線:=IF(MACD超跌<MACD底部,MACD超跌,MACD底部);
{----------------------利用MACD趨勢進行精確頂底判斷 ------------------------}
頂部:=MACD頂部+-MACD超跌線;
天際:=頂部*0.809;
中軸:=MACD中軸+-MACD超跌線;
海面:=頂部*0.191;
底部:=MACD底部;
{------------------------傳統KDJ指標結合MACD優化 ---------------------------}
RSVA:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*頂部;{採用21日月線優化}
K:SMA(RSVA,3,1),COLORFFFFFF,NODRAW;
D:SMA(K,3,1),COLOR00FFFF,NODRAW;
原J值參數:=3*K-2*D;
JD:=IF(原J值參數<底部,底部,原J值參數);{J值底部鈍化處理}
J:IF(JD>頂部,頂部,JD),COLORFF00FF,NODRAW;{底部鈍化處理後再進行頂部鈍化處理}
{---------------------------MACD多空量能判斷-------------------------------}
MACD多頭:DIFF修正+-MACD超跌線,COLOR339999;
空頭:DEA修正+-MACD超跌線,COLOR00FF00;
量能柱:2*(MACD多頭-空頭)+中軸,COLOR0000BB,NODRAW;
超前DEA:=(EMA(MACD多頭,7));
超前MACD:=2*(MACD多頭-超前DEA)+中軸;
{-----------------------------------大盤動向-------------------------------}
VAR1大盤:=LLV(LOW,13);
VAR2大盤:=HHV(HIGH,13);
VAR3大盤:=(SMA((CLOSE-VAR1大盤)/(VAR2大盤-VAR1大盤)*頂部,5,1))-頂部/2;
VAR4大盤:=SMA((VAR2大盤-CLOSE)/(VAR2大盤-VAR1大盤)*頂部,5,1)-頂部/2;
大盤散戶:=IF(VAR4大盤<底部,底部,VAR4大盤),COLOR408000;
大盤主力:=IF(VAR3大盤<底部,底部,VAR3大盤),COLOR330088;
{---------------------------------密集成本突破-----------------------------}
最高獲利參數:=頂部/100;
VAR1C:=(COST(89)-COST(11))*最高獲利參數;
VAR2C:=(COST(99.9)-COST(1))*最高獲利參數;
單峰:=((1-VAR1C/VAR2C))*頂部;
低密:=((COST(90)-COST(60))/VAR2C)*頂部;
高密:=((COST(40)-COST(1))/VAR2C)*頂部;
贏利:= (SMA(WINNER(AMOUNT/VOL/99),2,1))*頂部;
活躍度:頂部-頂部/(1+EXPMA(HSL,21)),COLOR774455; {←CYF公眾追漲熱情指標}
70%成本集中度:=IF(VAR1C>頂部,頂部,VAR1C),COLORFFFFFF;
90%成本集中度:=IF(VAR2C>頂部,頂部,VAR2C),COLORFF0000;
套牢籌碼上升:=IF((單峰-贏利)>底部,(單峰-贏利),底部);
個股散戶:=IF(套牢籌碼上升>頂部,頂部,套牢籌碼上升),COLOR408000;
散戶:IF(個股散戶=DRAWNULL,DRAWNULL,個股散戶),COLOR408000;
獲利籌碼上升:=IF((贏利-單峰)>底部,(贏利-單峰),底部);
個股主力:=IF(獲利籌碼上升>頂部,頂部,獲利籌碼上升),COLOR330088;
主力:IF(個股主力=DRAWNULL,DRAWNULL,個股主力),COLOR330088;
{--------------------換手率,五日換手率輔助判斷個股活躍度-------------------}
換手:SUM(VOL,1)/CAPITAL*100,COLOR666666,NODRAW;
⑤日換:SUM(VOL,5)/CAPITAL*100,COLOR999999,NODRAW;
{----------------------密集成本突破指標籌碼峰畫線--------------------------}
金色背景修邊1:STICKLINE(C>0 AND CURRBARSCOUNT>=2,頂部,底部,3.05,0),COLOR003333;
金色背景修邊2:STICKLINE(C>0 AND CURRBARSCOUNT>=2,頂部,中軸,3.05,0),COLOR003333;
金色背景補充:DRAWBAND(頂部,RGB(51,51,0),中軸,RGB(51,51,0));
金色背景:DRAWBAND(頂部,RGB(51,51,0),底部,RGB(128,128,128));
追漲熱度峰紫色:DRAWBAND(活躍度,RGB(66,52,81),底部,RGB(204,0,0));
高密峰墨藍色:=DRAWBAND(高密,RGB(0,0,51),底部,RGB(0,0,255));
低密峰純藍色:=DRAWBAND(低密,RGB(0,0,102),底部,RGB(0,0,255));
90%成本峰:DRAWBAND(90%成本集中度,RGB(0,0,153),底部,RGB(0,0,153));
70%成本峰:DRAWBAND(70%成本集中度,RGB(0,128,0),底部,RGB(255,255,255));
散戶峰綠色:DRAWBAND(散戶,RGB(0,64,0),底部,RGB(204,0,0));
主力峰紅色:DRAWBAND(主力,RGB(102,26,51),底部,RGB(0,0,255));
MACD多空趨勢:DRAWBAND(MACD多頭,RGB(204,51,51),空頭,RGB(0,179,0));
MACD多頭重畫:DRAWBAND(MACD多頭,RGB(153,153,51),MACD多頭,RGB(153,153,51));
MACD空頭重畫:DRAWBAND(空頭,RGB(0,204,0),空頭,RGB(0,204,0));
{--------創幻論壇『131488』會員提供的通達信■新寶塔線■-----原碼-----------}
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
三平底翻金:=(REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1))
AND VAR1;
主力啟動線:=MA(V,5),COLORFFFFFF;
主力洗盤線:=MA(V,35),COLOR00FFFF;
資金異動線:=MA(V,135),COLORFF0000;
{----------------------------買賣參考--------------------------------------}
出擊:=(CROSS(主力啟動線,資金異動線) OR ((主力洗盤線 > 資金異動線) AND CROSS(主力啟動線,主力洗盤線))),COLORYELLOW;
啟動:=(主力啟動線>REF(主力啟動線,1) AND (CROSS(VOL,主力啟動線) AND (REF(VOL,1)<REF(資金異動線,1) OR REF(VOL,2)<REF(資金異動線,2)))),COLOR45AAEE;
成立:=三平底翻金 AND (出擊 OR 啟動);
買入提示:=IF(成立=1,海面*0.5,0) AND 分時判斷=1;
{------------------------頂部線,天際線,海面線,底部線重畫-------------------}
頂部線:DRAWBAND(頂部,RGB(51,0,255),頂部,RGB(51,0,255));
天際線:DRAWBAND(天際,RGB(128,64,64),天際,RGB(128,64,64));
海面線:DRAWBAND(海面,RGB(0,153,153),海面,RGB(0,153,153));
底部線:DRAWBAND(0,RGB(153,153,102),買入提示,RGB(153,153,102));
{------------------------超前MACD多空量能柱--------------------------------}
超前MACD紅柱1:STICKLINE(超前MACD>=中軸,超前MACD,中軸,1.50,0),COLOR226688;
超前MACD紅柱2:STICKLINE(超前MACD>=中軸,超前MACD,中軸,0.95,0),COLOR4488BB;
超前MACD紅柱3:STICKLINE(超前MACD>=中軸,超前MACD,中軸,0.31,0),COLOR55AADD;
超前MACD蘭柱1:STICKLINE(超前MACD<=中軸,超前MACD,中軸,1.50,0),COLOR006600;
超前MACD蘭柱2:STICKLINE(超前MACD<=中軸,超前MACD,中軸,0.95,0),COLOR007700;
超前MACD蘭柱3:STICKLINE(超前MACD<=中軸,超前MACD,中軸,0.31,0),COLOR008800;
{--------------------------MACD多空量能柱----------------------------------}
MACD紅柱1:STICKLINE(量能柱>=中軸,量能柱,中軸,1.5,0),COLOR000077;
MACD紅柱2:STICKLINE(量能柱>=中軸,量能柱,中軸,1.1,0),COLOR000088;
MACD紅柱3:STICKLINE(量能柱>=中軸,量能柱,中軸,0.6,0),COLOR000099;
MACD紅柱4:STICKLINE(量能柱>=中軸,量能柱,中軸,0.15,0),COLOR0000AA;
MACD蘭柱1:STICKLINE(量能柱<=中軸,量能柱,中軸,1.5,0),COLORAA6633;
MACD蘭柱2:STICKLINE(量能柱<=中軸,量能柱,中軸,1.1,0),COLORBB7744;
MACD蘭柱3:STICKLINE(量能柱<=中軸,量能柱,中軸,0.6,0),COLORCC8855;
MACD蘭柱4:STICKLINE(量能柱<=中軸,量能柱,中軸,0.15,0),COLORDD9966;
{---------中軸線重畫及頂部線,天際線,海面線,底部線,多空線文字說明-----------}
中軸線:DRAWBAND(中軸,RGB(128,128,255),中軸,RGB(128,128,255));
頂部線文字:DRAWTEXT(CURRBARSCOUNT=1,頂部*0.98,' 頂部線'),COLORFF0033;
天際線文字:DRAWTEXT(CURRBARSCOUNT=1,天際*0.98,' 天際線'),COLOR404080;
海面線文字:DRAWTEXT(CURRBARSCOUNT=1,海面,' 海面線'),COLOR999900;
底部線文字:DRAWTEXT(CURRBARSCOUNT=1,底部,' 底部線'),COLOR669999;
中軸線文字:DRAWTEXT(CURRBARSCOUNT=1,中軸,' 多空線'),COLORFF8080;
{-------------------------------傳統KDJ指標線重畫--------------------------}
D線重畫:DRAWBAND(D,RGB(255,255,0),D*0.998,RGB(255,255,0));
K線重畫:DRAWBAND(K,RGB(255,255,255),K,RGB(255,255,255));
J線重畫:DRAWBAND(J,RGB(255,0,255),J,RGB(255,0,255));
B. 跪求高手將此編寫成(通達信)選股公式,5日,10日和20日無線粘合一起,選出粘合時間長達5日以上
撈乾的,找飆股,賺大錢;均線粘合後發飆;以下網上找的副圖 {給你做幾個選股公式在後};
{粘合突破----拉升前兆,創幻論壇一品茶緣編寫精品指標,通達信,大智慧,飛弧 通用}
N:=5,15,10;{n表示均線之間的最大距離}
{粘合突破指標使用技巧:
均線粘合先關注,放量上穿可買入;
陽穿多線是優選,長線走牛更選優!
多頭發散要拉升,脫離粘合是飛行。}
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
MA250:=MA(CLOSE,250);
DTPL:=MA10>MA30 AND MA30>REF(MA30,1);
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N,POINTDOT,LINETHICK0;
高粘:=(ZG/ZD-1)*100<N AND ZD>MA250,POINTDOT,LINETHICK0;
穿5:(粘合 AND CROSS(C,MA5))*0.5;
穿10:(粘合 AND CROSS(C,MA10))*1;
穿20:(粘合 AND CROSS(C,MA20))*2;
穿30:(粘合 AND CROSS(C,MA30))*3;
FLSZ:=(C/REF(C,1)-1)*100>=2 AND V>REF(V,1);
DXTP:=((穿5/0.5)+穿10+(穿20/2)+(穿30/3))>=2;
優選:(FLSZ AND DXTP AND MA30>REF(MA30,1))*3,COLOR00FFFF,LINETHICK2;
選優:(FLSZ AND DXTP AND MA30>REF(MA30,1) AND COUNT(高粘,20)>=15)*3,COLOR0000FF,LINETHICK2;
JXDT:=MA5>MA10 AND MA10>MA20 AND MA20>MA30;
發散:(JXDT AND NOT(REF(JXDT,1)))*1,COLOR00FF00,LINETHICK2;
起飛:(NOT(粘合) AND REF(粘合,1) AND COUNT(粘合,20)>=15 AND DTPL)*3,COLORFF00FF,LINETHICK2;
{以下設置副圖顯示方式}
STICKLINE(粘合,-0.2,0,4,0),COLOR00FF00;
STICKLINE(高粘,0.2,0,4,0),COLORFF00FF;
DRAWTEXT(優選,3,'優●選'),COLOR00FFFF;
DRAWTEXT(發散,2,'發●散'),COLOR00FF00;
DRAWTEXT(起飛,3,'起●飛'),COLOR00FFFF;
DRAWICON(選優,0.3,1);
DRAWICON(起飛,3,1);
------------
選股公式1)起飛;
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
DTPL:=MA10>MA30 AND MA30>REF(MA30,1);
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N;
起飛:(NOT(粘合) AND REF(粘合,1) AND COUNT(粘合,20)>=15 AND DTPL)*3;
--------------------------
選股公式2)發散{多頭};
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
JXDT:=MA5>MA10 AND MA10>MA20 AND MA20>MA30;
發散:(JXDT AND NOT(REF(JXDT,1)))*1;
--------------------------------------------------------
選股公式3)優選;
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N;
穿5:=(粘合 AND CROSS(C,MA5))*0.5;
穿10:=(粘合 AND CROSS(C,MA10))*1;
穿20:=(粘合 AND CROSS(C,MA20))*2;
穿30:=(粘合 AND CROSS(C,MA30))*3;
FLSZ:=(C/REF(C,1)-1)*100>=2 AND V>REF(V,1);
DXTP:=((穿5/0.5)+穿10+(穿20/2)+(穿30/3))>=2;
優選:(FLSZ AND DXTP AND MA30>REF(MA30,1))*3;
{多說一句,股市有風險}
C. 請高手幫我把下面指標做個預警公式,當副圖"啟動"等於50的時候預警,謝謝行家
A5:=MA(C,5);
A20:=MA(C,20);
A30:=MA(C,30);
M5:=ATAN((A5/REF(A5,1)-1)*100)*180/3.14159;
M20:=ATAN((A20/REF(A20,1)-1)*100)*180/3.14159;
M30:=ATAN((A30/REF(A30,1)-1)*100)*180/3.14159;
QSXS:=M30>0;
A50:=IF(M5<0,-25,0);
A51:=IF(BETWEEN(M5,0,45),25,A50);
A52:=IF(BETWEEN(M5,45,75),50,A51);
MA5:=IF(M5>75,75,A52)*QSXS,COLOR00FFFF;
A200:=IF(M20<0,-25,0);
A201:=IF(BETWEEN(M20,0,45),25,A200);
A202:=IF(BETWEEN(M20,45,75),50,A201);
MA20:=IF(M20>75,75,A202)*QSXS,COLORFF00FF;
A300:=IF(M30<0,-25,0);
A301:=IF(BETWEEN(M30,0,45),25,A300);
A302:=IF(BETWEEN(M30,45,75),50,A301);
MA30:=IF(M30>75,75,A302)*QSXS;
SGSJ:=BARSLAST(CROSS(MA5,REF(MA5+1,1)));
XGSJ:=BARSLAST(CROSS(REF(MA5-1,1),MA5));
列車:=IF(MA5>=50 AND MA20>=25 AND MA30>=25 AND SGSJ<XGSJ,50,25);
啟動:CROSS(列車,45);
D. 哪裡有免費好用的,有買賣點的股票指標公式呢
創幻及其它各大論壇多的是,不過指標說實在的用處不大。
E. 請問怎樣破解我買的股票軟體里指標公式的密碼
首先要知道你買的是什麼版本的軟體
咳,既然樓下都說了,那我也推薦到創幻論壇指標公式區,我是那裡的版主,歡迎你求助,或分享交流。
參考網址: http://www.chcj.net/forum-23-1.html
F. 那裡有好的股票軟體指標公式
沒有最好,只有更好
再好的公式,用的人多了,就不好了,且莊家也會利用該公式(指標)設陷
公式--各有特點
使用者--各有所好
________________________
下面的網站收錄了8個公式指標網站:
(7)指標公式
通達信公式天堂
MACD指標公式
理想論壇指標公式
創幻論壇指標公式
點金投資軟體公式
海風論壇股軟交流
同花順公式俱樂部
超牛股客網指標
__________________________
網路或google搜「揚搜」,然後在導航條上選「財經」
(這里我只要貼網址,就發不出,上黑名單了)
G. 求通達信k線選股公式
OK:REF(COUNT(C<O,3)=3,1) AND C>O AND C>REF(O,1);
{直接粘貼到預警公式里,就可了 }
H. VOL相關問題
一正量指標:
VOL成交量,配合K線圖,若當日收市價較前一日收市價上漲,以空心柱表示;反之以實心柱表示。
二、負量指標:
NVI(Negative Volume Index),與正量指標一樣是依照成交量的變化與股價的漲跌所算出的一個指標, 當NVI向上表示弱勢. 本指標可設定一條平均線。它可指示「醒目資金」在大眾未找到市場方向時已經入市,這些資金可能是內幕人士或投資大戶的,研究負量指標走勢,對後市有一定指導作用。
演算法及公式:如果今天成交量比昨日小 ,NVI = 前一日NVI + 100 * 漲跌幅 ,
否則,NVI = 前一天NVI ;
應用原則:
1. 當NVI指標向下穿越其平均線時,是買入信號
2. 當NVI指標向上穿越其平均線時,是賣出信號
I. 公式里時間周期的確認確定
Hm:=cross(diff,dea),linethick;
lm:=cross(dea,diff),linethick;
Dayh:=BARSLAST(hm),linethick;//金叉到現在的天數
dayl:=BARSLAST(lm),linethick;
上面是我在算macd金叉死天數的方法,供你參考,可能不是想要的。
tfilt的函數具體用法我也不是了解(我只用飛狐),下面是個tdx公式,用tfilt應該方法你參考一下,你對公式應該有基礎!
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL>0,A4,A3);
均價線:=IF(A<=CONST(A2),A5,DRAWNULL);
分鍾有效周期:=IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,DRAWNULL))));
分時價:=TFILT(CLOSE,CURRBARSCOUNT,00,CURRBARSCOUNT,00);
分時判斷:=IF(分時價=DRAWNULL,1,IF(分鍾有效周期=DRAWNULL,DRAWNULL,1));
{-----------------------------由MACD定位頂底-------------------------------}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
KX:=BARSSINCE(CLOSE);{←首次開盤價距金的天數}
HHN:=CONST(HHV(DIFF,KX));
HLN:=CONST(LLV(DEA,KX));
RC1:=CONST((HHN+HLN)/2);
SS:=((HHN-HLN)/200);
MACD底部:=(-100*SS+RC1)+-(-100*SS+RC1),COLOR669999;
MACD頂部:=(100*SS+RC1)+-(-100*SS+RC1),COLORFF0033;
MACD中軸:=0+-(-100*SS+RC1);
DIFF修正:=DIFF+-(-100*SS+RC1),COLOR008080;
DEA修正:=DEA+-(-100*SS+RC1),COLOR00FF00;
MACD修正:=2*(DIFF修正-DEA修正)+MACD中軸,COLOR0000BB,NODRAW;
MACD超跌:=CONST(LLV(MACD修正,KX));
MACD超跌線:=IF(MACD超跌<MACD底部,MACD超跌,MACD底部);
{----------------------利用MACD趨勢進行精確頂底判斷------------------------}
頂部:=MACD頂部+-MACD超跌線;
天際:=頂部*0.809;
中軸:=MACD中軸+-MACD超跌線;
海面:=頂部*0.191;
底部:=MACD底部;
{------------------------傳統KDJ指標結合MACD優化---------------------------}
RSVA:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*頂部;{採用21日月線優化}
K:SMA(RSVA,3,1),COLORFFFFFF,NODRAW;
D:SMA(K,3,1),COLOR00FFFF,NODRAW;
原J值參數:=3*K-2*D;
JD:=IF(原J值參數<底部,底部,原J值參數);{J值底部鈍化處理}
J:IF(JD>頂部,頂部,JD),COLORFF00FF,NODRAW;{底部鈍化處理後再進行頂部鈍化處理}
{---------------------------MACD多空量能判斷-------------------------------}
MACD多頭:DIFF修正+-MACD超跌線,COLOR339999;
空頭:DEA修正+-MACD超跌線,COLOR00FF00;
量能柱:2*(MACD多頭-空頭)+中軸,COLOR0000BB,NODRAW;
超前DEA:=(EMA(MACD多頭,7));
超前MACD:=2*(MACD多頭-超前DEA)+中軸;
{-----------------------------------大盤動向-------------------------------}
VAR1大盤:=LLV(LOW,13);
VAR2大盤:=HHV(HIGH,13);
VAR3大盤:=(SMA((CLOSE-VAR1大盤)/(VAR2大盤-VAR1大盤)*頂部,5,1))-頂部/2;
VAR4大盤:=SMA((VAR2大盤-CLOSE)/(VAR2大盤-VAR1大盤)*頂部,5,1)-頂部/2;
大盤散戶:=IF(VAR4大盤<底部,底部,VAR4大盤),COLOR408000;
大盤主力:=IF(VAR3大盤<底部,底部,VAR3大盤),COLOR330088;
{---------------------------------密集成本突破-----------------------------}
最高獲利參數:=頂部/100;
VAR1C:=(COST(89)-COST(11))*最高獲利參數;
VAR2C:=(COST(99.9)-COST(1))*最高獲利參數;
單峰:=((1-VAR1C/VAR2C))*頂部;
低密:=((COST(90)-COST(60))/VAR2C)*頂部;
高密:=((COST(40)-COST(1))/VAR2C)*頂部;
贏利:= (SMA(WINNER(AMOUNT/VOL/99),2,1))*頂部;
活躍度:頂部-頂部/(1+EXPMA(HSL,21)),COLOR774455;{←CYF公眾追漲熱情指標}
70%成本集中度:=IF(VAR1C>頂部,頂部,VAR1C),COLORFFFFFF;
90%成本集中度:=IF(VAR2C>頂部,頂部,VAR2C),COLORFF0000;
套牢籌碼上升:=IF((單峰-贏利)>底部,(單峰-贏利),底部);
個股散戶:=IF(套牢籌碼上升>頂部,頂部,套牢籌碼上升),COLOR408000;
散戶:IF(個股散戶=DRAWNULL,DRAWNULL,個股散戶),COLOR408000;
獲利籌碼上升:=IF((贏利-單峰)>底部,(贏利-單峰),底部);
個股主力:=IF(獲利籌碼上升>頂部,頂部,獲利籌碼上升),COLOR330088;
主力:IF(個股主力=DRAWNULL,DRAWNULL,個股主力),COLOR330088;
{--------------------換手率,五日換手率輔助判斷個股活躍度-------------------}
換手:SUM(VOL,1)/CAPITAL*100,COLOR666666,NODRAW;
⑤日換:SUM(VOL,5)/CAPITAL*100,COLOR999999,NODRAW;
{----------------------密集成本突破指標籌碼峰畫線--------------------------}
金色背景修邊1:STICKLINE(C>0 AND CURRBARSCOUNT>=2,頂部,底部,3.05,0),COLOR003333;
金色背景修邊2:STICKLINE(C>0 AND CURRBARSCOUNT>=2,頂部,中軸,3.05,0),COLOR003333;
金色背景補充:DRAWBAND(頂部,RGB(51,51,0),中軸,RGB(51,51,0));
金色背景:DRAWBAND(頂部,RGB(51,51,0),底部,RGB(128,128,128));
追漲熱度峰紫色:DRAWBAND(活躍度,RGB(66,52,81),底部,RGB(204,0,0));
高密峰墨藍色:=DRAWBAND(高密,RGB(0,0,51),底部,RGB(0,0,255));
低密峰純藍色:=DRAWBAND(低密,RGB(0,0,102),底部,RGB(0,0,255));
90%成本峰:DRAWBAND(90%成本集中度,RGB(0,0,153),底部,RGB(0,0,153));
70%成本峰:DRAWBAND(70%成本集中度,RGB(0,128,0),底部,RGB(255,255,255));
散戶峰綠色:DRAWBAND(散戶,RGB(0,64,0),底部,RGB(204,0,0));
主力峰紅色:DRAWBAND(主力,RGB(102,26,51),底部,RGB(0,0,255));
MACD多空趨勢:DRAWBAND(MACD多頭,RGB(204,51,51),空頭,RGB(0,179,0));
MACD多頭重畫:DRAWBAND(MACD多頭,RGB(153,153,51),MACD多頭,RGB(153,153,51));
MACD空頭重畫:DRAWBAND(空頭,RGB(0,204,0),空頭,RGB(0,204,0));
{--------創幻論壇'131488』會員提供的通達信■新寶塔線■-----原碼-----------}
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
三平底翻金:=(REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1))
AND VAR1;
主力啟動線:=MA(V,5),COLORFFFFFF;
主力洗盤線:=MA(V,35),COLOR00FFFF;
資金異動線:=MA(V,135),COLORFF0000;
{----------------------------買賣參考--------------------------------------}
出擊:=(CROSS(主力啟動線,資金異動線) OR ((主力洗盤線 > 資金異動線) AND CROSS(主力啟動線,主力洗盤線))),COLORYELLOW;
啟動:=(主力啟動線>REF(主力啟動線,1) AND (CROSS(VOL,主力啟動線) AND (REF(VOL,1)<REF(資金異動線,1) OR REF(VOL,2)<REF(資金異動線,2)))),COLOR45AAEE;
成立:=三平底翻金 AND (出擊 OR 啟動);
買入提示:=IF(成立=1,海面*0.5,0) AND 分時判斷=1;
{------------------------頂部線,天際線,海面線,底部線重畫-------------------}
頂部線:DRAWBAND(頂部,RGB(51,0,255),頂部,RGB(51,0,255));
天際線:DRAWBAND(天際,RGB(128,64,64),天際,RGB(128,64,64));
海面線:DRAWBAND(海面,RGB(0,153,153),海面,RGB(0,153,153));
底部線:DRAWBAND(0,RGB(153,153,102),買入提示,RGB(153,153,102));
{------------------------超前MACD多空量能柱--------------------------------}
超前MACD紅柱1:STICKLINE(超前MACD>=中軸,超前MACD,中軸,1.50,0),COLOR226688;
超前MACD紅柱2:STICKLINE(超前MACD>=中軸,超前MACD,中軸,0.95,0),COLOR4488BB;
超前MACD紅柱3:STICKLINE(超前MACD>=中軸,超前MACD,中軸,0.31,0),COLOR55AADD;
超前MACD蘭柱1:STICKLINE(超前MACD<=中軸,超前MACD,中軸,1.50,0),COLOR006600;
超前MACD蘭柱2:STICKLINE(超前MACD<=中軸,超前MACD,中軸,0.95,0),COLOR007700;
超前MACD蘭柱3:STICKLINE(超前MACD<=中軸,超前MACD,中軸,0.31,0),COLOR008800;
{--------------------------MACD多空量能柱----------------------------------}
MACD紅柱1:STICKLINE(量能柱>=中軸,量能柱,中軸,1.5,0),COLOR000077;
MACD紅柱2:STICKLINE(量能柱>=中軸,量能柱,中軸,1.1,0),COLOR000088;
MACD紅柱3:STICKLINE(量能柱>=中軸,量能柱,中軸,0.6,0),COLOR000099;
MACD紅柱4:STICKLINE(量能柱>=中軸,量能柱,中軸,0.15,0),COLOR0000AA;
MACD蘭柱1:STICKLINE(量能柱<=中軸,量能柱,中軸,1.5,0),COLORAA6633;
MACD蘭柱2:STICKLINE(量能柱<=中軸,量能柱,中軸,1.1,0),COLORBB7744;
MACD蘭柱3:STICKLINE(量能柱<=中軸,量能柱,中軸,0.6,0),COLORCC8855;
MACD蘭柱4:STICKLINE(量能柱<=中軸,量能柱,中軸,0.15,0),COLORDD9966;
{---------中軸線重畫及頂部線,天際線,海面線,底部線,多空線文字說明-----------}
中軸線:DRAWBAND(中軸,RGB(128,128,255),中軸,RGB(128,128,255));
頂部線文字:DRAWTEXT(CURRBARSCOUNT=1,頂部*0.98,' 頂部線'),COLORFF0033;
天際線文字:DRAWTEXT(CURRBARSCOUNT=1,天際*0.98,' 天際線'),COLOR404080;
海面線文字:DRAWTEXT(CURRBARSCOUNT=1,海面,' 海面線'),COLOR999900;
底部線文字:DRAWTEXT(CURRBARSCOUNT=1,底部,' 底部線'),COLOR669999;
中軸線文字:DRAWTEXT(CURRBARSCOUNT=1,中軸,' 多空線'),COLORFF8080;
{-------------------------------傳統KDJ指標線重畫--------------------------}
D線重畫:DRAWBAND(D,RGB(255,255,0),D*0.998,RGB(255,255,0));
K線重畫:DRAWBAND(K,RGB(255,255,255),K,RGB(255,255,255));
J線重畫:DRAWBAND(J,RGB(255,0,255),J,RGB(255,0,255));
J. 指標公式如何改寫成選股條件公式
【一品抄底】,是個副圖指標,既有線性輸出信號,也有買點提示信號,輸出類別眾多,就不是一個單獨的選股指標。如何修改、拆分出自己需要的【底部】選股信號,成為一個單獨的選股指標呢?如果還需要將【深坑】的信號,也單獨設置為選股指標,又該如何修改呢?在此先當做一個問題吧,繼續看了後面(二)、(三)小節的引路,相信你自己來就行了!
{一品抄底----創幻論壇一品茶緣編寫,通用副圖指標}
TYP := (HIGH + LOW + CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
A:=REF(C,1);
RSI:=SMA(MAX(C-A,0),6,1)/SMA(ABS(C-A),6,1)*100;
A1:=(C/MA(C,5)-1)*100<-10;
A2:=(C/MA(C,13)-1)*100<-10;
A3:=(C/MA(C,34)-1)*100<-15;
A4:=RSI<18;
A5:=CCI<-120;
A6:=COUNT(ABS(C/REF(C,1)-1)*100>=6,30)>=1;
底部:A1 AND A2 AND A3 AND A4 AND A5 AND A6,COLOR00FFFF,LINETHICK2;
CDSJ:=BARSLAST(底部);
ZF:=(C/REF(C,1)-1)*100;
深坑:IF(BETWEEN(CDSJ,0,5) AND L<=REF(C,CDSJ) AND ZF<=-5,-0.5,0),COLORFF0000,LINETHICK2;
機會:IF(CDSJ<=7 AND L<=REF(C,CDSJ),0.5,0),COLOR00FF00;
尋找選股信號的來源
所謂選股信號,多數都是屬於將已有的指標公式中具有買點類的信號特徵「剝離」出來。那麼,在指標中該保留哪些有用的源碼,刪除哪些無關的源碼呢?尋找選股信號的來源,就是最主要的過程。
尋找選股信號來源的方法,一般都是遵循從後往前尋找的原則。
具體步驟是:先找到發出指標信號的那行代碼,然後查看該行代碼中的所有條件,需要用到上面哪些源碼,再從後往前一一對應尋找出來;而其他無關的條件、修飾符號源碼,均可刪除。
舉例3:(本例子參考大慶老楊先生帖子,略有改動)
{股市馬經----副圖指標,源碼來自網路}
A1:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑馬線:EMA(A1,5),LINETHICK2,COLOR6600FF;
A2:=(黑馬線-REF(黑馬線,1))/REF(黑馬線,1)*100;
A3:=EMA(C,5);
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趨勢線:(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2)),LINETHICK2,coloryellow;
A5:=(HHV(H,60)-C)/(HHV(H,60)-LLV(L,60))*100;
DRAWTEXT(FILTER(REF(黑馬線,1)>90 AND A2<0,7),黑馬線,'跑'),COLOR00FF00;
DRAWTEXT(CROSS(A1,黑馬線)AND 黑馬線<A5,黑馬線,'黑馬');
DRAWTEXT(CROSS(黑馬線,A5)AND 趨勢線<80,黑馬線,'追漲');
DRAWTEXT(CROSS(趨勢線,0)AND 黑馬線<40,5,'大黑馬');
底部:(A2<-10 AND A2>REF(A2,1))*25,colorred;
DRAWICON(底部 AND A3>REF(A3,1),25,4);
機會來臨:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1),COLORF00FF0;
大勢已去:IF(CROSS(黑馬線,A1)AND 黑馬線>70 AND 趨勢線>80,90,100),COLORFF0000;
公式中涉及「買」的信號有黑馬、追漲、大黑馬、底部和機會來臨五個明顯的,另外還有一個畫圖標信號。
假如我們提取其中的【機會來臨】,仔細分析後,就是一句話:
機會來臨:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1);
這個可看作簡單提取。
如果提取【大黑馬】的話,從後向前推,涉及趨勢線和黑馬線兩個定義,這部分都有用:
A1:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑馬線:EMA(A1,5),LINETHICK2,COLOR6600FF;
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趨勢線:(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2)),LINETHICK2,coloryellow;
DRAWTEXT(CROSS(趨勢線,0) AND 黑馬線<40,5,'大黑馬');
(三)修改選股指標的方法
根據以上選股公式的特徵,結合尋找選股信號來源的方法,自己動手修改選股信號,應該就沒有太大的難度了!
舉例4:繼續承接上面(二)的例子。
修改步驟:
①先將線性輸出的A1、黑馬線、A4、趨勢線均限制輸出,方法很簡單,就是在他們的冒號後面直接加上等號=;
②再刪去修飾符LINETHICK2,COLOR6600FF:
③將本來是文字輸出的「黑馬線」修改成信號輸出;先將「黑馬線」三個字移動到最前面,並加上冒號:;然後保留符合黑馬線的限制條件CROSS(趨勢線,0) AND 黑馬線<40;同時刪除其餘無關的代碼,包括文字輸出函數DRAWTEXT、位置、括弧()等。
修改成選股指標後的源碼如下:
A1:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑馬線:=EMA(A1,5);
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趨勢線:=(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2));
大黑馬:CROSS(趨勢線,0) AND 黑馬線<40;
舉例5:
下面附圖指標【大三浪】中,如何選出出現「買」字提示信號的選股指標?
{大三浪----創幻論壇一品茶緣編寫,通用副圖指標}
{大三浪指標使用說明:
均線粘合且多頭,長期未漲庄吸籌;
目標鎖定先跟蹤,出擊買入等豐收!}
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多頭:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
多頭粘合:IF(多頭 AND 粘合,1,0),COLORFF00FF,POINTDOT,LINETHICK0;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:COUNT(MACD<0,10)=10,COLORFFFF00,POINTDOT,LINETHICK0;
目標:IF(多頭 AND 粘合 AND 庄股,5,0),COLORFFFFFF,LINETHICK2;
跟蹤:IF(目標,BARSLAST(CROSS(目標,0))+1,0),COLOR00FF00,POINTDOT,LINETHICK2;
出擊:IF(CROSS(0.1,目標) AND CROSS(MACD,0),8,0),COLOR00FFFF,LINETHICK2;
MJSJ:=BARSLAST(出擊>0);
漲幅:IF(MJSJ<=120,(C/REF(C,MJSJ)-1)*100,0),COLOR0000FF,POINTDOT,LINETHICK0;
日漲:IF(MJSJ<=120,漲幅/MJSJ,0),COLORFFFFFF,POINTDOT,LINETHICK0;
TPX:=MIN(MA65*1.15,MA21*1.13);
突破:IF(CROSS(C,TPX) AND 粘合 AND MA65>REF(MA65,1),10,0),COLOR0000FF,LINETHICK2;
{以下設置副圖顯示方式}
STICKLINE(多頭粘合,0,1,8,0),COLORFF00FF;
STICKLINE(庄股,0,MACD*10,8,0),COLORFFFF00;
DRAWTEXT(出擊=8,10,'★買'),COLOR00FFFF;
VERTLINE(CROSS(漲幅,20) AND COUNT(CROSS(漲幅,20),MJSJ)=1,2),COLOR0000FF; 根據選股指標的步驟,一步一步來:
①首先找到出現「★買」提示的一行代碼,發現她其實就是「出擊」的信號;
②從後往前,找到「出擊」信號的條件,發現他與「目標」、MACD有關;
再次往前尋找,又發現「目標」信號的條件,與「多頭」、「粘合」、「庄股」三個條件有關,由此,保留相關條件代碼,其餘刪除,如下:
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多頭:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:COUNT(MACD<0,10)=10,COLORFFFF00,POINTDOT,LINETHICK0;
目標:IF(多頭 AND 粘合 AND 庄股,5,0),COLORFFFFFF,LINETHICK2;
出擊:IF(CROSS(0.1,目標) AND CROSS(MACD,0),8,0),COLOR00FFFF,LINETHICK2;
③限制輸出數量,只保留「出擊」信號的輸出,其他的輸出信號均加上等號=加以限制輸出;
④刪除多餘的修飾符號,如:COLORFFFF00,POINTDOT,LINETHICK0等。
⑤IF格式也可簡化,只保留需要的條件,輸出信號自動為1。「出擊」兩字也可修改為「買」。
修改完最後保留的源碼如下:
{大三浪----選股指標}
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多頭:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:=COUNT(MACD<0,10)=10;
目標:=IF(多頭 AND 粘合 AND 庄股,5,0);
買:CROSS(0.1,目標) AND CROSS(MACD,0); 導入選股指標的途徑
①修改完後的選股指標源碼,想做成選股指標,並非放在指標系統之下的【技術指標】分類,一般是放入【條件選股】分類;便於設置預警、自動選股。
②還可將選股指標加入交易系統中,但需要注意的是:輸出信號必須為英文單詞的買入ENTERLONG、賣出EXITLONG信號。在應用時,飛狐軟體輸入該交易系統指標名稱,即可在主圖自動顯示買賣信號的提示。
源碼如下:
ENTERLONG:CROSS(MA(C,3),MA(C,8));----表示輸出多頭買入信號。
EXITLONG:CROSS(MA(C,8),MA(C,3));----表示輸出空頭賣出信號。