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!
:)
|
|
|
|
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 '-)
|
|
|
|
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!
:)
|
|
|
|
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 '-)
|
|
|
|
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!
|
|
|
|
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)
|
|
|
|
|
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.