logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Derek Worswick  
#1 Posted : Tuesday, July 31, 2012 2:27:20 AM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi, The formula below shows Wedge formations (author unknown) Does anyone have other Wedge formations Formulas? Or can this formula be improved? Kind regards, Derek _______________________________
Code:


{Two Trend-lines Wedges Scale from right} 

pv:= Input("VeryLong=4,Long=3,Med=2,Short=1",1,4,4); 
pp:= LastValue(If(pv=4,4,If(pv=3,2,If(pv=2,1,0.5)))); 
r0:= If(MP()>=Ref(MP(),-1),ATR(1),0); 
r1:= Log(If(r0>0,ATR(1),HIGH)/HIGH); 
r2:= Cum(r1)/Max(1,Cum(If(r0>0,1,0))); 
r3:= LastValue(100*Exp(LastValue(r2)))*pp; 
r4:= LastValue(PeakBars(2,H,r3))-LastValue(PeakBars(1,H,r3)); 
r5:= (LastValue(Peak(1,H,r3))-LastValue(Peak(2, H,r3)))/r4; {slope} 
r6:= LastValue(Peak(2, H,r3))+(r5*(Cum(1)-LastValue(Cum(1)- PeakBars(2,H,r3)))); 
r7:= If(Cum(1) <lastValue(Cum(1)-PeakBars(2,H,r3)),BarsSince(Cum(1)>=LastValue(Cum(1)-PeakBars( 2,H,r3))),r6); 
s0:= If(MP()<=Ref(MP(),-1),ATR(1),0); 
s1:= Log(If(s0>0,ATR(1),LOW)/LOW); 
s2:= Cum(s1)/Max(1,Cum(If(s0>0,1,0))); 
s3:= LastValue(100*Exp(LastValue(s2)))*pp; 
s4:= LastValue(TroughBars(2,L,s3))-LastValue(TroughBars(1,L,s3)); 
s5:= (LastValue(Trough(1,L,s3))-LastValue(Trough(2,L,s3)))/s4; {slope} 
s6:= LastValue(Trough(2,L,s3))+(s5*(Cum(1)-LastValue(Cum(1)-TroughBars(2,L,s3)))); 
s7:= If(Cum(1)<lastValue(Cum(1)-TroughBars(2,L,s3)),BarsSince(Cum(1)>=LastValue(Cum(1 )-TroughBars(2, L,s3))),s6); 
r7;s7;

jjstein  
#2 Posted : Tuesday, July 31, 2012 12:36:14 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
There are errors in the code. Where did you find it?
Derek Worswick  
#3 Posted : Tuesday, July 31, 2012 1:25:10 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Sorry --Johnathan, Code works OK for me in MetaStock I must have made a error in copy & paste Re posted below:
Code:
 

{Two Trend-lines Wedges Scale from right} 

pv:= Input("VeryLong=4,Long=3,Med=2,Short=1",1,4,4); 
pp:= LastValue(If(pv=4,4,If(pv=3,2,If(pv=2,1,0.5)))); 
r0:= If(MP()>=Ref(MP(),-1),ATR(1),0); 
r1:= Log(If(r0>0,ATR(1),HIGH)/HIGH); 
r2:= Cum(r1)/Max(1,Cum(If(r0>0,1,0))); 
r3:= LastValue(100*Exp(LastValue(r2)))*pp; 
r4:= LastValue(PeakBars(2,H,r3))-LastValue(PeakBars(1,H,r3)); 
r5:= (LastValue(Peak(1,H,r3))-LastValue(Peak(2, H,r3)))/r4; {slope} 
r6:= LastValue(Peak(2, H,r3))+(r5*(Cum(1)-LastValue(Cum(1)- PeakBars(2,H,r3)))); 
r7:= If(Cum(1) <lastValue(Cum(1)-PeakBars(2,H,r3)),BarsSince(Cum(1)>=LastValue(Cum(1)-PeakBars( 2,H,r3))),r6); 
s0:= If(MP()<=Ref(MP(),-1),ATR(1),0); 
s1:= Log(If(s0>0,ATR(1),LOW)/LOW); 
s2:= Cum(s1)/Max(1,Cum(If(s0>0,1,0))); 
s3:= LastValue(100*Exp(LastValue(s2)))*pp; 
s4:= LastValue(TroughBars(2,L,s3))-LastValue(TroughBars(1,L,s3)); 
s5:= (LastValue(Trough(1,L,s3))-LastValue(Trough(2,L,s3)))/s4; {slope} 
s6:= LastValue(Trough(2,L,s3))+(s5*(Cum(1)-LastValue(Cum(1)-TroughBars(2,L,s3)))); 
s7:= If(Cum(1)<lastValue(Cum(1)-TroughBars(2,L,s3)),BarsSince(Cum(1)>=LastValue(Cum(1 )-TroughBars(2, L,s3))),s6); 
r7;s7;

 
Derek
Derek Worswick  
#4 Posted : Tuesday, July 31, 2012 2:11:13 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

There is problem when posting code with r the " Less than Sign " Line r7 " Less than Sign “ caused when the Community Server software to parse the post as html tags ___________________________________ See Mr wabbit information: " It's a problem caused when the Community Server software parses the posts, that it treats angled brackets as html tags. Mr wabbit has reported this to the Admin team many times already. See Link http://forum.equis.com/forums/thread/38727.aspx ___________________________________ Is it possible to attach A MS Word doc with the code for the above? Derek
Derek Worswick  
#5 Posted : Tuesday, July 31, 2012 2:50:20 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hope that this solves the “ Less Than “ problem Derek _________________________ [code] Two Trend-lines Wedges Scale from right} pv:= Input("VeryLong=4,Long=3,Med=2,Short=1",1,4,4); pp:= LastValue(If(pv=4,4,If(pv=3,2,If(pv=2,1,0.5)))); r0:= If(MP()>=Ref(MP(),-1),ATR(1),0); r1:= Log(If(r0>0,ATR(1),HIGH)/HIGH); r2:= Cum(r1)/Max(1,Cum(If(r0>0,1,0))); r3:= LastValue(100*Exp(LastValue(r2)))*pp; r4:= LastValue(PeakBars(2,H,r3))-LastValue(PeakBars(1,H,r3)); r5:= (LastValue(Peak(1,H,r3))-LastValue(Peak(2, H,r3)))/r4; {slope} r6:= LastValue(Peak(2, H,r3))+(r5*(Cum(1)-LastValue(Cum(1)- PeakBars(2,H,r3)))); r7:= If(Cum(1) LESS THAN LastValue(Cum(1)-PeakBars(2,H,r3)),BarsSince(Cum(1)>=LastValue(Cum(1)-PeakBars( 2,H,r3))),r6); s0:= If(MP() LESS THAN =Ref(MP(),-1),ATR(1),0); s1:= Log(If(s0>0,ATR(1),LOW)/LOW); s2:= Cum(s1)/Max(1,Cum(If(s0>0,1,0))); s3:= LastValue(100*Exp(LastValue(s2)))*pp; s4:= LastValue(TroughBars(2,L,s3))-LastValue(TroughBars(1,L,s3)); s5:= (LastValue(Trough(1,L,s3))-LastValue(Trough(2,L,s3)))/s4; {slope} s6:= LastValue(Trough(2,L,s3))+(s5*(Cum(1)-LastValue(Cum(1)-TroughBars(2,L,s3)))); s7:= If(Cum(1) LESS THAN LastValue(Cum(1)-TroughBars(2,L,s3)),BarsSince(Cum(1)>=LastValue(Cum(1 )-TroughBars(2, L,s3))),s6); r7;s7;
jjstein  
#6 Posted : Wednesday, August 1, 2012 10:28:51 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
OK, got it to work.
Derek Worswick wrote:

Does anyone have other Wedge formations Formulas?

Where did you get this one?


Derek Worswick wrote:

Or can this formula be improved?

In what way?

Derek Worswick  
#7 Posted : Wednesday, August 1, 2012 1:48:06 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi I found the Wedge formula several years ago… I do not remember the source or the author. I hoped that someone had another Triangle formula that finds other Triangle or Wedge Patterns that are not found by the above formula; For the benefit of other users Could the Moderator edit my use of “LESS THAN “ text in the code and replace with the correct symbol …. Which I have not been able to post in the code box? Derek
jjstein  
#8 Posted : Wednesday, August 1, 2012 6:46:29 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Don't use them myself, but had the following bookmarked:

1. StopLoss This required a membership for about $10.

2. Triangles II A bit more pricey, at $150.

3. Giorgos Siligardos did a "Cup & Handle" pattern some years ago, which was very clever!

4. Markos Katsanos wrote several pattern articles with MSFL, too, as well as a book.

Depending on how code is written, you may not be able backtest. The "wedge" is written that way -- it only finds the most current wedge, not past wedges. You might ask the vendor about backtest use of the product, before you buy it.

Derek Worswick  
#9 Posted : Thursday, August 2, 2012 12:40:43 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Johnathan. Thank you for the information on Triangles & Wedges. Kind regards, Derek
Derek Worswick  
#10 Posted : Saturday, August 4, 2012 9:40:51 AM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Johnathan. Could you please tell me how you apply Live http links to forum as your example: 4. Markos Katsanos wrote several pattern articles with MSFL, too, as well as a book. Kinds regards, Derek
jjstein  
#11 Posted : Saturday, August 4, 2012 11:44:16 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
1. Highlight & copy (CTRL-C) the link (at the top of the page), usually in another browser tab or window..

2. In your forum reply, highlight/mark the text for the link.

3. Click the 3rd icon from right -- the little globe with a chain below it. A window will pop up, then paste the link (CTRL-V) and hit ENTER.

Derek Worswick  
#12 Posted : Saturday, August 4, 2012 2:27:38 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Johnathan. Thank you for the information on adding live http links to the forum. And all the work you have done in compiling the list of articles by Markos Katsanos “ several pattern articles “ Kind regards, Derek
ankur_chops  
#13 Posted : Sunday, August 5, 2012 2:00:27 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

Hi,
where to paste this formula in metastock? please share link if its there.
How can I add this in my exploration tab??
Also:
please share formula for triangle,and some other classical patterns like Head and Shoulders, Double top etc.

Many Thanks

jjstein  
#14 Posted : Sunday, August 5, 2012 9:48:34 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Ankur,

I think you need to work through the Formula Primer. Please click the link below.

Derek Worswick  
#15 Posted : Thursday, August 23, 2012 3:46:21 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi, You may have to Zoom the Chart below With thanks to " Daneric's Elliott Waves. ". link below: http://danericselliottwaves.blogspot.co.uk/ " If this is the biggest rising bearish wedge ever, then the subsequent price collapse will be too " UserPostedImage
ankur_chops  
#16 Posted : Wednesday, September 5, 2012 8:28:29 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

can anyone plz post formula for triangle, head and shoulders , double bottom....


Derek Worswick  
#17 Posted : Wednesday, September 5, 2012 9:03:23 AM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

HI, I hope that your German is better than mine If you use a power translator... it makes a mess of the format ___________________________________________ Metastock 7.2: "The triangle-trader" with the perfect formations http://www.metastock-for...?ST=4047&CP=0&F=1#newmsg ___________________________________________ Metastock: triangle formation Exploration (S & C, March 2004) http://www.metastock-for...orum.pl?ST=8008&CP=0&F=1 ___________________________________________ Derek
ankur_chops  
#18 Posted : Thursday, September 6, 2012 1:48:54 AM(UTC)
ankur_chops

Rank: Member

Groups: Registered, Registered Users
Joined: 8/5/2012(UTC)
Posts: 16

I will require to learn German just for the triangles.....I never knew that :)
thanks a lot Derek....
I have another question, if you like to answer...

I want to write a formula in explorer of Metastock.
My key requirements are:
1. 5 day before range of the stock ( open-close or close-open) should be greater than or equal to average of last 20 day range( each day range is calculated by open-close or close-open )
2. after that stock should move inside of the Big day ( in this case 5 day before) ( inside )
3. and break above or below the Big day ( which came 5 day before) should be buy or sell with stop as other high or low.

please help me to write this simple exploration formula and also plz tell how will I write this in expert system.

Thanks
Ankur

Derek Worswick  
#19 Posted : Thursday, September 6, 2012 1:27:54 PM(UTC)
Derek Worswick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 8/11/2005(UTC)
Posts: 104

Hi Ankur You could use Goggles Translate to Translate from German to your own Language Link below: http://translate.google.com/#de/en/ May I suggest that copy and paste one sentence or paragraph at once Into “ Goggles Translate “ Then paste the translated text into MS Word or other program So that you can preserve the format / layout. Have fun Derek
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.