文华财经多空红绿飘带顶部画线主图指标公式源码:
多空:MA(CLOSE,1779),COLORLIGHTGREEN;
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),100);//最高价与最低价做差,最高价与前一周期收盘价做差,最低价与前一周期收盘价作差,在上述三个数据中取绝对值最大者,对该最大值做N周期累加求和。。
HD := HIGH-REF(HIGH,1);//最高价与前一周期最高价做差
LD := REF(LOW,1)-LOW;//前一周期最低价与最低价做差
DMP:= SUM(IFELSE(HD>0 && HD>LD,HD,0),100);//如果HD>0并且HD>LD,取HD否则取0,对取值做N周期累加求和。
DMM:= SUM(IFELSE(LD>0 && LD>HD,LD,0),100);//如果LD>0并且LD>HD,取LD否则取0,对取值做N周期累加求和。
PDI: DMP*100/TR;
W1:-100*(HHV(HIGH,432)-CLOSE)/(HHV(HIGH,432)-LLV(LOW,432));//N周期内最高价与收盘价之差与N周期内最高价和最低价之差之间的比值,取负。
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),10,1)/SMA(ABS(CLOSE-LC),10,1)*100;
TYP:= (HIGH + LOW + CLOSE)/3;
CCI:=(TYP-MA(TYP,150))/(0.015*AVEDEV(TYP,150));
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
O3:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
M:=49;
MAO3:MA(O3,M);
IF(多空>REF(多空,2),多空,NULL),COLORMAGENTA,LINETHICK2;
DIFF: EMA(CLOSE,32) – EMA(CLOSE,64),COLORBLACK;
DEA: EMA(DIFF,30),COLORBLACK;
MD:2*(DIFF-DEA),COLORSTICK;
COND:=CROSS(DIFF,DEA)&&DIFF<1.455&&DIFF>1.275;
DRAWCOLORKLINE(PDI<14.90,COLORBLUE,3);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
成交额:IF(STKTYPE=1,OPI,UNIT*V*AVPRICE),NODRAW;PLAYSOUND(成交额>1010000000&&(TIME<939),’B’);
DRAWTEXT(成交额>1010000000&&(TIME<939),C,’ 大量—’),COLORRED;
OO:=VALUEWHEN(DAYBARPOS=2,O/1.0002);
DRAWSL(C>OO,OO,0,1,0,COLORMAGENTA);
DRAWSL(C<OO,OO,0,1,0,COLORGREEN);
T33:=TIME=931;
开前底:REF(O/1.0002,BARSLAST(T33)),COLORBLACK,LINETHICK1;
DRAWICON(C>开前底*1.011&&W1>-15&&CCI>190,H,’ICO78′);
DRAWICON(C>开前底*1.0149&&W1>-15&&CCI>190,H,’ICO152′);
DRAWICON(C<开前底/1.0139&&C<开前底/1.0142&&W1<-68&&CCI<145,L,’ICO158′);
DRAWICON(C<开前底/1.0165&&W1<-68&&CCI<145,L,’ICO159′);
DRAWICON(C<开前底/1.0345&&W1<-68&&CCI<145,L,’ICO157′);
DRAWTEXT(成交额>1010000000&&W1>-6,H/1.00015,’顶部————————’),COLORCYAN;
//不同的开仓条件开仓,用不同的平仓条件,有针对性的平仓。达到不同行情试用不同策略的目的。
M1:=3;
MAO33:MA(O3,M1);
T32:=TIME=931;
开底:REF(MAO33,BARSLAST(T33)),COLORLIGHTRED,LINETHICK1;
多多空:MA(CLOSE,96),COLORBLACK;
DRAWCOLORKLINE(MAO33<开底,COLORLIGHTGREEN,1);
DRAWCOLORKLINE(MAO3>开底,COLORRED,1);
DRAWCOLORKLINE(C<多多空,COLORLIGHTGREEN,1);
DRAWCOLORKLINE(PDI<15.12,COLORYELLOW,3);
DRAWCOLORKLINE(PDI<14.90,COLORBLUE,3);
PLAYSOUND(CROSS(开底,MAO33)&&(TIME<941),’E’);
DRAWICON(CROSS(开底,MAO33)&&(TIME<941),O,’ICO2′);
PLAYSOUND(CROSS(MAO33,开底)&&(TIME<941),’E’);
DRAWICON(CROSS(MAO33,开底)&&(TIME<941),O,’ICO89′);
DRAWICON(CROSS(RSI1,23.5)&&MAO33>开底&&W1<-50,L,’ICO138′);
DRAWICON(CROSS(73.5,RSI1)&&W1<-74&&MAO33<开底,H,’ICO148′);
PLAYSOUND(CROSS(73.5,RSI1)&&W1<-74&&MAO33<开底,’B’);
B:MA(CLOSE,30),COLORBLACK;
D:MA(CLOSE,120),COLORBLACK;
FILLRGN(B>D,B,D,COLORRED);
FILLRGN(B<D,B,D,COLORLIGHTGREEN);
DRAWKLINE1(H,O,L,C);
STICKLINE(B<D,O,C,5,0),COLORLIGHTGREEN;