- volcanoVol
-
私募排排网为您解答:
CTA是投向于与股市涨跌相关性非常低的期市,所以趋势跟踪策略能够提供与股市最低的相关性。与其他策略相关性低。
- 奇石珠宝真君
-
//恒生加权2分钟波段
PARAM1:=54;
PARAM2:=56;
PARAM3:=56;
PARAM4:=100;
PARAM5:=65;
PARAM6:=10;
PARAM7:=1;
PARAM8:=32;
NX1:=5;
NX2:=7;
NX3:=3;
NX4:=5;
NX5:=3;
M1:=15;
NN:=BARSLAST(DATE<>REF(DATE,1))+1;
YC:=REF(C,NN);
YO:=REF(REF(O,NN-1),NN);
YYC:=REF(REF(C,NN),NN);
YYO:=REF(REF(REF(O,NN-1),NN),NN);
YL:=REF(LLV(L,NN),NN);
YH:=REF(HHV(H,NN),NN);
TDL:=LLV(L,NN);
TDH:=HHV(H,NN);
TDO:=REF(O,NN);
TDOMAX:=TDO;
TDOMIN:=TDO;
LOTS:=3000000/(0.1*UNIT*C);
MA5BD:=(ABS(REF(O,SUMBARS(NN=1,2))-REF(C,SUMBARS(NN=1,1)+1))+ABS(REF(O,SUMBARS(NN=1,3))-REF(C,SUMBARS(NN=1,2)+1))+ABS(REF(O,SUMBARS(NN=1,4))-REF(C,SUMBARS(NN=1,3)+1))+ABS(REF(O,SUMBARS(NN=1,5))-REF(C,SUMBARS(NN=1,4)+1))+ABS(REF(O,SUMBARS(NN=1,6))-REF(C,SUMBARS(NN=1,5)+1)))/5;
KEY:=ABS(YC-YO)<=0.9*MA5BD AND ABS(YC-YO)>=0*MA5BD;
KEY1:=ABS(YC-YO)>0.9*MA5BD AND ABS(YC-YO)<=2*MA5BD;
KEY2:=ABS(YC-YO)>2*MA5BD AND ABS(YC-YO)<=2.4*MA5BD;
HHS:=REF(HHV(H,5),NX2)*(1000+NX3)/1000;
LLS:=REF(LLV(L,5),NX2)*(1000-NX3)/1000;
HHL:=REF(HHV(H,5),NX4)*(1000+NX5)/1000;
LLL:=REF(LLV(L,5),NX4)*(1000-NX5)/1000;
BUYMARKET:=IF(YYC/YC>=1,1,0);
BUYMARKETBUYPRICE:=IF(BUYMARKET=1,TDOMAX+PARAM2*MA5BD/100,TDO);
BUYMARKETSHORTPRICE:=IF(BUYMARKET=1,TDOMIN-PARAM1*MA5BD/100,TDO);
BUYMARKETBUYPRICE1:=IF(BUYMARKET=1,TDOMAX+PARAM4*MA5BD/100,TDO);
BUYMARKETSHORTPRICE1:=IF(BUYMARKET=1,TDOMIN-PARAM3*MA5BD/100,TDO);
BUYMARKETBUYPRICE2:=IF(BUYMARKET=1,TDOMAX+PARAM6*MA5BD/100,TDO);
BUYMARKETSHORTPRICE2:=IF(BUYMARKET=1,TDOMIN-PARAM5*MA5BD/100,TDO);
SHORTMARKET:=IF(YYC/YC<1,1,0);
SHORTMARKETBUYPRICE:=IF(SHORTMARKET=1,TDOMAX+PARAM1*MA5BD/100,TDO);
SHORTMARKETSHORTPRICE:=IF(SHORTMARKET=1,TDOMIN-PARAM2*MA5BD/100,TDO);
SHORTMARKETBUYPRICE1:=IF(SHORTMARKET=1,TDOMAX+PARAM4*MA5BD/100,TDO);
SHORTMARKETSHORTPRICE1:=IF(SHORTMARKET=1,TDOMIN-PARAM3*MA5BD/100,TDO);
SHORTMARKETBUYPRICE2:=IF(SHORTMARKET=1,TDOMAX+PARAM6*MA5BD/100,TDO);
SHORTMARKETSHORTPRICE2:=IF(SHORTMARKET=1,TDOMIN-PARAM5*MA5BD/100,TDO);
YY1:=IF(ISLASTBPK=1,BARSBK,1000);
YY2:=IF(ISLASTSPK=1,BARSSK,1000);
XX1:=IF(ISLASTBP=1,BARSBP,1000);
XX2:=IF(ISLASTSP=1,BARSSP,1000);
JUMPK:=ABS((REF(O,NN-1)-YC)/YC*1000);
NNN:=IF(JUMPK>5,15,0);
NNNN:=IF(JUMPK>15,15,0);
LASTMAXBKPRICE:=IF(COUNTSIG(BK,REF(NN,NN)*3)>0,HHV(BKPRICE,REF(NN,NN)*3)*(1000+2)/1000,C);
LASTMINSKPRICE:=IF(COUNTSIG(SK,REF(NN,NN)*3)>0,LLV(SKPRICE,REF(NN,NN)*3)*(1000-2)/1000,C);
LASTMAXBPPRICE:=IF(COUNTSIG(BP,REF(NN,NN)*3)>0,HHV(REF(C,BARSBP),REF(NN,NN)*3)*(1000+2)/1000,C);
LASTMINSPPRICE:=IF(COUNTSIG(SP,REF(NN,NN)*3)>0,LLV(REF(C,BARSSP),REF(NN,NN)*3)*(1000-2)/1000,C);
//突破
NN>NNN AND BKVOL=0 AND KEY=1 AND BUYMARKET=1 AND C>=REF(O,NN-1) AND C>=BUYMARKETBUYPRICE AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY=1 AND BUYMARKET=1 AND C<=REF(O,NN-1) AND C<=BUYMARKETSHORTPRICE AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
NN>NNN AND BKVOL=0 AND KEY=1 AND SHORTMARKET=1 AND C>=REF(O,NN-1) AND C>=SHORTMARKETBUYPRICE AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY=1 AND SHORTMARKET=1 AND C<=REF(O,NN-1) AND C<=SHORTMARKETSHORTPRICE AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
NN>NNN AND BKVOL=0 AND KEY1=1 AND BUYMARKET=1 AND C>=REF(O,NN-1) AND C>=BUYMARKETBUYPRICE1 AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY1=1 AND BUYMARKET=1 AND C<=REF(O,NN-1) AND C<=BUYMARKETSHORTPRICE1 AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
NN>NNN AND BKVOL=0 AND KEY1=1 AND SHORTMARKET=1 AND C>=REF(O,NN-1) AND C>=SHORTMARKETBUYPRICE1 AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY1=1 AND SHORTMARKET=1 AND C<=REF(O,NN-1) AND C<=SHORTMARKETSHORTPRICE1 AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
NN>NNN AND BKVOL=0 AND KEY2=1 AND BUYMARKET=1 AND C>=REF(O,NN-1) AND C>=BUYMARKETBUYPRICE2 AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY2=1 AND BUYMARKET=1 AND C<=REF(O,NN-1) AND C<=BUYMARKETSHORTPRICE2 AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
NN>NNN AND BKVOL=0 AND KEY2=1 AND SHORTMARKET=1 AND C>=REF(O,NN-1) AND C>=SHORTMARKETBUYPRICE2 AND C>=LASTMAXBKPRICE AND C>=LASTMAXBPPRICE AND XX2>REF(NN,NN),BK(LOTS);
NN>NNN AND SKVOL=0 AND KEY2=1 AND SHORTMARKET=1 AND C<=REF(O,NN-1) AND C<=SHORTMARKETSHORTPRICE2 AND C<=LASTMINSKPRICE AND C<=LASTMINSPPRICE AND XX1>REF(NN,NN),SK(LOTS);
//突破失败
NN>NNNN AND BKVOL>0 AND BUYMARKET=1 AND C<=TDOMIN-PARAM7*MA5BD/100 AND YY1>REF(NN,NN)*4,SPK(BKVOL);
NN>NNNN AND SKVOL>0 AND BUYMARKET=1 AND C>=TDOMAX+PARAM8*MA5BD/100 AND YY2>REF(NN,NN)*4,BPK(SKVOL);
NN>NNNN AND BKVOL>0 AND SHORTMARKET=1 AND C<=TDOMIN-PARAM8*MA5BD/100 AND YY1>REF(NN,NN)*4,SPK(BKVOL);
NN>NNNN AND SKVOL>0 AND SHORTMARKET=1 AND C>=TDOMAX+PARAM7*MA5BD/100 AND YY2>REF(NN,NN)*4,BPK(SKVOL);
//止损
BKVOL>0 AND C<BKPRICE*(1000-NX1)/1000,SP(BKVOL);
SKVOL>0 AND C>SKPRICE*(1000+NX1)/1000,BP(SKVOL);
BKVOL>0 AND BARSBK>NX2 AND C<=LLS AND C<BKPRICE*(1000+M1)/1000,SP(BKVOL);
SKVOL>0 AND BARSSK>NX2 AND C>=HHS AND C>SKPRICE*(1000-M1)/1000,BP(SKVOL);
BKVOL>0 AND BARSBK>NX4 AND C<=LLL AND C>=BKPRICE*(1000+M1)/1000,SP(BKVOL);
SKVOL>0 AND BARSSK>NX4 AND C>=HHL AND C<=SKPRICE*(1000-M1)/1000,BP(SKVOL);
SETALLSIGPRICETYPE(TRACING_ORDER);
CLOSEKLINE(2,3);