這一篇文章有點長,但是很值得學習的好文,在此與大家分享。

 

-------

主題類別:程式交易 

主題: 樞紐點區間當沖交易(1K)

作者:Roger Ho

內文介紹:

利用前一交易日之高低收,計算出樞紐點(P)

 

樞紐點以上有四個壓力點(FirstR, SecondR, ThirdR, FourthR),以下有四個支撐點(FirstS, SecondS, ThirdS, FourthS),壓力與壓力之間有個次壓力點(P1st, P1st2nd, P2nd3rd, P3rd4th),同樣,支撐與支撐之間有個次支撐點(P_1st, P1st_2nd, P2nd_3rd, P3rd_4th)

 

另外計算8:509:00高低收,其高與低經由

HighValue1 = LowValue + (HighValue - LowValue) * HighValuePlus;

LowValue1 = LowValue + (HighValue - LowValue) * LowValuePlus;

公式算出的關鍵值,而其會在九點後,判斷其值落在那一個區間,而在那個區間裏皆不會有任何動作,一旦向上或向下突破區間並大於HighValue1或小於LowValue1,接下來會比對量的算式(Vol1 = Average(Volume[1], VolLength);),在五分鐘內,若量沒有小於前面的算式,都不會有任何動作,同樣五分鐘又落回原區間,也不會有任何動作。

一旦上述條件成立才會有進倉動作。

此交易有設定停損和停利,並於13:30平倉。

 

程式碼如下:

Arrays: HoD[84](-1), LoD[84](-1), CoD[84](-1);

 

Inputs: maxLos(40), maxWin(270), HighValuePlus(4.5), LowValuePlus(4.5), LosAgain(40), VolLength(13), Voladd(4), VolMax1(3000), VolMax2(5000), LastPrice(200);

Variables: Check(0), Check1(0), Check2(0), Check3(0), Check4(0), Check5(0), Check6(0), VTime(0), Close1(0), Close2(0), Close3(0), Value1(0), Value11(0), Value111(0), Value2(0), Value22(0), Value222(0), HighValue(0), LowValue(0), HighValue1(0), LowValue1(0), ClosePrice(0), Value33R(0), Value22R(0), Value11R(0), Value11S(0), Value22S(0), Value33S(0), V2(0), CheckP(0), CheckP1st(0), CheckFirstR(0), Check1st2nd(0), CheckSecondR(0), Check2nd3rd(0), CheckP_1st(0), CheckFirstS(0), Check1st_2nd(0), CheckSecondS(0), Check2nd_3rd(0), ValueD1(0), ValueD2(0), ValueD3(0), ThirdR(0), P2nd3rd(0), SecondR(0), P1st2nd(0), FirstR(0), P1st(0), P(0), P_1st(0), FirstS(0), P1st_2nd(0), SecondS(0), P2nd_3rd(0), ThirdS(0), Value44(0), FourthR(0), P3rd4th(0), P3rd_4th(0), FourthS(0), CheckThirdR(0), Check3rd4th(0), CheckThirdS(0), Check3rd_4th(0), Vol1(0), VolInc(0), CheckLabel(0), VolumeCheck(0), VolumePriceH(0), VolumePriceL(0), VolumePriceO(0), VolumePriceC(0), VolumeMaxCheck(0), VolumeTotal(0), VolInc1(0), LastClose(0), LastCheckP(0), LastCheckN(0);

 

If DataCompression < 2 Then Begin

        ValueD1 = LowD(1);

        ValueD2 = HighD(1);

        ValueD3 = CloseD(1);

        Value44 = (ValueD1 + ValueD2 + ValueD3) / 3;

 

        Value33R = ValueD2 + 2*(Value44 - ValueD1);

        Value22R = Value44 + (ValueD2 - ValueD1);

        Value11R = 2*Value44 - ValueD1;

        Value11S = 2*Value44 - ValueD2;

        Value22S = Value44 - (ValueD2 - ValueD1);

        Value33S = ValueD1 - 2*(ValueD2 - Value44);

       

        FourthR = Value33R + 2 * (Value33R - (Value33R + Value22R) / 2);

        P3rd4th = Value33R + (Value33R - (Value33R + Value22R) / 2);

        ThirdR = ValueD2 + 2*(Value44 - ValueD1);

        P2nd3rd = (Value33R + Value22R) / 2;

        SecondR = Value44 + (ValueD2-ValueD1);

        P1st2nd = (Value22R + Value11R)/2;

        FirstR = 2*Value44 - ValueD1;

        P1st = (Value11R + Value44) / 2;

        P = Value44;

        P_1st = (Value44 + Value11S) / 2;

        FirstS = 2*Value44 - ValueD2;

        P1st_2nd = (Value11S + Value22S) / 2;

        SecondS = Value44 - (ValueD2 - ValueD1);

        P2nd_3rd = (Value33S + Value22S) / 2;

        ThirdS = ValueD1 - 2*(ValueD2 - Value44);

        P3rd_4th = Value33S - ((Value33S + Value22S) / 2 - Value33S);

        FourthS = Value33S - 2 * ((Value33S + Value22S) / 2 - Value33S);

End;

 

VTime = Time;

If VTime = 0850.00 Then Begin

        Close1 = (Close + Close[1] + Close[2] + Close[3] + Close[4]) / 5;

        Value1 = (High + High[1] + High[2] + High[3] + High[4]) / 5;

        Value2 = (Low + Low[1] + Low[2] + Low[3] + Low[4]) / 5;

End;

If VTime = 0855.00 Then Begin

        Close2 = (Close[1] + Close[2] + Close[3] + Close[4] + Close) / 5;

        Value11 = (High[1] + High[2] + High[3] + High[4] + High) / 5;

        Value22 = (Low[1] + Low[2] + Low[3] + Low[4] + Low) / 5;

End;

If VTime = 0900.00 Then Begin

        Close3 = (Close[1] + Close[2] + Close[3] + Close[4] + Close) / 5;

        Value111 = (High[1] + High[2] + High[3] + High[4] + High) / 5;

        Value222 = (Low[1] + Low[2] + Low[3] + Low[4] + Low) / 5;

End;

If VTime = 1345.00 Then Begin

        LastClose = Close[1];

End;

       

Value4 = {Close1 +} Close2 + Close3;    

Value5 = Value4 / 2;

HighValue = (({Value1 +} Value11 + Value111) / 2);

LowValue = (({Value2 +} Value22 + Value222) / 2);

HighValue1 = LowValue + (HighValue - LowValue) * HighValuePlus;

{HighValue1 = HighValue + (HighValue - LowValue) * HighValuePlus;}

LowValue1 = LowValue + (HighValue - LowValue) * LowValuePlus;

 

Vol1 = Average(Volume[1], VolLength);

If VTime > 0900.00 and VTime < 1330.00 Then Begin

        If Volume > Vol1 Then Begin

                Check5 = 1;

                VolInc = Voladd;

        End;

        If Check5 = 1 Then Begin

                VolInc = VolInc - 1;

        End;

        If VolInc = 0 Then Begin

                Check5 = 0;

        End;

        If LastClose > Close3 + LastPrice Then Begin

                LastCheckP = 1;

        End;

        If LastClose < Close3 - LastPrice Then Begin

                LastCheckN = 1;

        End;

End;

If VTime > 0900.00 and VTime < 1330.00 Then Begin

If VolumeCheck = 0 Then Begin     

If Value5 < FourthR and Value5 > ThirdR and HighValue > P3rd4th {and LowValue < P3rd4th} and CheckLabel = 0 Then Begin

        Check3rd4th = 1;

        CheckLabel = 1;

End;

If Value5 < P3rd4th and Value5 > P2nd3rd and HighValue > ThirdR {and LowValue < ThirdR} and CheckLabel = 0 Then Begin

        CheckThirdR = 1;

        CheckLabel = 1;

End;

If Value5 < ThirdR and Value5 > SecondR and HighValue > P2nd3rd {and LowValue < P2nd3rd} and CheckLabel = 0 Then Begin

        Check2nd3rd = 1;

        CheckLabel = 1;

End;

If Value5 < P2nd3rd and Value5 > P1st2nd and HighValue > SecondR {and LowValue < SecondR} and CheckLabel = 0 Then Begin

        CheckSecondR = 1;

        CheckLabel = 1;

End;

If Value5 < SecondR and Value5 > FirstR and HighValue > P1st2nd {and LowValue < P1st2nd} and CheckLabel = 0 Then Begin

        Check1st2nd = 1;

        CheckLabel = 1;

End;

If Value5 < P1st2nd and Value5 > P1st and HighValue > FirstR {and LowValue < FirstR} and CheckLabel = 0 Then Begin

        CheckFirstR = 1;

        CheckLabel = 1;

End;

If Value5 < FirstR and Value5 > P and HighValue > P1st {and LowValue < P1st} and CheckLabel = 0 Then Begin

        CheckP1st = 1;

        CheckLabel = 1;

End;

If Value5 < P1st and Value5 > P_1st and HighValue > P {and LowValue < P} and CheckLabel = 0 Then Begin

        CheckP = 1;

        CheckLabel = 1;

End;

If Value5 < P and Value5 > FirstS and HighValue > P_1st {and LowValue < P_1st} and CheckLabel = 0 Then Begin

        CheckP_1st = 1;

        CheckLabel = 1;

End;

If Value5 < P_1st and Value5 > P1st_2nd and HighValue > FirstS {and LowValue < FirstS} and CheckLabel = 0 Then Begin

        CheckFirstS = 1;

        CheckLabel = 1;

End;

If Value5 < FirstS and Value5 > SecondS and HighValue > P1st_2nd {and LowValue < P1st_2nd} and CheckLabel = 0 Then Begin

        Check1st_2nd = 1;

        CheckLabel = 1;

End; 

If Value5 < P1st_2nd and Value5 > P2nd_3rd and HighValue > SecondS {and LowValue < SecondS} and CheckLabel = 0 Then Begin

        CheckSecondS = 1;

        CheckLabel = 1;

End; 

If Value5 < SecondS and Value5 > ThirdS and HighValue > P2nd_3rd {and LowValue < P2nd_3rd} and CheckLabel = 0 Then Begin

        Check2nd_3rd = 1;

        CheckLabel = 1;

End;

If Value5 < P2nd_3rd and Value5 > P3rd_4th and HighValue > ThirdS {and LowValue < ThirdS} and CheckLabel = 0 Then Begin

        CheckThirdS = 1;

        CheckLabel = 1;

End;

If Value5 < ThirdS and Value5 > FourthS and HighValue > P3rd_4th {and LowValue < P3rd_4th} and CheckLabel = 0 Then Begin

        Check3rd_4th = 1;

        CheckLabel = 1;

End;

End;

If Volume[1] > VolMax1 Then Begin

        VolumeCheck = 1;

        {VolumeTotal = Volume[1];}

        VolInc1 = 5;

        VolumePriceH = High[1];

        VolumePriceL = Low[1];

        VolumePriceO = Open[1];

        VolumePriceC = Close[1];

        Condition1 = False;

        Condition2 = False;

End;

If VTime > 0900.00 and VTime < 1330.00 and VolumeCheck = 1 Then Begin

        {If Volume > Vol1 Then Begin

                Check5 = 1;

                VolInc = Voladd;

        End;}

        If VolumeCheck = 1 Then Begin

                VolInc1 = VolInc1 - 1;

                VolumeTotal = VolumeTotal + Volume[1];

                If VolumePriceH < High[1] Then Begin

                        VolumePriceH = High[1];

                End;

                If VolumePriceL > Low[1] Then Begin

                        VolumePriceL = Low[1];

                End;

        End;

        If VolInc1 = 0 and VolumeTotal < VolMax2 Then Begin

                VolumeCheck = 0;

        End;

        If VolInc1 = 0 and VolumeTotal > VolMax2 Then Begin

                VolumeCheck = 2;

        End;

End;

If VolumeCheck = 2 Then Begin

        If Open[1] < Close[1] Then Begin

                If VolumePriceH < FourthR and VolumePriceH > ThirdR and CheckLabel = 0 Then Begin

                        Check3rd4th = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P3rd4th and VolumePriceH > P2nd3rd and CheckLabel = 0 Then Begin

                        CheckThirdR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < ThirdR and VolumePriceH > SecondR and CheckLabel = 0 Then Begin

                        Check2nd3rd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P2nd3rd and VolumePriceH > P1st2nd and CheckLabel = 0 Then Begin

                        CheckSecondR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < SecondR and VolumePriceH > FirstR and CheckLabel = 0 Then Begin

                        Check1st2nd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P1st2nd and VolumePriceH > P1st and CheckLabel = 0 Then Begin

                        CheckFirstR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < FirstR and VolumePriceH > P and CheckLabel = 0 Then Begin

                        CheckP1st = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P1st and VolumePriceH > P_1st and CheckLabel = 0 Then Begin

                        CheckP = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P and VolumePriceH > FirstS and CheckLabel = 0 Then Begin

                        CheckP_1st = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P_1st and VolumePriceH > P1st_2nd and CheckLabel = 0 Then Begin

                        CheckFirstS = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < FirstS and VolumePriceH > SecondS and CheckLabel = 0 Then Begin

                        Check1st_2nd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P1st_2nd and VolumePriceH > P2nd_3rd and CheckLabel = 0 Then Begin

                        CheckSecondS = 1;

                        CheckLabel = 1;

                End; 

                If VolumePriceH < SecondS and VolumePriceH > ThirdS and CheckLabel = 0 Then Begin

                        Check2nd_3rd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < P2nd_3rd and VolumePriceH > P3rd_4th and CheckLabel = 0 Then Begin

                        CheckThirdS = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceH < ThirdS and VolumePriceH > FourthS and CheckLabel = 0 Then Begin

                        Check3rd_4th = 1;

                        CheckLabel = 1;

                End;

        End;

       

        If Open[1] > Close[1] Then Begin

                If VolumePriceL < FourthR and VolumePriceL > ThirdR and CheckLabel = 0 Then Begin

                        Check3rd4th = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P3rd4th and VolumePriceL > P2nd3rd and CheckLabel = 0 Then Begin

                        CheckThirdR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < ThirdR and VolumePriceL > SecondR and CheckLabel = 0 Then Begin

                        Check2nd3rd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P2nd3rd and VolumePriceL > P1st2nd and CheckLabel = 0 Then Begin

                        CheckSecondR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < SecondR and VolumePriceL > FirstR and CheckLabel = 0 Then Begin

                        Check1st2nd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P1st2nd and VolumePriceL > P1st and CheckLabel = 0 Then Begin

                        CheckFirstR = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < FirstR and VolumePriceL > P and CheckLabel = 0 Then Begin

                        CheckP1st = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P1st and VolumePriceL > P_1st and CheckLabel = 0 Then Begin

                        CheckP = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P and VolumePriceL > FirstS and CheckLabel = 0 Then Begin

                        CheckP_1st = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P_1st and VolumePriceL > P1st_2nd and CheckLabel = 0 Then Begin

                        CheckFirstS = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < FirstS and VolumePriceL > SecondS and CheckLabel = 0 Then Begin

                        Check1st_2nd = 1;

                        CheckLabel = 1;

                End; 

                If VolumePriceL < P1st_2nd and VolumePriceL > P2nd_3rd and CheckLabel = 0 Then Begin

                        CheckSecondS = 1;

                        CheckLabel = 1;

                End; 

                If VolumePriceL < SecondS and VolumePriceL > ThirdS and CheckLabel = 0 Then Begin

                        Check2nd_3rd = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < P2nd_3rd and VolumePriceL > P3rd_4th and CheckLabel = 0 Then Begin

                        CheckThirdS = 1;

                        CheckLabel = 1;

                End;

                If VolumePriceL < ThirdS and VolumePriceL > FourthS and CheckLabel = 0 Then Begin

                        Check3rd_4th = 1;

                        CheckLabel = 1;

                End;

        End;

End;

       

End;

 

If VolumeCheck = 0 Then Begin     

If Check3rd4th = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > FourthR;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < ThirdR;

End;

If CheckThirdR = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P3rd4th;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P2nd3rd;

End;

If Check2nd3rd = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > ThirdR;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < SecondR;

End;

If CheckSecondR = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P2nd3rd;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P1st2nd;

End;

If Check1st2nd = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > SecondR;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < FirstR;

End;

If CheckFirstR = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P1st2nd;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P1st;

End;

If CheckP1st = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > FirstR;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P;

End;

If CheckP = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P1st;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P_1st;

End;

If CheckP_1st = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < FirstS;

End;

If CheckFirstS = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P_1st;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P1st_2nd;

End;

If Check1st_2nd = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > FirstS;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < SecondS;

End;

If CheckSecondS = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P1st_2nd;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P2nd_3rd;

End;

If Check2nd_3rd = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > SecondS;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < ThirdS;

End;

If CheckThirdS = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > P2nd_3rd;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < P3rd_4th;

End;

If Check3rd_4th = 1 Then Begin

Condition1 = Close[1] > Value5 and Close[1] > HighValue1 and Close[1] > ThirdS;

Condition2 = Close[1] < Value5 and Close[1] < LowValue1 and Close[1] < FourthS;

End;

End;

 

If VolumeCheck =2 Then Begin

        If VolumePriceO < VolumePriceC Then Begin

                If Check3rd4th = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > FourthR;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < ThirdR;

                End;

                If CheckThirdR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P3rd4th;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P2nd3rd;

                End;

                If Check2nd3rd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > ThirdR;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < SecondR;

                End;

                If CheckSecondR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P2nd3rd;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P1st2nd;

                End;

                If Check1st2nd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > SecondR;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < FirstR;

                End;

                If CheckFirstR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P1st2nd;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P1st;

                End;

                If CheckP1st = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > FirstR;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P;

                End;

                If CheckP = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P1st;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P_1st;

                End;

                If CheckP_1st = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < FirstS;

                End;

                If CheckFirstS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P_1st;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P1st_2nd;

                End;

                If Check1st_2nd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > FirstS;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < SecondS;

                End;

                If CheckSecondS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P1st_2nd;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P2nd_3rd;

                End;

                If Check2nd_3rd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > SecondS;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < ThirdS;

                End;

                If CheckThirdS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > P2nd_3rd;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < P3rd_4th;

                End;

                If Check3rd_4th = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceH and Close[1] > HighValue1 and Close[1] > ThirdS;

                        Condition2 = Close[1] < VolumePriceH and Close[1] < LowValue1 and Close[1] < FourthS;

                End;

        End;

        If VolumePriceO > VolumePriceC Then Begin

                If Check3rd4th = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > FourthR;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < ThirdR;

                End;

                If CheckThirdR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P3rd4th;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P2nd3rd;

                End;

                If Check2nd3rd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > ThirdR;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < SecondR;

                End;

                If CheckSecondR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P2nd3rd;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P1st2nd;

                End;

                If Check1st2nd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > SecondR;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < FirstR;

                End;

                If CheckFirstR = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P1st2nd;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P1st;

                End;

                If CheckP1st = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > FirstR;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P;

                End;

                If CheckP = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P1st;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P_1st;

                End;

                If CheckP_1st = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < FirstS;

                End;

                If CheckFirstS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P_1st;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P1st_2nd;

                End;

                If Check1st_2nd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > FirstS;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < SecondS;

                End;

                If CheckSecondS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P1st_2nd;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P2nd_3rd;

                End;

                If Check2nd_3rd = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > SecondS;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < ThirdS;

                End;

                If CheckThirdS = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > P2nd_3rd;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < P3rd_4th;

                End;

                If Check3rd_4th = 1 Then Begin

                        Condition1 = Close[1] > VolumePriceL and Close[1] > HighValue1 and Close[1] > ThirdS;

                        Condition2 = Close[1] < VolumePriceL and Close[1] < LowValue1 and Close[1] < FourthS;

                End;

        End;

End;

 

If Condition1 Then Begin

        If (Time > 0900.00) AND (Time < 1315.00) AND (Check5 = 0) AND (Check = 0) AND LastCheckP = 0 Then Begin

                Buy ("Buy") Next bar at market;

                Check = 1;

                Check1 = 1;

                ClosePrice = Close;

                CheckLabel = 0;

        End;

End;

If Condition2 Then Begin

        If (Time > 0900.00) AND (Time < 1315.00) AND (Check5 = 0) AND (Check = 0) AND LastCheckN = 0 Then Begin

                Sell ("Sell") Next bar at market;

                Check = -1;

                Check1 = -1;

                ClosePrice = Close;

                CheckLabel = 0;

        End;

End;

 

If Condition1 Then Begin

        If (Time > 0900.00) AND (Time < 1315.00) AND (Check5 = 0) AND (Check = -1) Then Begin

                Buy ("Buy1") Next bar at market;

                Check = 1;

                Check1 = 1;

                ClosePrice = Close;

                CheckLabel = 0;

        End;

End;

If Condition2 Then Begin

        If (Time > 0900.00) AND (Time < 1315.00) AND (Check5 = 0) AND (Check = 1) Then Begin

                Sell ("Sell1") Next bar at market;

                Check = -1;

                Check1 = -1;

                ClosePrice = Close;

                CheckLabel = 0;

        End;

End;

 

If Check = 1 AND Time = 1330.00 Then Begin

        Exitlong ("BuyOver") This bar on Close;

        Check = 0;

        Check1 = 0;

        Check2 = 0;

        Check3 = 0;

        Check4 = 0;

        Check5 = 0;

        Check6 = 0;

End;

If Check = -1 AND Time = 1330.00 Then Begin

        Exitshort ("SellOver") This bar on Close;

        Check = 0;

        Check1 = 0;

        Check2 = 0;

        Check3 = 0;

        Check4 = 0;

        Check5 = 0;

        Check6 = 0;

End;

 

If Time = 1330.00 Then Begin

        {Check = 0;}

        Condition1 = False;

        Condition2 = False;

        Value1 = 0;

        Value2 = 0;

        Value4 = 0;

        Value5 = 0;

        Value11 = 0;

        Value22 = 0;

        Value111 = 0;

        Value222 = 0;

        HighValue = 0;

        LowValue = 0;

        Value33R = 0;

        Value22R = 0;

        Value11R = 0;

        Value11S = 0;

        Value22S = 0;

        Value33S = 0;

        Value44 = 0;

        V2 = 0;

        CheckP = 0;

        CheckP1st = 0;

        CheckFirstR = 0;

        Check1st2nd = 0;

        CheckSecondR = 0;

        Check2nd3rd = 0;

        CheckP_1st = 0;

        CheckFirstS = 0;

        Check1st_2nd = 0;

        CheckSecondS = 0;

        Check2nd_3rd = 0;

        ValueD1 = 0;

        ValueD2 = 0;

        ValueD3 = 0;

        ThirdR = 0;

        P2nd3rd = 0;

        SecondR = 0;

        P1st2nd = 0;

        FirstR = 0;

        P1st = 0;

        P = 0;

        P_1st = 0;

        FirstS = 0;

        P1st_2nd = 0;

        SecondS = 0;

        P2nd_3rd = 0;

        ThirdS = 0;

        FourthR = 0;

        P3rd4th = 0;

        P3rd_4th = 0;

        FourthS = 0;

        CheckThirdR = 0;

        Check3rd4th = 0;

        CheckThirdS = 0;

        Check3rd_4th = 0;

        VolInc = 0;

        CheckLabel = 0;

        VolumeCheck = 0;

        VolumePriceH = 0;

        VolumePriceL = 0;

        VolumePriceO = 0;

        VolumePriceC = 0;

        VolumeMaxCheck = 0;

        VolumeTotal = 0;

        VolInc1 = 0;

        LastCheckP = 0;

        LastCheckN = 0;

End;

 

if BarsSinceEntry(0) > 0 and CurrentContracts >= 1 then Begin

SetStopLoss(maxLos*200);

SetProfitTarget(maxWin*200);

end;

 

if BarsSinceEntry(0) > 0 and CurrentContracts <= 1 then Begin

SetStopLoss(maxLos*200);

SetProfitTarget(maxWin*200);

end;

 

 

 

 

 

 

 

 

 

 

 

TradeStation Strategy Performance Report

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TradeStation  Strategy Performance Report - Money1.7 TXF-1M.TXT-1 min. (2001/1/2-2012/12/28)

 

 

 

 

 

 

 

 

 

Performance Summary:  All Trades

 

 

 

 

 

 

 

 

 

 

 

Total Net Profit

$3,324,600.00

 

Open position P/L

$0.00

 

Gross Profit

 

$12,306,000.00

 

Gross Loss

 

($8,981,400.00)

 

 

 

 

 

 

 

 

 

Total # of trades

2,657

 

Percent profitable

46.93%

 

Number winning trades

1,247

 

Number losing trades

1,410

 

 

 

 

 

 

 

 

 

Largest winning trade

$53,200.00

 

Largest losing trade

($11,200.00)

 

Average winning trade

$9,868.48

 

Average losing trade

($6,369.79)

 

Ratio avg win/avg loss

1.55

 

Avg trade (win & loss)

$1,251.26

 

 

 

 

 

 

 

 

 

Max consec. Winners

8

 

Max consec. losers

14

 

Avg # bars in winners

190

 

Avg # bars in losers

115

 

 

 

 

 

 

 

 

 

Max intraday drawdown

($168,800.00)

 

 

 

 

 

Profit Factor

 

1.37

 

Max # contracts held

1

 

Account size required

$168,800.00

 

Return on account

1969.55%

 

 

 

 

 

 

 

 

 

Performance Summary:  Long Trades

 

 

 

 

 

 

 

 

 

 

 

Total Net Profit

$1,340,200.00

 

Open position P/L

$0.00

 

Gross Profit

 

$6,580,000.00

 

Gross Loss

 

($5,239,800.00)

 

 

 

 

 

 

 

 

 

Total # of trades

1,498

 

Percent profitable

46.40%

 

Number winning trades

695

 

Number losing trades

803

 

 

 

 

 

 

 

 

 

Largest winning trade

$53,200.00

 

Largest losing trade

($11,200.00)

 

Average winning trade

$9,467.63

 

Average losing trade

($6,525.28)

 

Ratio avg win/avg loss

1.45

 

Avg trade (win & loss)

$894.66

 

 

 

 

 

 

 

 

 

Max consec. Winners

9

 

Max consec. losers

8

 

Avg # bars in winners

193

 

Avg # bars in losers

114

 

 

 

 

 

 

 

 

 

Max intraday drawdown

($202,000.00)

 

 

 

 

 

Profit Factor

 

1.26

 

Max # contracts held

1

 

Account size required

$202,000.00

 

Return on account

663.47%

 

 

 

 

 

 

 

 

 

Performance Summary:  Short Trades

 

 

 

 

 

 

 

 

 

 

 

Total Net Profit

$1,984,400.00

 

Open position P/L

$0.00

 

Gross Profit

 

$5,726,000.00

 

Gross Loss

 

($3,741,600.00)

 

 

 

 

 

 

 

 

 

Total # of trades

1,159

 

Percent profitable

47.63%

 

Number winning trades

552

 

Number losing trades

607

 

 

 

 

 

 

 

 

 

Largest winning trade

$53,200.00

 

Largest losing trade

($9,200.00)

 

Average winning trade

$10,373.19

 

Average losing trade

($6,164.09)

 

Ratio avg win/avg loss

1.68

 

Avg trade (win & loss)

$1,712.17

 

 

 

 

 

 

 

 

 

Max consec. Winners

6

 

Max consec. losers

10

 

Avg # bars in winners

188

 

Avg # bars in losers

118

 

 

 

 

 

 

 

 

 

Max intraday drawdown

($140,800.00)

 

 

 

 

 

Profit Factor

 

1.53

 

Max # contracts held

1

 

Account size required

$140,800.00

 

Return on account

1409.38%

 

TradeStation Strategy Performance Report

 

Annual Trading Summary

 

 

 

 

 

 

 

 

 

 

Annual Analysis (Mark-To-Market):

 

 

 

 

Period

Net Profit

% Gain

Profit Factor

# Trades

% Profitable

 

YTD

$0.00

N/A

N/A

0

N/A

 

12 month

$22,800.00

0.67%

1.04

186

45.16%

 

12

$14,000.00

0.41%

1.02

199

45.23%

 

11

$35,600.00

1.05%

1.04

215

43.72%

 

10

($28,600.00)

(0.84%)

0.96

230

43.48%

 

09

$208,600.00

6.53%

1.25

211

43.13%

 

08

$756,000.00

31.00%

1.81

227

48.90%

 

07

$113,200.00

4.87%

1.12

241

39.42%

 

06

$155,600.00

7.17%

1.22

224

44.20%

 

05

($74,800.00)

(3.33%)

0.87

218

41.74%

 

04

$425,600.00

23.39%

1.67

213

48.83%

 

03

$344,200.00

23.33%

1.63

208

50.96%

 

02

$696,800.00

89.52%

1.96

228

49.56%

 

01

$678,400.00

678.40%

1.81

243

51.03%

 

 

 

 

 

 

 

 

Annual Rolling Period Analysis (Mark-To-Market):

 

 

Period

Net Profit

% Gain

Profit Factor

# Trades

% Profitable

 

12

$14,000.00

0.41%

1.02

199

45.23%

 

11-12

$49,600.00

1.47%

1.03

414

44.44%

 

10-12

$21,000.00

0.62%

1.01

644

44.10%

 

09-12

$229,600.00

7.19%

1.08

855

43.86%

 

08-12

$985,600.00

40.41%

1.25

1082

44.92%

 

07-12

$1,098,800.00

47.24%

1.22

1323

43.92%

 

06-12

$1,254,400.00

57.80%

1.22

1547

43.96%

 

05-12

$1,179,600.00

52.54%

1.19

1765

43.68%

 

04-12

$1,605,200.00

88.23%

1.23

1978

44.24%

 

03-12

$1,949,400.00

132.14%

1.26

2186

44.88%

 

02-12

$2,646,200.00

339.95%

1.32

2414

45.32%

 

01-12

$3,324,600.00

3324.60%

1.37

2657

45.84%

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Winning Trade Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Number of winning trades

1247

 

 

 

 

 

 

Avg. winning trade

$9,868.48

 

Avg. win ?1 STDEV

$19,582.54

/

$154.43

1 Std. Deviation (STDEV)

$9,714.06

 

Coefficient of variation

98.44%

 

 

 

 

 

 

 

 

 

 

 

Largest profit

$53,200.00

 

Largest consec. profit

$111,600.00

 

 

  % of Net Profit

1.60%

 

  % of Net Profit

3.36%

 

 

 

 

 

 

 

 

 

 

 

Consecutive Winning Series Data

 

 

 

 

 

 

Consec.

 # of

 Average

Average Loss

 

 

 

 

 

Winners

 Series

Gain/Series 

Next Trade

 

 

 

 

 

1

350

$11,119.43

($6,694.29)

 

 

 

 

 

2

179

$19,796.65

($6,614.53)

 

 

 

 

 

3

61

$27,232.79

($7,154.10)

 

 

 

 

 

4

36

$39,538.89

($6,438.89)

 

 

 

 

 

5

12

$51,183.33

($7,683.33)

 

 

 

 

 

6

12

$64,100.00

($6,533.33)

 

 

 

 

 

7

5

$52,800.00

($7,320.00)

 

 

 

 

 

8

2

$69,300.00

($7,200.00)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Losing Trade Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Number of losing trades

1410

 

 

 

 

 

 

Avg. losing trade

($6,369.79)

 

Avg. loss ?1 STDEV

($3,252.15)

/

($9,487.42)

1 Std. Deviation (STDEV)

$3,117.64

 

Coefficient of variation

48.94%

 

 

 

 

 

 

 

 

 

 

 

Largest loss

($11,200.00)

 

Largest consec. loss

($64,800.00)

 

 

  % of Net Profit

0.34%

 

  % of Net Profit

1.95%

 

 

 

 

 

 

 

 

 

 

 

Consecutive Losing Series Data

 

 

 

 

 

 

Consec.

 # of

 Average

Average Gain

 

 

 

 

 

Losers

 Series

Loss/Series 

Next Trade

 

 

 

 

 

1

307

($6,777.85)

$10,225.49

 

 

 

 

 

2

169

($13,344.38)

$11,573.96

 

 

 

 

 

3

84

($18,478.57)

$9,071.43

 

 

 

 

 

4

52

($24,761.54)

$8,930.77

 

 

 

 

 

5

20

($32,120.00)

$11,530.00

 

 

 

 

 

6

8

($39,825.00)

$7,050.00

 

 

 

 

 

7

7

($45,685.71)

$7,542.86

 

 

 

 

 

8

3

($44,400.00)

$9,466.67

 

 

 

 

 

9

4

($49,450.00)

$2,250.00

 

 

 

 

 

10

2

($44,500.00)

$6,400.00

 

 

 

 

 

11

0

$0.00

$0.00

 

 

 

 

 

12

0

$0.00

$0.00

 

 

 

 

 

13

0

$0.00

$0.00

 

 

 

 

 

14

2

($52,400.00)

$11,200.00

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TradeStation Strategy Performance Report

 

Settings

 

 

 

 

 

 

 

 

Initial Capital

 

$100,000.00

 

Commission

 

$800.00

 

Slippage

 

 

$0.00

 

Interest Rate

 

5.00%

 

Version Type

 

Intra-Day

 

Version Number

 

2000.00

 

Symbol

 

 

TXF-1M.TXT

 

Description

 

 

 

Compression

 

1 min.

 

Start Date

 

 

2001/1/2

 

End Date

 

 

2012/12/28

 

Display Periods

 

40

 

Number of Standard Deviations

1

 

 

 

 

 

 

 

 

 

 

 

Strategy Inputs

 

 

 

 

 

 

 

Money17_maxLos

 

40

 

Money17_maxWin

 

270

 

Money17_HighValuePlus

4.5

 

Money17_LowValuePlus

4.5

 

Money17_LosAgain

 

40

 

Money17_VolLength

 

13

 

Money17_Voladd

 

4

 

Money17_VolMax1

 

3000

 

Money17_VolMax2

 

5000

 

Money17_LastPrice

 

200

 

 

 

 

 

 

 

arrow
arrow
    全站熱搜

    wenschair 發表在 痞客邦 留言(0) 人氣()