You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
here is the another one
Hi !
Dear Kamyar , glad to meet U here !Thanks for hard work .
I am a complete beginner in this field . and wish to learn this usefull patterns . please remind my mistakes and help me to improve . Thanx in advance .
In following picture , Double top made me to enter a sell position , although
there was breakout at 1.2128 and still there were no signs to think it may be
a fake one. what do U think about my entery ?
I stopped out at 1.2140 ( my entery = 1.2129 . its a big stop for me )hi ramin
i'm glad to see u here and grateful that u are working on patterns.
i suppose that Faraz has answerd your questions(u know where).anyway good work keep going....
kamyar
Hi Kamyar,
What reason to sell at dotted green line? I could not see not reason in order to sell in this point, next bar maybe
Thanx
I think it looks good
nice indicator ziko, could you program a bullish butterfly and both gartley?
hi ramin
i'm glad to see u here and grateful that u are working on patterns.
i suppose that Faraz has answerd your questions(u know where).anyway good work keep going....
kamyarkamyar ,
unfortunately I didn't get the answer !
but I think U mean when there is a chance that "AB=CD" tranform to a butterfly pattern ,we shouldn't trade the first (AB=CD) .
Am I right ?
Thanx for attentions.
---------------------------------------
Footnote : How are u Carlos?
guys, just one very dumb and noob question: what are the targets after pattern is in place?
kamyar ,
unfortunately I didn't get the answer !
but I think U mean when there is a chance that "AB=CD" tranform to a butterfly pattern ,we shouldn't trade the first (AB=CD) .
Am I right ?
Thanx for attentions.
---------------------------------------
Footnote : How are u Carlos?u r dead right.
The reason I need a well defined rules is that I started developing an indicator for these patterns, I started with the bearish butterfly,
I'm attaching the indicator,
u can test with the earlier charts posted by kamyar last week,
test it with EURUSD,4H and EURCAD,4Hziko,
the rules and pattern from tradestation code as definde by Scott Carney
{
Butterfly
based on Mark Conway code
by Mark Kaz, "mido", 8/2003
mod 11/2003 to add dynamic Strength thanks to progster
sadhu at myacc.net
===============
Modified by
deMicron 10/10/2004
Optional 'Delete multiple Generation of lines' and Added P1-P2 line
===============
Butterfly pattern per Scott Carney, http://www.harmonictrader.com/price_patterns.htm
}
Inputs: Length(100),MinStrength(4),MaxStrength(8),n(.2),m(.1),BullColor(Green),BearColor(Yellow),
thickness(1),
DelMulti(TRUE), { Deletes Multiple Re-Draw Lines}
dispLables(TRUE);
Vars: F3(0.382),F7(0.786),F8(0.886),F12(1.27),F16(1.618) ,F26(2.618),
P1Bar(-1),P2Bar(-1),T1Bar(-1),T2Bar(-1),Strength(0 ),
P1(0.0),P2(0.0),T1(0.0),T2(0.0),PTValid(False),HLValid(False),
InZone(False),GD(0.0),XA(0.0),AB(0.0),BC(0.0),CD(0.0),AD(0.0),
C1(False),C2(False),C3(False),C4(False),C5(false),
ABdXA(0.0),BCdAB(0.0),CDdBC(0.0),ADdXA(0.0),
TL1(-1),TL2(-1),TL3(-1),TL4(-1),TL5(-1),TL6(-1),TL7(-1), TL8(-1),
TextID(-1), TextGD(-1);
for Strength = MaxStrength downto MinStrength begin
P1Bar = SwingHighBar(1, H, Strength, Length);
P2Bar = SwingHighBar(2, H, Strength, Length);
T1Bar = SwingLowBar(1, L, Strength, Length);
T2Bar = SwingLowBar(2, L, Strength, Length);
If P1Bar -1 and P2Bar -1 and T1Bar -1 and T2Bar -1 then begin
{test for a bullish pattern}
{Trough X is T2}
T2 = L[T2Bar];
{Peak A is P2}
P2 = H[P2Bar];
{Trough B is T1}
T1 = L[T1Bar];
{Peak C is P1}
P1 = H[P1Bar];
{D is the buy point}
GD = L;
{ C < B and B < A and A < X }
PTValid = P1Bar < T1Bar and T1Bar < P2Bar and P2Bar < T2Bar;
{ C X and C > B }
HLValid = P1 T2 and P1 > T1;
{ D X and A >= H }
InZone = GD < T1 and GD = Highest(H, T2Bar);
If PTValid and HLValid and InZone then begin
XA = P2 - T2; {A - X}
AB = P2 - T1; {A - B}
BC = P1 - T1; {C - B}
CD = P1 - GD; {C - D}
AD = P2 - GD; {A - D}
ABdXA = AB / XA; {AB should be 78.6% of XA}
C1 = ABdXA > F7 - m*F7 and ABdXA < F7 + n*F7 ;
BCdAB = BC / AB; {BC should be 38.2-88.6% of AB}
C2 = BCdAB > F3 - m*F3 and BCdAB < F8 + m*F8;
CDdBC = CD / BC; {CD should be 161.8-261.8% of BC}
C3 = CDdBC > F16 - m*F16 and CDdBC < F26 + m*F26;
ADdXA = AD / XA; {AD should be 127% or 161.8% of XA}
C4 = ADdXA > F12 - n*F12 and ADdXA < F16 + n*F16;
C5 = AB <= CD + m*CD;
if C1 and C2 and C3 and C4 and C5 then begin
TL1 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[P2Bar], Time[P2Bar], P2);
if TL1 >= 0 then begin
TL_SetColor(TL1, BullColor);
TL_SetStyle(TL1, Tool_Solid);
TL_SetSize(TL1,thickness);
end ;
TL2 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[T1Bar], Time[T1Bar], T1);
if TL2 >= 0 then begin
TL_SetColor(TL2, BullColor);
TL_SetStyle(TL2, Tool_Solid);
TL_SetSize(TL2,thickness);
end ;
TL3 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date[P1Bar], Time[P1Bar], P1);
if TL3 >= 0 then begin
TL_SetColor(TL3, BullColor);
TL_SetStyle(TL3, Tool_Solid);
TL_SetSize(TL3,thickness);
end ;
if (DelMULTI) then
begin
if (TL4>0) then TL_Delete(TL4);
if (TL5>0) then TL_Delete(TL5);
if (TL5>0) then TL_Delete(TL6);
end;
TL4 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date, Time, GD);
if TL4 >= 0 then begin
TL_SetColor(TL4, BullColor);
TL_SetStyle(TL4, Tool_Solid);
TL_SetSize(TL4,thickness);
end;
TL5 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date, Time, GD);
if TL5 >= 0 then begin
TL_SetColor(TL5, BullColor);
TL_SetStyle(TL5, Tool_Dotted);
TL_SetSize(TL5,thickness);
end;
TL6 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date, Time, GD);
if TL6 >= 0 then begin
TL_SetColor(TL6, BullColor);
TL_SetStyle(TL6, Tool_Dotted);
TL_SetSize(TL6,thickness);
end;
TL7 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[P1Bar], Time[P1Bar], P1);
If TL7 >= 0 Then Begin
TL_SetColor(TL7, BullColor);
TL_SetStyle(TL7, Tool_Dotted);
TL_SetSize(TL7,thickness);
End;
TL8 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[T1Bar], Time[T1Bar], T1);
If TL8 >= 0 Then Begin
TL_SetColor(TL8, BullColor);
TL_SetStyle(TL8, Tool_Dotted);
TL_SetSize(TL8,thickness);
End;
{
if (dispLables) then
begin
TextID = Show_text(Date[P1Bar], Time[P1Bar], P1, BullColor,3,1, "P1");
TextID = Show_text(Date[P2Bar], Time[P2Bar], P2, BullColor,3,1, "P2");
TextID = Show_text(Date[T2Bar], Time[T2Bar], T2, BullColor,3,3, "T2");
TextID = Show_text(Date[T1Bar], Time[T1Bar], T1, BullColor,3,3, "T1");
if (TEXTGD > 0) then Text_Delete(GD);
TextGD = Show_text(Date, Time, GD, BullColor,3,3, "GD");
end;
}
end;
end;
{test for a bearish pattern}
{Peak X is P2}
{Trough A is T2}
{Peak B is P1}
{Trough C is T1}
{GD is the short point}
GD = H;
PTValid = T1Bar < P1Bar and P1Bar < T2Bar and T2Bar < P2Bar;
HLValid = T1 > T2 and P1 < P2 and T1 < P1;
InZone = GD > P1 and GD > P2 and T2 <= Lowest(L, P2Bar);
if PTValid and HLValid and InZone then begin
XA = P2 - T2;
AB = P1 - T2;
BC = P1 - T1;
CD = GD - T1;
AD = GD - T2;
ABdXA = AB / XA; {AB should be 78.6% of XA}
C1 = ABdXA > F7 - m*F7 and ABdXA < F7 + n*F7;
BCdAB = BC / AB; {BC should be 38.2-88.6% of AB}
C2 = BCdAB > F3 - m*F3 and BCdAB < F8 + m*F8;
CDdBC = CD / BC; {CD should be 161.8-261.8% of BC}
C3 = CDdBC > F16 - m*F16 and CDdBC < F26 + m*F26;
ADdXA = AD / XA; {AD should be 127% or 161.8% of XA}
C4 = ADdXA > F12 - n*F12 and ADdXA < F16 + n*F16;
C5 = AB <= CD + m*CD;
if C1 and C2 and C3 and C4 and C5 then begin
TL1 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[T2Bar], Time[T2Bar], T2);
if TL1 >= 0 then begin
TL_SetColor(TL1, BearColor);
TL_SetStyle(TL1, Tool_Solid);
TL_SetSize(TL1,thickness);
end ;
TL2 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[P1Bar], Time[P1Bar], P1);
if TL2 >= 0 then begin
TL_SetColor(TL2, BearColor);
TL_SetStyle(TL2, Tool_Solid);
TL_SetSize(TL2,thickness);
end ;
TL3 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date[T1Bar], Time[T1Bar], T1);
if TL3 >= 0 then begin
TL_SetColor(TL3, BearColor);
TL_SetStyle(TL3, Tool_Solid);
TL_SetSize(TL3,thickness);
end ;
if (DelMULTI) then
begin
if (TL4>0) then TL_Delete(TL4);
if (TL5>0) then TL_Delete(TL5);
if (TL5>0) then TL_Delete(TL6);
end;
TL4 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date, Time, GD);
if TL4 >= 0 then begin
TL_SetColor(TL4, BearColor);
TL_SetStyle(TL4, Tool_Solid);
TL_SetSize(TL4,thickness);
end ;
TL5 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date, Time, GD);
if TL5 >= 0 then begin
TL_SetColor(TL5, BearColor);
TL_SetStyle(TL5, Tool_Dotted);
TL_SetSize(TL5, thickness);
end;
TL6 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date, Time, GD);
if TL6 >= 0 Then begin
TL_SetColor(TL6, BearColor);
TL_SetStyle(TL6, Tool_Dotted);
TL_SetSize(TL6, thickness);
end;
TL7 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[P1Bar], Time[P1Bar], P1);
If TL7 >= 0 Then Begin
TL_SetColor(TL7, BearColor);
TL_SetStyle(TL7, Tool_Dotted);
TL_SetSize(TL7, thickness);
End;
TL8 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[T1Bar], Time[T1Bar], T1);
If TL8 >= 0 Then Begin
TL_SetColor(TL8, BearColor);
TL_SetStyle(TL8, Tool_Dotted);
TL_SetSize(TL8,thickness);
End;
{
if (dispLables) then
begin
TextID = Show_text(Date[P1Bar], Time[P1Bar], P1, BearColor,3,1, "P1");
TextID = Show_text(Date[P2Bar], Time[P2Bar], P2, BearColor,3,1, "P2");
TextID = Show_text(Date[T2Bar], Time[T2Bar], T2, BearColor,3,3, "T2");
TextID = Show_text(Date[T1Bar], Time[T1Bar], T1, BearColor,3,3, "T1");
if (TEXTGD > 0) then Text_Delete(GD);
TextGD = Show_text(Date, Time, GD, BearColor,3,3, "GD");
end;
}
end;
end;
end;
ziko, and now the code for the Gartley, also from tradestation
{ based on Mark Conway code
by Mark Kazmierczak, "mido", 8/2003
mod 11/2003 to add dynamic Strength thanks to progster
sadhu at myacc.net
Gartley pattern per Scott Carney
}
Inputs: Length(100),MinStrength(4),MaxStrength(8),n(.2),m(.1),BullColor(Blue),BearColor(Red),
thickness(2);
Vars: F6(0.618),F7(0.786),F12(1.27),F16(1.618),
P1Bar(-1),P2Bar(-1),T1Bar(-1),T2Bar(-1),Strength(0),
P1(0.0),P2(0.0),T1(0.0),T2(0.0),PTValid(False),HLValid(False),
InZone(False),GD(0.0),XA(0.0),AB(0.0),BC(0.0),CD(0.0),AD(0.0),
C1(False),C2(False),C3(False),C4(False),C5(false),
ABdXA(0.0),BCdAB(0.0),CDdBC(0.0),ADdXA(0.0),
TL1(-1),TL2(-1),TL3(-1),TL4(-1),TL5(-1),TL6(-1);
for Strength = MaxStrength downto MinStrength begin
P1Bar = SwingHighBar(1, H, Strength, Length);
P2Bar = SwingHighBar(2, H, Strength, Length);
T1Bar = SwingLowBar(1, L, Strength, Length);
T2Bar = SwingLowBar(2, L, Strength, Length);
If P1Bar -1 and P2Bar -1 and T1Bar -1 and T2Bar -1 {and DBar -1} then begin
{test for a bullish pattern}
{Trough X is T2}
T2 = L[T2Bar];
{Peak A is P2}
P2 = H[P2Bar];
{Trough B is T1}
T1 = L[T1Bar];
{Peak C is P1}
P1 = H[P1Bar];
{DBar = PivotLowVSBar(1,L,Strength,2,P1Bar);}
{D is the buy point}
GD = L;
{ C < B and B < A and A < X }
PTValid = P1Bar < T1Bar and T1Bar < P2Bar and P2Bar < T2Bar;
{ C X and C > B }
HLValid = P1 T2 and P1 > T1;
{ D X and A >= H }
InZone = GD T2 and P2 >= Highest(H, T2Bar) and T2 <= Lowest(L,T2Bar);
If PTValid and HLValid and InZone then begin
XA = P2 - T2; {A - X}
AB = P2 - T1; {A - B}
BC = P1 - T1; {C - B}
CD = P1 - GD; {C - D}
AD = P2 - GD; {A - D}
ABdXA = AB / XA; {AB should be 61.8% of XA}
C1 = ABdXA > F6 - n*F6 and ABdXA < F6 + n*F6 ;
BCdAB = BC / AB; {BC should be 61.8-78.6% of AB}
C2 = BCdAB > F6 - n*F6 and BCdAB < F7 + n*F7;
CDdBC = CD / BC; {CD should be 127% or 161.8% of BC}
C3 = CDdBC > F12 - m*F12 and CDdBC < F16 + m*F16;
ADdXA = AD / XA; {AD should be 78.6% of XA}
C4 = ADdXA > F7 - n*F7 and ADdXA < F7 + n*F7;
C5 = AB >= CD - m*CD And AB <= CD + m*CD;
If C1 and C2 and C3 and C4 and C5 then begin
TL1 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[P2Bar], Time[P2Bar], P2);
If TL1 >= 0 Then begin
TL_SetColor(TL1, BullColor);
TL_SetStyle(TL1, Tool_Solid);
TL_SetSize(TL1,thickness);
End;
TL2 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[T1Bar], Time[T1Bar], T1);
If TL2 >= 0 Then begin
TL_SetColor(TL2, BullColor);
TL_SetStyle(TL2, Tool_Solid);
TL_SetSize(TL2,thickness);
End;
TL3 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date[P1Bar], Time[P1Bar], P1);
If TL3 >= 0 Then begin
TL_SetColor(TL3, BullColor);
TL_SetStyle(TL3, Tool_Solid);
TL_SetSize(TL3,thickness);
End;
TL4 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date, Time, GD);
If TL4 >= 0 Then Begin
TL_SetColor(TL4, BullColor);
TL_SetStyle(TL4, Tool_Solid);
TL_SetSize(TL4,thickness);
End;
TL5 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date, Time, GD);
If TL5 >= 0 Then Begin
TL_SetColor(TL5, BullColor);
TL_SetStyle(TL5, Tool_Dotted);
End;
TL6 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date, Time, GD);
If TL6 >= 0 Then Begin
TL_SetColor(TL6, BullColor);
TL_SetStyle(TL6, Tool_Dotted);
End;
Alert( "Bullish Gartley" );
End;
End;
{test for a bearish pattern}
{Peak X is P2}
{Trough A is T2}
{Peak B is P1}
{Trough C is T1}
{GD is the short point}
GD = H;
PTValid = T1Bar < P1Bar and P1Bar < T2Bar and T2Bar < P2Bar;
HLValid = T1 > T2 and P1 < P2 and T1 < P1;
InZone = GD > P1 and GD < P2 and T2 = Highest(H,P2Bar);
If PTValid and HLValid and InZone then begin
XA = P2 - T2;
AB = P1 - T2;
BC = P1 - T1;
CD = GD - T1;
AD = GD - T2;
ABdXA = AB / XA; {AB should be 61.8% of XA}
C1 = ABdXA > F6 - n*F6 and ABdXA < F6 + n*F6;
BCdAB = BC / AB; {BC should be 61.8-78.6% of AB}
C2 = BCdAB > F6 - n*F6 and BCdAB < F7 + n*F7;
CDdBC = CD / BC; {CD should be 127% or 161.8% of BC}
C3 = CDdBC > F12 - m*F12 and CDdBC < F16 + m*F16;
ADdXA = AD / XA; {AD should be 78.6% of XA}
C4 = ADdXA > F7 - n*F7 and ADdXA < F7 + n*F7;
C5 = AB >= CD - m*CD And AB <= CD + m*CD;
If C1 and C2 and C3 and C4 and C5 then begin
TL1 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date[T2Bar], Time[T2Bar], T2);
If TL1 >= 0 Then Begin
TL_SetColor(TL1, BearColor);
TL_SetStyle(TL1, Tool_Solid);
TL_SetSize(TL1,thickness);
End;
TL2 = TL_New(Date[T2Bar], Time[T2Bar], T2, Date[P1Bar], Time[P1Bar], P1);
If TL2 >= 0 Then Begin
TL_SetColor(TL2, BearColor);
TL_SetStyle(TL2, Tool_Solid);
TL_SetSize(TL2,thickness);
End;
TL3 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date[T1Bar], Time[T1Bar], T1);
If TL3 >= 0 Then Begin
TL_SetColor(TL3, BearColor);
TL_SetStyle(TL3, Tool_Solid);
TL_SetSize(TL3,thickness);
End;
TL4 = TL_New(Date[T1Bar], Time[T1Bar], T1, Date, Time, GD);
If TL4 >= 0 Then Begin
TL_SetColor(TL4, BearColor);
TL_SetStyle(TL4, Tool_Solid);
TL_SetSize(TL4,thickness);
End;
TL5 = TL_New(Date[P1Bar], Time[P1Bar], P1, Date, Time, GD);
If TL5 >= 0 Then Begin
TL_SetColor(TL5, BearColor);
TL_SetStyle(TL5, Tool_Dotted);
End;
TL6 = TL_New(Date[P2Bar], Time[P2Bar], P2, Date, Time, GD);
If TL6 >= 0 Then Begin
TL_SetColor(TL6, BearColor);
TL_SetStyle(TL6, Tool_Dotted);
End;
Alert( "Bearish Gartley" );
End;
End;
End;
end;
guys, just one very dumb and noob question: what are the targets after pattern is in place?
I am a beginner , but I think .62% CD is first target and 62% AD is the Second one.