智慧拉升源碼
⑴ 這個公式怎樣改成大智慧能用的
input:n1(5,1,300);n2(10,1,300);n3(21,1,300);n4(60,1,300);
牛熊:EMA(CLOSE,N4),colorgreen,LINETHICK3;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,8);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
DRAWTEXT(IF(B1>0,1,0),L-0.1,'MACD底背'),colorgreen;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
DRAWTEXT(IF(B2>0,1,0),L-0.25,'KDJ底背'),coloryellow;
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
DRAWTEXT(IF(B3>0,1,0),L-0.4,'RSI底背'),colorcyan;
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(IF(D1>0,1,0),H+0.1,'MACD頂背'),colorwhite;
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
DRAWTEXT(IF(D2>0,1,0),H+0.25,'KDJ頂背'),colorwhite;
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
DRAWTEXT(IF(D3>0,1,0),H+0.4,'RSI頂背'),colormagenta;
SG:EMA(HHV(H,1),8),colorgray;
X1:EMA(CLOSE,N1),coloryellow;
JJ:=(H+L+3*C)/5;
VAR21:=EMA(JJ,5);VAR22:=EMA(JJ,13);VAR23:=EMA(JJ,21);VAR24:=EMA(JJ,34);H1A:=(VAR21+VAR22+VAR23+VAR24)/4;
成本和諧:MA(H1A,5),colorred,LINETHICK2;
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
LL:=LLV(C,100);
X11:STICKLINE(成本和諧>REF(成本和諧,1) , 成本和諧*0.998,成本和諧*1.002,8,0),colorred,LINETHICK2;
X30:=X1<REF(X1,1) AND C<X1;
X31:STICKLINE(SG<REF(SG,1) OR X30, SG*0.998,SG*1.004,8,0),colorblue,LINETHICK3;
X21:STICKLINE(成本和諧<REF(成本和諧,1) , 成本和諧*0.998,成本和諧*1.002,8,0),colorgray,LINETHICK4;
TJ:=IF((C-REF(C,1))/REF(C,1)>0.025,1,0);
STICKLINE(C>REF(O,BARSLAST(TJ =1)),REF(O,BARSLAST(TJ =1)),REF(O,BARSLAST(TJ =1)),10,0),colorgreen;
VAR4:=(LOW+HIGH+CLOSE)/3;
操作: MA(VAR4,5),LINETHICK2,colormagenta;
拉升:HHV(操作,13),colorblue,LINETHICK1;
壓力:HHV(操作,60),colorblue;
買賣:LLV(操作,13),LINETHICK1,COLOR00FF00;
底部支撐: LLV(LOW,60)*1.02,COLOR00CCFF;
頂部: HHV(HIGH,60)*0.98,COLORFFFFCC;
STICKLINE(操作>REF(操作,1),操作,操作+0.018,5,0),coloryellow,LINETHICK4;
STICKLINE(拉升>REF(拉升,1),拉升,拉升+0.018,5,0),coloryellow,LINETHICK2;
STICKLINE(拉升=REF(拉升,1),拉升,拉升,1,1),colorblue;
STICKLINE(買賣=REF(買賣,1),買賣,買賣,1,1),colorred;
STICKLINE(買賣>REF(買賣,1),買賣,買賣+0.028,4,1),COLORF00FF0,LINETHICK2;
STICKLINE(頂部=REF(頂部,1),頂部,頂部,7,1),colorred;
STICKLINE(壓力=REF(壓力,1),壓力,壓力,7,1),colorblue;
STICKLINE(底部支撐=REF(底部支撐,1),底部支撐,底部支撐,1,1),colorred;
⑵ 請高手幫我編寫一個大智慧公式
A1:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/CAPITAL*100,IF(CLOSE<REF(CLOSE,1),-VOL/CAPITAL*100,0)),0);
成交額:=V*C/100;{萬元}
A2:=SUM((IF(((成交額/8>20) AND (CLOSE>(REF(CLOSE,1)))),成交額,0)),0);A3:=SUM((IF(((成交額/8>20) AND (CLOSE<(REF(CLOSE,1)))),成交額,0)),0);
A4:=SUM((IF(((成交額/8<20) AND (CLOSE>(REF(CLOSE,1)))),成交額,0)),0);A5:=SUM((IF(((成交額/8<20) AND (CLOSE<(REF(CLOSE,1)))),成交額,0)),0);
A6:=((A2+A3)+A4)+A5;
A7:=IF(BARSTATUS=2,((100*A2)/A6),0);
A8:=IF(BARSTATUS=2,((100*A3)/A6),0);
A9:=IF(BARSTATUS=2,((100*A4)/A6),0);
A10:=IF(BARSTATUS=2,((100*A5)/A6),0);
增減倉:A1;
機構買:(A2),LINETHICK6,COLORRED;
機構賣:(A3),LINETHICK6,COLORFFFF55;
機構進出:機構買-機構賣;
散戶買:(A4),COLOR5555FF;{細紅線}散戶賣:(A5),COLOR55FF55;{細綠線}
強勢:((100*A2)/A6>50);STICKLINE(強勢,機構買*1.02,機構買*1.1,1,0),COLORYELLOW;
拉升:((100*A2)/A6-(100*A3)/A6)>18 AND (100*A2)/A6-(100*A5)/A6>18;STICKLINE(拉升,機構買*1.1,機構買*1.2,1,0),COLORFF00FF;
DRAWTEXT(BARSTATUS=2,機構買*0.95,'●機構買'),LINETHICK2,COLORRED;DRAWTEXT(BARSTATUS=2,機構賣*0.95,'○機構賣'),LINETHICK2,COLORFFFF55;
DRAWTEXT(機構進出>0 AND REF(機構進出,1)<=0,機構買*1.02,'●機買'),COLORRED;
DRAWTEXT(機構進出<0 AND REF(機構進出,1)>=0,機構買*0.98,'○機賣'),COLORFFFF55;
(已測試)