要怎么才能優(yōu)化下面的模型?
作者:文華財經(jīng) 來源:cxh99.com 發(fā)布時間:2019年08月28日
-
咨詢內容:
?AA:HHV(HIGH,N),COLORMAGENTA;BB:LLV(LOW,N),COLORGREEN;TR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));ATR:=MA(TR,26),COLORYELLOW;//求真實波幅DDZY:HV(H,10)-1.8*ATR,COLORYELLOW;MA1:MA(CLOSE,N1),COLORCYAN,LINETHICK1;MA2:MA(CLOSE,N2),COLORMAGENTA,LINETHICK1;B1:=EMA((2*CLOSE+HIGH+LOW)/4,5);A1:IF(EMA((2*CLOSE+HIGH+LOW)/4,5)>REF(EMA((2*CLOSE+HIGH+LOW)/4,5),1),B1,NULL),COLORRED;A2:IF(EMA((2*CLOSE+HIGH+LOW)/4,5)<REF(EMA((2*CLOSE+HIGH+LOW)/4,5),1),B1,NULL),COLORGREEN;B2:=EMA((2*CLOSE+HIGH+LOW)/4,13);A3:IF(EMA((2*CLOSE+HIGH+LOW)/4,13)>REF(EMA((2*CLOSE+HIGH+LOW)/4,13),1),B2,NULL),COLORRED;A4:IF(EMA((2*CLOSE+HIGH+LOW)/4,13)<REF(EMA((2*CLOSE+HIGH+LOW)/4,13),1),B2,NULL),LINETHICK2,COLORGREEN;B3:=REF(EMA((LOW+CLOSE+OPEN)/3,25),1);A5:IF(EMA((LOW+CLOSE+OPEN)/3,21)>REF(EMA((LOW+CLOSE+OPEN)/3,21),1),B3,NULL),LINETHICK3,COLORRED;A6:IF(EMA((LOW+CLOSE+OPEN)/3,21)<REF(EMA((LOW+CLOSE+OPEN)/3,21),1),B3,NULL),LINETHICK3,COLORGREEN;CROSSUP(CLOSE,ROUND(REF(A6,1),1))&&ISNULL(A6)=1,WORD(0,'多',BK;//做多開倉CROSSDOWN(CLOSE,ROUND(A1,1))&&REF(CLOSE,1)<=A1 ,WORD(0,'多',BP;//平多倉//盤整不平倉//10周期未創(chuàng)新高或10周期創(chuàng)新高并且創(chuàng)新低//到達開倉的那根K線的最低價止損BPCROSSDOWN(CLOSE,ROUND(REF(A5,1),1))&&ISNULL(A5)=1,WORD(0,'空',SK;//做空開倉CROSSUP(CLOSE,INTPART(A2))&&REF(CLOSE,1)>=A2,WORD(1,'空',SP;//平空倉//盤整不平倉//10周期未創(chuàng)新低或10周期創(chuàng)新高并且創(chuàng)新低//到達開倉的那根K線的最高止損SPHH:VALUEWHEN(CROSS(C,MA(C,5)),H);//取收盤價上穿五周期均線時的最高價HH1:LOOP1(HH,50,SECONDMAX_VALUE);//50 周期內收盤價上穿均線時的最高價的次高值BBB:LOOP2(BARSBK=1,LOOP2(L>LV(L,4),L,LV(L,4)),LOOP2(L>REF(BB,1),L,REF(BB,1)));SS:LOOP2(BARSSK=1,LOOP2(H<HV(H,4),H,HV(H,4)),LOOP2(H<REF(SS,1),H,REF(SS,1)));
//持有多單時,開多單那根的前面 4 個周期內的最低價為起始止損點 BB,后續(xù) K 線最低價比前一//個最低價高,取當前最低價為止損點,否則取前一個低點為止損點;//持有空單時,開空單那根的前面 4 個周期內的最高價為起始止損點 SS,最高價比前一個最高價//低,取當前最高價為止損點,否則取前一個高點為止損點。
CROSSDOWN(CLOSE,ROUND(REF(A1,1),1))&&CROSSDOWN(CLOSE,ROUND(REF(A3,1),1))&& CROSSDOWN(CLOSE,ROUND(REF(A5,1),1)),WORD(1,'空',BPK;//一根K線同時穿過A2、A4、A6判斷賬戶是否有多倉后反手做空,否則開空
CROSSUP(CLOSE,ROUND(REF(A2,1),1))&&CROSSUP(CLOSE,ROUND(REF(A4,1),1))&& CROSSUP(CLOSE,ROUND(REF(A6,1),1)),WORD(0,'多',SPK;//一根K線同時穿過A1、A3、A5判斷賬戶是否有空倉后反手做多,否則開AUTOFILTER;
?
?來源:程序化99
-
文華技術人員:
論壇只提供編寫服務,不提供思路指導
您具體說明下您要如何進行優(yōu)化