您現在的位置: 南方財富網(wǎng) >> 股票知識 >> 股票公式 >> 正文
南財搜索

怎樣自編股票公式

2011-7-1 9:59:14   來(lái)源:不詳   佚名
    
第一部分:引用已有公式中的數據
基本引用例一
       "macd.  diff",   "macd.dea";
基本格式: 指標名稱(chēng) 語(yǔ)句名稱(chēng) 。ㄗ⒁猓罕仨氂秒p引號引上)
加入參數例二
       "kdj.   k"     (9,3,3)     ;
基本格式:指標名稱(chēng) 語(yǔ)句名稱(chēng)   參數。ㄖ笜嗣Q(chēng)和語(yǔ)句名稱(chēng)之間用隔點(diǎn).隔開(kāi))
加入參數例三
       周m:"macd.   diff   #WEEK";
引用周線(xiàn):指標名稱(chēng) 語(yǔ)句名稱(chēng) 周函數。ㄗ⒁猓褐芎瘮登凹樱W痔枺
月K:"kdj.k#MONTH";
引用月線(xiàn)同上,只是換成月函數。
-
應用實(shí)例:主圖 頂底背離
A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
B1:=ref(c,A1+1)>c and ref("macd.diff"(12,26,9),A1+1)<"macd.diff"(12,26,9) and cross("macd.diff"(12,26,9),"macd.dea"(12,26,9));
MACD底背離:STICKLINE(FILTER(B1>0,5),0,0.75,3,0),COLOR00FF00;
DRAWTEXT(FILTER(B1>0,5),0.57,'MACD底背離'),COLOR00FF00;
A2:=BARSLAST(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
B2:=ref(c,A2+1)>c and ref("kdj.k"(9,3,3),A2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));
KDJ底背離:STICKLINE(FILTER(B2>0,5),0,1,3,0),COLORYELLOW;
DRAWTEXT(FILTER(B2>0,5),0.80,'KDJ底背離'),COLORYELLOW;
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) and cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
RSI底背離:STICKLINE(FILTER(B3>0,5),0,0.5,3,0),COLORFFCC66;
DRAWTEXT(FILTER(B3>0,5),0.25,'RSI底背離'),COLORFFCC66;
DRAWTEXT(FILTER(D1>0,5),1.47,'MACD頂背離'),COLOR0066FF;
C2:=BARSLAST(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
D2:=ref(c,C2+1)"kdj.k"(9,3,3) and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
KDJ頂背離:STICKLINE(FILTER(D2>0,5),2,1,3,0),COLORRED;
DRAWTEXT(FILTER(D2>0,5),1.2,'KDJ頂背離'),COLORRED;
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1)"RSI.RSI1"(6,12,24) and cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
RSI頂背離:STICKLINE(FILTER(D3>0,5),2,1.5,3,0),COLORFF00FF;
DRAWTEXT(FILTER(D3>0,5),1.75,'RSI頂背離'),COLORFF00FF;

                 第二部分 逐步增加函數
均線(xiàn)為例,主圖:
基本句型
MA5:MA(C,5);
MA10:MA(C,10);
MA30:MA(C,30);
MA60:MA(C,60);
增加顏色(注:在沒(méi)有顏色輸出符號時(shí),系統會(huì )自動(dòng)加上顏色)
MA5:MA(C,5),COLORBLUE;
MA10:MA(C,10),COLORF00FF0;
MA30:MA(C,30),COLORFFFF00;
MA60:MA(C,60),COLORYELLOW;
將10日均線(xiàn)變成小圓圈線(xiàn)
MA5:MA(C,5),COLORBLUE;
MA10:MA(C,10),COLORF00FF0,CIRCLEDOT;
MA30:MA(C,30),COLORFFFF00;
MA60:MA(C,60),COLORYELLOW;
將60日均線(xiàn)加粗
MA5:MA(C,5),COLORBLUE;
MA10:MA(C,10),COLORF00FF0,CIRCLEDOT;
MA30:MA(C,30),COLORFFFF00;
MA60:MA(C,60),COLORYELLOW,LINETHICK3;
在5日均線(xiàn)金叉10日均線(xiàn)處顯示符號
MA5:MA(C,5),COLORBLUE;
MA10:MA(C,10),COLORF00FF0,CIRCLEDOT;
MA30:MA(C,30),COLORFFFF00;
MA60:MA(C,60),COLORYELLOW,LINETHICK3;
金叉:=CROSS(MA5,MA10);
DRAWICON(金叉,L,1); 
DRAWTEXT(金叉,L,'金叉');
STICKLINE(金叉,H,L,6,0);。ㄗⅲ哼@三種顯示方式用其中一種就行)
30日均線(xiàn)向上時(shí)顯示紅色,否則為綠色
MA5:MA(C,5),COLORBLUE;
MA10:MA(C,10),COLORF00FF0,CIRCLEDOT;
MA30:MA(C,30),COLORFFFF00;
MA60:MA(C,60),COLORYELLOW,LINETHICK3;
金叉:=CROSS(MA5,MA10);
DRAWICON(金叉,L,1);
DRAWTEXT(金叉,L,'金叉');
STICKLINE(金叉,H,L,6,0);
PARTLINE(MA30>=REF(MA30,1),MA30),COLORRED;
PARTLINE(MA30<REF(MA30,1),MA30),COLOR00FF00;
(注:最后兩行為劃分段線(xiàn),大智慧沒(méi)有此項功能,大智慧2和分析家 同花順用下面這行)
PARTLINE(MA30,MA30>=REF(MA30,1),RGB(255,0,0),MA30<REF(MA30,1),RGB(0,255,0),1);
通達信用下面這兩行:
IF(MA30>=REF(MA30,1),MA30,DRAWNULL),COLORRED;
IF(MA30<REF(MA30,1),MA30,DRAWNULL),COLOR00FF00;

上一頁(yè)  [1] [2] [3] [4] [5] 下一頁(yè)

(南方財富網(wǎng)SOUTHMONEY.COM)

(責任編輯:張曉軒)

    南方財富網(wǎng)聲明:股市資訊來(lái)源于合作媒體及機構,屬作者個(gè)人觀(guān)點(diǎn),僅供投資者參考,并不構成投資建議。投資者據此操作,風(fēng)險自擔。
商務(wù)進(jìn)行時(shí)
每日必讀
學(xué)院24小時(shí)排行
證券導讀
熱圖推薦

關(guān)于南方財富網(wǎng)版權聲明誠聘英才廣告服務(wù)網(wǎng)站地圖友情鏈接
特此聲明:廣告商的言論與行為均與南方財富網(wǎng)無(wú)關(guān)
www.travelwithnise.com
南方財富網(wǎng) © 版權所有 閩ICP備09035581號
最近中文字幕高清免费大全8