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

Notification

Icon
Error

Options
Go to last post Go to first unread
buddy  
#1 Posted : Thursday, January 26, 2006 8:14:50 AM(UTC)
buddy

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/6/2005(UTC)
Posts: 18

Hi all: How can I write some codes as an indicator to identify all the decending Peak on the chart? The peak can be compared with the previous peak, or previous two peak. As long as it is decending Peak, then I want it to be identified. Any input or suggestion is welcome! TIA! :)
Jose  
#2 Posted : Thursday, January 26, 2006 12:02:30 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
How about something like this: [code:1:cdbfbe6101] { Peak definition } pk:=Ref(H,-1)>H AND Ref(H,-1)>Ref(H,-2); { Values at last & prev peaks } pkVal1:=ValueWhen(1,pk,Ref(H,-1)); pkVal2:=ValueWhen(2,pk,Ref(H,-1)); { Descending peaks } pk AND pkVal1<pkVal2 [/code:1:cdbfbe6101] You could also try: { Condescending peaks } pk AND pkVal1<pkVal2 AND pkVal1<pkVal3 :) jose '-)
buddy  
#3 Posted : Thursday, January 26, 2006 12:58:45 PM(UTC)
buddy

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/6/2005(UTC)
Posts: 18

Hi Jose: I am using the Zig function to identify the Peak. Here is what I wrote: [code:1:dd1d1c095f] ziz:=Zig(C,1,%); PeakV:=Ref(ziz,1)<ziz AND Ref(ziz,-1)<ziz; Peak1:=ValueWhen(1,PeakV,H); Peak2:=ValueWhen(1,PeakV,H); Plot:=ValueWhen(1,PeakV,H)<ValueWhen(1,Ref(PeakV,-1),H); Cross(Plot,0.5); [/code:1:dd1d1c095f] What do you think? What I am trying to do is to identify all the decending Peak, whether it is the current Peak compare to previous Peak, or the current Peak compare to all the previous Peak point. Please advise, Jose. TIA! :)
Jose  
#4 Posted : Thursday, January 26, 2006 1:16:59 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
If you want to use hindsight functions, you may as well just use the Peak() function. Don't forget that (just like the ZigZag) the last Peak() is dynamic, and not suitable for stable signals (i.e. trading). jose '-)
lcl  
#5 Posted : Saturday, January 28, 2006 12:57:00 AM(UTC)
lcl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 5/22/2005(UTC)
Posts: 59

Jose wrote:
How about something like this: [code:1:6815ffdfb9] { Peak definition } pk:=Ref(H,-1)>H AND Ref(H,-1)>Ref(H,-2); { Values at last & prev peaks } pkVal1:=ValueWhen(1,pk,Ref(H,-1)); pkVal2:=ValueWhen(2,pk,Ref(H,-1)); { Descending peaks } pk AND pkVal1<pkVal2 [/code:1:6815ffdfb9] You could also try: { Condescending peaks } pk AND pkVal1<pkVal2 AND pkVal1<pkVal3 :) jose '-)
Hi Jose, Is it possible to draw a trendline (not manually) to connect these 2 peaks? Many thanks!
Jose  
#6 Posted : Saturday, January 28, 2006 1:10:05 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Yes, check out the 2-point plot indicator trendline code from MetaStockTools.com. jose '-)
Users browsing this topic
Guest (Hidden)
Similar Topics
Lowest Low In Between The Descending Peak (Formula Assistance)
by buddy 1/27/2006 9:10:21 AM(UTC)
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.