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

Notification

Icon
Error

Options
Go to last post Go to first unread
CrazyHorse7  
#1 Posted : Wednesday, December 21, 2011 3:29:18 AM(UTC)
CrazyHorse7

Rank: Newbie

Groups: Registered, Registered Users
Joined: 12/20/2011(UTC)
Posts: 1

Hi all, I'm trying to create a formula to determine automatically the fibonacci retracement, using as high/low points most recent swings. I wrote this formula to determine the swing high point, but it does not return anything (when i plot it i got nothing on screen).
Code:


HighestFIB:=

If(Ref(H,-2)
I used this code to set the hihgest point of the swing high, and not to make it change if the current high is higher than the swing point high. I think something messes up if the first bars of the chart, and so it keep on with the 'else' of the 'if' function, i.e. always referring to 'Ref(HighestFIB,-1)'. Any idea on how I could make it work? thanks a lot^^
MS Support  
#2 Posted : Thursday, January 12, 2012 10:55:33 AM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,967

Thanks: 93 times
Was thanked: 155 time(s) in 150 post(s)
You can not reference the previous value of highestFIB by name in the assignment of highestFIB. Instead, use the PREV variable as shown below.

top:=Ref(H,-2)<H AND Ref(H,-1)<H AND Ref(H,1)<H AND Ref(H,2)<H;
highestFIB:= If(top, HighestSince(1,top, H), PREV);
highestFIB
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.