![]() |
ماشاء الله تبارك الله ماشاء الله لاقوة الا بالله , اللهم اني اسالك الهدى
والتقى والعفاف والغنى
| |
|
|
|
|
|
|
|||||||
|
|
|
|
|
#1 | |
|
Gartley pattern ![]() ![]() ![]() الكود {#OptVar1 5;1;20;1} {#OptVar2 2;1;5;1} var BS, SS: boolean; var VPFACTOR, LOOKBACK, ZAEHLER: integer; var ATRValue, VP, Reversal, Tolerance: float; var F1, F2, F3, F4, P1, P2, T1, T2: float; var Bar, P1Bar, P2Bar, T1Bar, T2Bar, p: integer; var XA, AB, BC, CD, AD, D, ABdXA, BCdAB, CDdBC, ADdXA: float; var PTValid, HLValid, InZone, C1, C2, C3, C4: boolean; {Fibonacci Constants} F1 := 0.618; F2 := 0.786; F3 := 1.27; F4 := 1.618; VPFactor:= #OptVar2; Tolerance:= 0.1; Lookback:= 20; for Bar := Lookback to BarCount() - 1 do begin if PriceClose(bar) > 5000 then setpositionsize(priceclose(bar)*1.1); bs := false; ss := false; ATRValue := ATR(Bar, Lookback); VP := 100 * ATRValue / PriceClose(Bar); Reversal := Int(VPFactor * VP); {Find peaks and troughs} P1 := Peak(Bar, #High, F1 * Reversal); P1Bar := PeakBar(Bar, #High, F1 * Reversal); if P1Bar > - 1 then begin P2 := Peak(P1Bar, #High, Reversal); P2Bar := PeakBar(P1Bar, #High, Reversal); end; T1 := Trough(Bar, #Low, F1 * Reversal); T1Bar := TroughBar(Bar, #Low, F1 * Reversal); if T1Bar > -1 then begin T2 := Trough(T1Bar, #Low, Reversal); T2Bar := TroughBar(T1Bar, #Low, Reversal); end; {Test for a bullish 222} {Trough X is T2} {Peak A is P2} {Trough B is T1} {Peak C is P1} {D is the buy point} D := PriceLow(Bar); PTValid := (P1Bar > T1Bar) and (T1Bar > P2Bar) and (P2Bar > T2Bar); HLValid := (P1 < P2) and (T1 > T2) and (P1 > T1); InZone := (D < T1) and (D > T2); if PTValid and HLValid and InZone then begin XA := P2 - T2; AB := P2 - T1; BC := P1 - T1; CD := P1 - D; AD := P2 - D; ABdXA := AB / XA; {AB should be 61.8% of XA} C1 := (ABdXA > F1 - Tolerance) and (ABdXA < F1 + Tolerance); BCdAB := BC / AB; {BC should be 61.8-78.6% of AB} C2 := (BCdAB > F1 - Tolerance) and (BCdAB < F2 + Tolerance); CDdBC := CD / BC; {CD should be 127-161.8% of BC} C3 := (CDdBC > F3 - Tolerance) and (CDdBC < F4 + Tolerance); ADdXA := AD / XA; {AD should be 78.6% of XA} C4 := (ADdXA > F2 - Tolerance) and (ADdXA < F2 + Tolerance); if C1 and C2 and C3 and C4 then begin DrawLine(P2Bar, P2, T2Bar, T2, 0, #GREEN, #Solid); DrawLine(T1Bar, T1, P2Bar, P2, 0, #GREEN, #Solid); DrawLine(P1Bar, P1, T1Bar, T1, 0, #GREEN, #Solid); DrawLine(Bar, D, P1Bar, P1, 0, #GREEN, #Solid); DrawLine(Bar, D, T1Bar, T1, 0, #GREEN, #Dotted); DrawLine(Bar, D, T2Bar, T2, 0, #GREEN, #Dotted); AnnotateBar('B', Bar, True, #GREEN, 10); bs := true; ss := false; end; end; {Test for a bearish 222} {Peak X is P2} {Trough A is T2} {Peak B is P1} {Trough C is T1} {D is the short point} D := PriceHigh(Bar); PTValid := (T1Bar > P1Bar) and (P1Bar > T2Bar) and (T2Bar > P2Bar); HLValid := (T1 > T2) and (P1 < P2) and (T1 < P1); InZone := (D > P1) and (D < P2); if PTValid and HLValid and InZone then begin XA := P2 - T2; AB := P1 - T2; BC := P1 - T1; CD := D - T1; AD := D - T2; ABdXA := AB / XA; {AB should be 61.8% of XA} C1 := (ABdXA > F1 - Tolerance) and (ABdXA < F1 + Tolerance); BCdAB := BC / AB; {BC should be 61.8-78.6% of AB} C2 := (BCdAB > F1 - Tolerance) and (BCdAB < F2 + Tolerance); CDdBC := CD / BC; {CD should be 127-161.8% of BC} C3 := (CDdBC > F3 - Tolerance) and (CDdBC < F4 + Tolerance); ADdXA := AD / XA; {AD should be 78.6% of XA} C4 := (ADdXA > F2 - Tolerance) and (ADdXA < F2 + Tolerance); if C1 and C2 and C3 and C4 then begin DrawLine(T2Bar, T2, P2Bar, P2, 0, #RED, #Solid); DrawLine(P1Bar, P1, T2Bar, T2, 0, #RED, #Solid); DrawLine(T1Bar, T1, P1Bar, P1, 0, #RED, #Solid); DrawLine(Bar, D, T1Bar, T1, 0, #RED, #Solid); DrawLine(Bar, D, P1Bar, P1, 0, #RED, #Dotted); DrawLine(Bar, D, P2Bar, P2, 0, #RED, #Dotted); AnnotateBar('S', Bar, False, #RED, 10); ss := true; bs := false; end; end; if LastPositionActive then begin zaehler := zaehler + 1; if PositionLong( LastPosition ) then { Long Position Exit Rules } begin if zaehler=#OptVar1 then SellAtMarket(Bar+1, LastPosition,'') ; end else { Short Position Exit Rules } begin if zaehler=#OptVar1 then CoverAtMarket(Bar+1,LastPosition,''); end; end else begin zaehler := 0; { Long Position Entry Rules } if bs then BuyAtMarket( Bar+1,''); { Short Position Entry Rules } if ss then ShortAtMarket( Bar+1,''); end; end; |
|
|
|
|
|
|
#2 | |
|
الف شكر لك
الله يجزاك خير على هالجهود الجباره يااميرة الويلث لاب |
|
|
|
|
![]() |
| مواقع النشر (المفضلة) |
| الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
| أدوات الموضوع | |
| انواع عرض الموضوع | |
|
|
المواضيع المتشابهه
|
||||
| الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
| Wealth-Lab Developer 3.0 | <<رنـggg>> | التحليل الفني والأساسي | 1 | 04-24-2010 05:32 PM |
| The Cup & Handle Pattern | <<رنـggg>> | التحليل الفني والأساسي | 0 | 04-23-2010 08:33 AM |
| The Parabolic Curve Pattern | <<رنـggg>> | التحليل الفني والأساسي | 0 | 04-23-2010 08:32 AM |
| شرح تنصيب Pattern Explorer3.75 للأيمي بروكر | vip | التحليل الفني والأساسي | 12 | 04-06-2010 12:58 AM |
| The Gartley | vip | التحليل الفني والأساسي | 3 | 12-30-2009 05:47 AM |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27