期貨秘笈■黃金程式■當沖1乒■
DRAWGBK(CLOSE>0,COLORRGB(3,353,888),COLORRGB(3,353,888),3);
TM:=IF(HOUR=13 AND MINUTE=45,CLOSE,0);
VERTLINE(TM),LINEDOT,colorFFFFFF;
昨日收盤:REF(CLOSE,BARSLAST(TM)),LINETHICK0,colorFFFF;
H1:=IF(REF(TM,1),HIGH,0);
今日開高:REF(H1,BARSLAST(H1)),POINTDOT,colorFF;
H2:=REF(REF(H1,BARSLAST(H1)),1);
L1:=IF(REF(TM,1),LOW,0);
今日開低:REF(L1,BARSLAST(L1)),POINTDOT,colorFF00;
L2:=REF(REF(L1,BARSLAST(L1)),1);
隱藏01主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
隱藏02主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
隱藏03主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
隱藏04主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
隱藏05主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
隱藏06主線:EMA(EMA(CLOSE,3),6),LINETHICK0,color10000;
空A值線:MA(HIGH+3.2,7),LINETHICK0;
多B值線:MA(LOW,3),LINETHICK0;
HL值:=LLV(空A值線+2.5,3);
LL值:=LLV(多B值線-2.5,2);
CH值:=CROSS(CLOSE,HL值);
CL值:=-CROSS(LL值,CLOSE);
TF值:=IF(CH值,CH值,IF(CROSS(LL值,CLOSE),CL值,0));
UD值:=REF(TF值,BARSLAST(TF值));
多空線:=IF(UD值>0,LL值,HL值);
PARTLINE(1,多空線),LINETHICK1,colorFFFFFF;
PARTLINE(UD值=1 AND REF(UD值,1)=1,LL值),LINETHICK1,colorFFFFFF;
PARTLINE(UD值=-1 AND REF(UD值,1)=-1,HL值),LINETHICK1,colorFFFFFF;
多空:=(20*多空線+19*REF(多空線,1)+18*REF(多空線,2)+17*REF(多空線,3)+16*REF(多空線,4)+15*REF(多空線,5)+14*REF(多空線,6)+13*REF(多空線,7)+12*REF(多空線,8)+11*REF(多空線,9)+10*REF(多空線,10)+9*REF(多空線,11)+8*REF(多空線,12)+7*REF(多空線,13)+6*REF(多空線,14)+5*REF(多空線,15)+4*REF(多空線,16)+3*REF(多空線,17)+2*REF(多空線,18)+REF(多空線,20))/210;
多空棒線:多空,LINETHICK8,colorFFFFFF;
STICKLINE(IF(多空<多空線,多空<=1.015*多空線,多空<=1.00001*多空線),多空,多空線,8,1),LINETHICK5,colorFF;
STICKLINE(多空>1.00002*多空線,多空,多空線,8,1),LINETHICK5,colorFF00;
黃金K棒:ZIG(CLOSE,0.6),LINETHICK0,colorFFFFFF;
STICKLINE(ISUP AND 黃金K棒>=REF(黃金K棒,1),HIGH,LOW,0,0),color10000;
STICKLINE(ISUP AND 黃金K棒>=REF(黃金K棒,1),CLOSE,OPEN,7,0),color10000;
STICKLINE(ISDOWN AND 黃金K棒>=REF(黃金K棒,1),HIGH,LOW,0,1),color10000;
STICKLINE(ISDOWN AND 黃金K棒>=REF(黃金K棒,1),CLOSE,OPEN,7,1),color10000;
STICKLINE(ISUP AND 黃金K棒<REF(黃金K棒,1),HIGH,LOW,0,1),color10000;
STICKLINE(ISUP AND 黃金K棒<REF(黃金K棒,1),CLOSE,OPEN,7,1),color10000;
STICKLINE(ISDOWN AND 黃金K棒<REF(黃金K棒,1),HIGH,LOW,0,0),color10000;
STICKLINE(ISDOWN AND 黃金K棒<REF(黃金K棒,1),CLOSE,OPEN,7,0),color10000;
STICKLINE(ISEQUAL AND 黃金K棒>=REF(黃金K棒,1),HIGH,LOW,0,1),color10000;
STICKLINE(ISEQUAL AND 黃金K棒>=REF(黃金K棒,1),CLOSE,OPEN,7,1),color10000;
STICKLINE(ISEQUAL AND 黃金K棒<REF(黃金K棒,1),HIGH,LOW,0,1),color10000;
STICKLINE(ISEQUAL AND 黃金K棒<REF(黃金K棒,1),CLOSE,OPEN,7,1),color10000;
AA:=REF(HIGH,0.5)=HHV(HIGH,1*30*0.5+1);
AAA:=FILTER(AA,0.5);
BB:=BACKSET(AAA,0.5+1);
CC1:=FILTER(BB,0.5);
CC:=CC1 OR ISLASTBAR;
AA2:=REF(LOW,0.5)=LLV(LOW,3*30*0.5+1);
AAA2:=FILTER(AA2,0.5);
BB2:=BACKSET(AAA2,0.5+1);
CC22:=FILTER(BB2,0.5);
CC2:=CC22 AND NOT(CC1);
EA:=BACKSET(CC,REF(BARSLAST(CC2),1)+1);
EB:=EA>REF(EA,1);
EE:=BACKSET(EB,2);
FF1:=EE>REF(EE,1);
EE2:=BACKSET(FF1 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF2:=EE2>REF(EE2,1);
EE3:=BACKSET(FF2 AND COUNT(CC,REF(BARSLAST(CC2),1)+2)=0,REF(BARSLAST(CC2),1)+2);
FF3:=EE3>REF(EE3,1);
JS:=IF(CC,COUNT(CC2,REF(BARSLAST(CC),1)+1),0);
G1:=IF(JS=1 AND CC,BARSLAST(FF1),0);
GA:=IF(CC AND REF(LOW,BARSLAST(FF1))>=REF(LOW,BARSLAST(FF2)),BARSLAST(FF2),BARSLAST(FF1));
G2:=IF(JS=2 AND CC,GA,0);
G3:=IF(JS>=3 AND CC,IF(CC AND REF(LOW,GA)>=REF(LOW,BARSLAST(FF3)),BARSLAST(FF3),GA),0);
GG:=G1+G2+G3;
JA:=BACKSET(CC,GG);
JB:=JA>REF(JA,1);
JJ:=BACKSET(JB,2);
LD低多:=JJ>REF(JJ,1);
LD1:=LD低多 OR ISLASTBAR;
HEA:=BACKSET(LD1,REF(BARSLAST(CC),1)+1);
HEB:=HEA>REF(HEA,1);
HEE:=BACKSET(HEB,2);
HFF1:=HEE>REF(HEE,1);
HEE2:=BACKSET(HFF1 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
HFF2:=HEE2>REF(HEE2,1);
HEE3:=BACKSET(HFF2 AND COUNT(LD1,REF(BARSLAST(CC),1)+2)=0,REF(BARSLAST(CC),1)+2);
HFF3:=HEE3>REF(HEE3,1);
HJS:=IF(LD1,COUNT(CC1,REF(BARSLAST(LD1),1)+1),0);
HG1:=IF(HJS=1 AND LD1,BARSLAST(HFF1),0);
HGA:=IF(LD1 AND REF(HIGH,BARSLAST(HFF1))<=REF(HIGH,BARSLAST(HFF2)),BARSLAST(HFF2),BARSLAST(HFF1));
HG2:=IF(HJS=2 AND LD1,HGA,0);
HG3:=IF(HJS>=3 AND LD1,IF(LD1 AND REF(HIGH,HGA)<=REF(HIGH,BARSLAST(HFF3)),BARSLAST(HFF3),HGA),0);
HGG:=HG1+HG2+HG3;
HJA:=BACKSET(LD1,HGG);
HJB:=HJA>REF(HJA,1);
HJJ:=BACKSET(HJB,2);
HD高空:=HJJ>REF(HJJ,1);
HD高空點:=IF(REF(HD高空,0)=1,1,0);
LD低多點:=IF(REF(LD低多,0)=1,1,0);
X1:=BACKSET(ISLASTBAR,BARSLAST(LD低多點)+1);
X2:=X1>REF(X1,1);
Y1:=BACKSET(ISLASTBAR,BARSLAST(HD高空點)+1);
Y2:=Y1>REF(Y1,1);
Z1:=IF(BARSLAST(X2)<BARSLAST(Y2),X2,Y2);
Z2:=IF(BARSLAST(X2)<BARSLAST(Y2),LOW,HIGH);
DRAWLINE(Z1,Z2,ISLASTBAR,CLOSE,0),colorFF00FF;
HD高空劃:=IF(REF(HD高空,0)=1,1,0);
LD低多劃:=IF(REF(LD低多,0)=1,1,0);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD低多劃)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD低多劃),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD高空劃)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD高空劃),1)+2);
XX2:=WW2>REF(WW2,1);
前1高:REF(HIGH,BARSLAST(VV2)),LINEDASH,LINETHICK2,colorFF00;
前1低:REF(LOW,BARSLAST(VV)),LINEDASH,LINETHICK2,colorFF;
DRAWNUMBER(ISLASTBAR,前1高,前1高,0),SHIFT4,colorFF00;
DRAWNUMBER(ISLASTBAR,前1低,前1低,0),SHIFT4,colorFF;
DRAWTEXT(HD高空點,HIGH,'一[A1策]▼空'),PXUP45,colorFF00;
DRAWTEXT(LD低多點,LOW,'一[A1策]▲多'),PXDN15,colorFF;
DRAWICON(HD高空點,HIGH,2),PXUP38;
DRAWICON(LD低多點,LOW,1),PXDN7;
|