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

Notification

Icon
Error

Options
Go to last post Go to first unread
gauravudani  
#1 Posted : Wednesday, March 30, 2011 12:17:41 AM(UTC)
gauravudani

Rank: Member

Groups: Registered, Registered Users
Joined: 2/12/2008(UTC)
Posts: 17

hi , I am try to code a line which is a mid point between two fractals i want it to get ( value of the high fractal - the value of the low fractal ) / 2 and subtract the value from the last high fractal I tried this M:= ((Fml( "alc_fract up") - Fml( "Alc_fract down"))/2); Sl:= (Fml( "alc_fract up") - M ); SS:= If((Fml( "alc_fract up")),m, PREV); SS1:= (Fml( "alc_fract up") - SS); SS1; But there is a minor change that i want here . i want it to check for a up fractal and only if it finds 1 then it should use the previous low fractal for the formula what this formula does is that it uses all the fractals Thanks Gaurav Udani
gauravudani  
#2 Posted : Wednesday, March 30, 2011 12:23:44 AM(UTC)
gauravudani

Rank: Member

Groups: Registered, Registered Users
Joined: 2/12/2008(UTC)
Posts: 17

((Fml( "alc_fract up") fractalup:= Ref(H,-3) >= Ref(H,-5) AND Ref(H,-3) >= Ref(H,-4) AND Ref(H,-3) >= Ref(H,-2) AND Ref(H,-3) >= Ref(H,-1); hi:=(ValueWhen(1,fractalup,Ref(H,-3))); {extend to the right} hi:=ExtFml("forum.sum",hi,1); ValueWhen(1,hi>0,hi); Fml( "Alc_fract down") fractaldn:= Ref(L,-3) <= Ref(L,-5) AND Ref(L,-3) <= Ref(L,-4) AND Ref(L,-3) <= Ref(L,-2) AND Ref(L,-3)<= Ref(L,-1); lo:=ValueWhen(1,fractaldn,Ref(L,-3)); {extend to the right} lo:=ExtFml("forum.sum",lo,1); ValueWhen(1,lo>0,lo );
wabbit  
#3 Posted : Wednesday, March 30, 2011 2:51:00 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Use BarsSince() to find the correct order of the events:


wabbit [:D]

gauravudani  
#4 Posted : Wednesday, March 30, 2011 11:22:09 PM(UTC)
gauravudani

Rank: Member

Groups: Registered, Registered Users
Joined: 2/12/2008(UTC)
Posts: 17

hi i dont know who to use barsince for the order of events , like i want the ST to read fractals from right to left. Can you pls give me a start thanks gaurav
wabbit  
#5 Posted : Friday, April 1, 2011 1:42:10 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
I think your problem is ill-defined, so this solution may get you closer to the objective, but I think you're going to find there are another series of underlying issues in your logic:

Code:


fractalup:=

Ref(H,-3) >= Ref(H,-5) AND

Ref(H,-3) >= Ref(H,-4) AND

Ref(H,-3) >= Ref(H,-2) AND

Ref(H,-3) >= Ref(H,-1);



fractaldn:=

Ref(L,-3) <= Ref(L,-5) AND

Ref(L,-3) <= Ref(L,-4) AND

Ref(L,-3) <= Ref(L,-2) AND

Ref(L,-3) <= Ref(L,-1);

fractalH := valuewhen(1,fractalup,Ref(H,-3));



fractalL := valuewhen(1,fractaldn,Ref(L,-3));


fractalL := valuewhen(1,fractalH,fractalL);

pivot := (fractalH + fractalL)/2;

{plot}
pivot;



wabbit [:D]

P.S. When posting code, please wrap the code in tags:
* code *
* /code *
without the spaces.
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.