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

Notification

Icon
Error

Options
Go to last post Go to first unread
Leverage  
#1 Posted : Friday, February 4, 2011 7:16:15 AM(UTC)
Leverage

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 1/25/2010(UTC)
Posts: 44
Location: Rome, IT

Hi guys,
if I write:
pds:=Input("Periods MA: ",2,5000,30);
ind:=C-Mov(C,pds,S)

I obtain a cyclical oscillator. Now I want that it oscillates between two values (example: 100 and -100).
To obtain this I write this code:

pds:=Input("Periods MA: ",2,5000,30);
ind:=C-Mov(C,pds,S);
var1:=Highest(ind);
var2:=Lowest(ind);
average:=(var1+var2)/2;
var3:=((ind-average)/(var1-var2))*100;
ind;

but in this mode MS returns values with some errors and
unsatisfactory results.

Is there someone who knows a better method?


johnl  
#2 Posted : Friday, February 4, 2011 7:15:47 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

Do a search on this forum for normalize or try something like:

ti := 100;

p1 := Your indicator here;
p1f := 100/(HHV(p1,ti)-LLV(p1,ti));
p1m := (p1-LLV(p1,ti))*p1f;
p1m
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.