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

Notification

Icon
Error

Options
Go to last post Go to first unread
vannamva  
#1 Posted : Tuesday, September 14, 2010 9:02:29 AM(UTC)
vannamva

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 8/21/2009(UTC)
Posts: 4

Need help

I need to draw trend line betwwen "d"and "f " is possible.pls advise for furter setp.

a:=L<Ref(L,-1) AND L<Ref(L,1);
b:=Ref(a,-1);
d:=ValueWhen(1,a,L);
f:=ValueWhen(1,b,L);

wiked  
#2 Posted : Tuesday, September 14, 2010 11:12:36 AM(UTC)
wiked

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 31

A line requires a starting point and a slope

use cum(1) inside the valuewhen to get the bar number of the points d and f. Then calulate the distance between the points for the run value. Rise / Run is your slope.

finish the formula with the value of the first point plus the slope times the barsince the first point
vannamva  
#3 Posted : Wednesday, September 15, 2010 8:57:01 AM(UTC)
vannamva

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 8/21/2009(UTC)
Posts: 4

I AM NOT HAVING MUCH KNOWLEDGE EVEN IN ENGLISH.

I AM HAVING ONLY TRADING EXPERIANCE .

THATS WHY WRITTING IN MINIMUM WORDS.

SO PLS EXPLAIN IN FORMULA STRUCTURE.

wiked  
#4 Posted : Tuesday, September 21, 2010 9:08:17 AM(UTC)
wiked

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 31

I prefer not to right formulas for others because I do not always understand everything they are wanting to do. I'm not desirous to adjust and modify code. However, here is the basic logic to draw a line between the last two points your formula identifies:

a:=L<Ref(L,-1) AND L<Ref(L,1);
b:=Ref(a,-1);
d:=ValueWhen(1,a,L);
f:=ValueWhen(1,b,L);
point1:= lastvalue( valuewhen(1, a, Cum(1) ) );
point2:= lastvalue( valuewhen(1, b, Cum(1) ) );
startx:= min( point1, point2);
starty:= if(point1<point2, d, f);
run:= ABS( point1-point2);
rise:= if(point1<point2, f-d, d-f);
slope:= rise / run;
line:= starty + (barsince( cum(1)=startx ) * slope)

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.