文華多空海龜交易系統

      //多空海龜交易系統

      //參數

      M1:=13;

      M2:=20;

      M3:=55;

      //均線

      MA1:MA(C,M1),COLORRED;

      MA2:MA(C,M2),COLORGREEN;

      MA3:MA(C,M3),COLORWHITE;

      //多頭海龜

      LC1:=REF(CLOSE,1);

      AR1:=MAX((HIGH - LOW),MAX((HIGH - LC1),(LC1 - LOW)));

      ATR1:=SMA(AR1,M2,1);

      AA1:=(HHV(HIGH,M2) - (2 * ATR1));

      BB1:=CROSS(CLOSE,REF(HHV(HIGH,M3),1));

      SSS1:=CROSS(MIN(MA(CLOSE,M1),AA1),CLOSE);

      BBB1:=BARSLAST(BB1);

      SSSB1:=BARSLAST(SSS1);

      B1:=((BBB1 = 0) AND (REF(SSSB1,1) < REF(BBB1,1)));

      B1B1:=BARSLAST(B1);

      B2:=((((BB1 = 1) AND (B1B1 < SSSB1)) AND (B1B1 > 0)) AND (COUNT(BB1,SSSB1) < 3));

      B2B1:=BARSLAST(B2);

      B3:=((((BB1 = 1) AND (B2B1 < B1B1)) AND (COUNT(BB1,SSSB1) < 4)) AND (COUNT(BB1,SSSB1) > 2));

      B3B1:=BARSLAST(B3);

      SS1:=CROSS(MAX(AA1,MA(CLOSE,M1)),CLOSE);

      SS2:=(((SS1 AND ((B3B1 < B2B1) OR (B2B1 < B1B1))) AND (SSSB1 > B1B1)) AND (COUNT(SS1,B2B1) < 2));

      SS1B1:=BARSLAST(SS2);

      SS3:=((((SS1 AND (SS1B1 < SSSB1)) AND (B3B1 < B2B1)) AND (SS1B1 > 0)) AND (COUNT(SS1,B2B1) < 3));

      SSSS1:=(SSS1 AND (REF(SSSB1,1) > REF(B1B1,1)));

      (B1 = 1),ICON(0,"ICO4");

      (B2 = 1),ICON(0,"ICO4");

      (B3 = 1),ICON(0,"ICO4");

      (SS2 = 1),ICON(1,"ICO11");

      (SS3 = 1),ICON(1,"ICO11");

      (SSSS1 = 1),ICON(1,"ICO11");

      //空頭海龜

      LC11:=REF(CLOSE,1);

      AR11:=MAX((HIGH - LOW),MAX((HIGH - LC1),(LC11 - LOW)));

      ATR11:=SMA(AR11,M2,1);

      AA11:=(LLV(LOW,M2) - (2 * ATR11));

      BB11:=CROSS(REF(LLV(LOW,M3),1),CLOSE);

      SSS11:=CROSS(CLOSE,MAX(MA(CLOSE,M1),AA1));

      BBB11:=BARSLAST(BB11);

      SSSB11:=BARSLAST(SSS11);

      B11:=((BBB11 = 0) AND (REF(SSSB11,1) < REF(BBB11,1)));

      B1B11:=BARSLAST(B11);

      B21:=((((BB11 = 1) AND (B1B11 < SSSB11)) AND (B1B11 > 0)) AND (COUNT(BB11,SSSB11) < 3));

      B2B11:=BARSLAST(B21);

      B31:=((((BB11 = 1) AND (B2B11 < B1B11)) AND (COUNT(BB11,SSSB11) < 4)) AND (COUNT(BB11,SSSB11) > 2));

      B3B11:=BARSLAST(B31);

      SS11:=CROSS(CLOSE,MIN(AA11,MA(CLOSE,M1)));

      SS21:=(((SS11 AND ((B3B11 < B2B11) OR (B2B11 < B1B11))) AND (SSSB11 > B1B11)) AND (COUNT(SS11,B2B11) < 2));

      SS1B11:=BARSLAST(SS21);

      SS31:=((((SS11 AND (SS1B11 < SSSB11)) AND (B3B11 < B2B11)) AND (SS1B11 > 0)) AND (COUNT(SS11,B2B11) < 3));

      SSSS11:=(SSS11 AND (REF(SSSB11,1) > REF(B1B11,1)));

      (B11 = 1),ICON(0,"ICO5");

      (B21 = 1),ICON(0,"ICO5");

      (B31 = 1),ICON(0,"ICO5");

      (SS21 = 1),ICON(1,"ICO10");

      (SS31 = 1),ICON(1,"ICO10");

      (SSSS11 = 1),ICON(1,"ICO10");

      //K線

      TMP:=OPEN-CLOSE;

      DRAWLINE(TMP>0.00001,HIGH,TMP>0.00001,OPEN,COLORCYAN);

      DRAWLINE(TMP>0.00001,LOW,TMP>0.00001,CLOSE,COLORCYAN);

      DRAWLINE(TMP<-0.00001,HIGH,TMP<-0.00001,CLOSE,COLORRED);

      DRAWLINE(TMP<-0.00001,LOW,TMP<-0.00001,OPEN,COLORRED);

      DRAWLINE(ABS(TMP)<0.00001,LOW,ABS(TMP)<0.00001,OPEN,COLORWHITE);

      DRAWLINE(ABS(TMP)<0.00001,HIGH,ABS(TMP)<0.00001,OPEN,COLORWHITE);

      STICKLINE(TMP>0.00001,OPEN,CLOSE,COLORCYAN,0);

      STICKLINE(TMP<-0.00001,OPEN,CLOSE,COLORRED,1);

      免責聲明:本文僅代表文章作者的個人觀點,與本站無關。其原創性、真實性以及文中陳述文字和內容未經本站證實,對本文以及其中全部或者部分內容文字的真實性、完整性和原創性本站不作任何保證或承諾,請讀者僅作參考,并自行核實相關內容。

      http://image95.pinlue.com/image/96.jpg
      分享
      評論
      首頁
      和记