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

Notification

Icon
Error

Options
Go to last post Go to first unread
Adrenaline  
#1 Posted : Wednesday, May 2, 2012 10:19:22 PM(UTC)
Adrenaline

Rank: Member

Groups: Registered, Registered Users
Joined: 4/21/2005(UTC)
Posts: 25
Location: Los Angeles, CA

Hey guys, I've been trying everything to figure out how to get this to work but am just not sure it is possible. I'm trying to figure out what the average LLV of an indicator is over say 100/80/60/40/20 days is then divide it to get the average. I been coming home everyday thinking "I've got it" but it's not working. Anyway my last go at it was like this: Thank you very much for any and all help. Mike S
Code:
 LLV( OscP(10,20,E,%),100)+ 
LLV( OscP(10,20,E,%),80)+ 
LLV( OscP(10,20,E,%),60)+ 
LLV( OscP(10,20,E,%),40)+
LLV( OscP(10,20,E,%),20))/5 
wabbit  
#2 Posted : Wednesday, May 2, 2012 10:41:54 PM(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)
Adrenaline wrote:
I'm trying to figure out what the average LLV of an indicator is over say 100/80/60/40/20 days is then divide it to get the average.


Your code doesn't match the "definition" which might be part of the problem; but more of a problem is the definition itself?

There is a length associated with the LLV() function; should this length the same for all the inputs? If it is, then this helps define your term "LLV of an indicator"

Code:

ind:=LLV(OscP(10,20,E,%),20); {or whatever length is required}

av1:=mov(ind,100,s);
av2:=mov(ind,80,s);
av3:=mov(ind,60,s);
av4:=mov(ind,40,s);
av5:=mov(ind,20,s);

{plot}
(av1+av2+av3+av4+av5)/5;


If this isn't it; try rephrasing the problem using completely different terms, assisted by a well annotated diagram of what you think you want.


wabbit [:D]



Adrenaline  
#3 Posted : Wednesday, May 2, 2012 11:09:12 PM(UTC)
Adrenaline

Rank: Member

Groups: Registered, Registered Users
Joined: 4/21/2005(UTC)
Posts: 25
Location: Los Angeles, CA

Heya Wabbit, your speedy response is very much appreciated. I want to look back over the last 100 days and find as many low points/troughs as I can of the Price Oscillator. These low peaks(trough) vary considerably -5,-20. I want to try to take the reading of as many of these low points as possible like one low point every 20 days or so and add them all up, then devide them to get the average. So I wan't to get the average number of all the lows made by the indicator. Jan was a -7, Feb a -10, March a -5, then divide them to get the average. If this doesn't make sense I'll figure out how to get a chart up.. After climbing in bed for the night I just realized, if my code was going to work at all and the lowest low point I was trying to add up was during the last 20 days, I would have had a return value of all 20's so I can see that's not even close now. Here is another example:
Code:
LLV of the Price Oscillator (OscP(10,20,E,%) in Jan 2010
+LLV of the Price Oscillator (OscP(10,20,E,%) in Feb 2010
+LLV of the Price Oscillator (OscP(10,20,E,%) in Mar 2010
All divided by 3 for the average.
Thanks Mike S
wabbit  
#4 Posted : Thursday, May 3, 2012 12:47:25 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)
It's certainly not pretty, but it might get you thinking of a better solution?

Code:

ind:=OscP(10,20,E,%);
pct:=50;
bars:=100;

av:=(
(TroughBars(1,ind,pct)<bars)*Trough(1,ind,pct)+
(TroughBars(2,ind,pct)<bars)*Trough(2,ind,pct)+
(TroughBars(3,ind,pct)<bars)*Trough(3,ind,pct)+
(TroughBars(4,ind,pct)<bars)*Trough(4,ind,pct)+
(TroughBars(5,ind,pct)<bars)*Trough(5,ind,pct)+
(TroughBars(6,ind,pct)<bars)*Trough(6,ind,pct)+
(TroughBars(7,ind,pct)<bars)*Trough(7,ind,pct)+
(TroughBars(8,ind,pct)<bars)*Trough(8,ind,pct)+
(TroughBars(9,ind,pct)<bars)*Trough(9,ind,pct)+
(TroughBars(10,ind,pct)<bars)*Trough(10,ind,pct)
)
/
Max(
(
(TroughBars(1,ind,pct)<bars)+
(TroughBars(2,ind,pct)<bars)+
(TroughBars(3,ind,pct)<bars)+
(TroughBars(4,ind,pct)<bars)+
(TroughBars(5,ind,pct)<bars)+
(TroughBars(6,ind,pct)<bars)+
(TroughBars(7,ind,pct)<bars)+
(TroughBars(8,ind,pct)<bars)+
(TroughBars(9,ind,pct)<bars)+
(TroughBars(10,ind,pct)<bars)
),0.0001);

{plot}
ind;
Zig(ind,pct,%);
av;




wabbit [:D]

Adrenaline  
#5 Posted : Thursday, May 3, 2012 7:18:29 PM(UTC)
Adrenaline

Rank: Member

Groups: Registered, Registered Users
Joined: 4/21/2005(UTC)
Posts: 25
Location: Los Angeles, CA

Sweet, a new toy. I can't wait to play with it. Your time and sharing of knowledge is GREATLY appreciated.
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.