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

Notification

Icon
Error

Options
Go to last post Go to first unread
pakki  
#1 Posted : Thursday, July 11, 2013 10:06:14 AM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Hi,

I have a custom indicator, planning to use for entry. This has values of peaks and troughs of the price chart.

When a condition is fulfilled at the latest peak, i want the previous trough value to be plotted/ visible, while all other trough values is to be zero/invisible.

Appreciating your valuable advice,

Regards,

Pakki
mstt  
#2 Posted : Thursday, July 11, 2013 3:18:19 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Pakki

Here's a formula that plots the last valid Trough value. This code provides a starting point - it is not a total solution. You will need to include your own signal conditions into the trigger variable and adjust the PeakBar(), Trough() and TroughBar() parameters to suit.

{Last Trough Value}
A:=TroughBars(1,C,5);
B:=Cum(A=0);
F:=PeakBars(1,C,5);
G:=Cum(F=0);
Trigger:=B=LastValue(B) AND G>=LastValue(G)-1;
ValueWhen(1,Trigger,Trough(1,C,5));

Roy
pakki  
#3 Posted : Thursday, July 11, 2013 10:25:14 PM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Thanks Roy,

Your solution did help me to move forward, going forward, actually i want the last trough bar(not value) to be plotted/highlighted in its(last trough's) position not at the latest peak position. All other inputs being same.

Pakki
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.