PureBytes Links
Trading Reference Links
|
Hi Andrew
> I'm getting lots of divide by zero errors - any workarounds?
I've not done any, mainly because I've not seen the problem. As with
anything using divide there's always the likelihood of them popping up.
I built several of these indicators but never pushed them too much.
Someone asked if it could be done so I set out to see if it could. It
seems the answer is yes.
12 plots is a practical limit for a "single indicator" version, but a guy in
France extended the idea to multiple indicators and quite a few more
volume lines.
Eliminating "divide by zero" errors will use up more space, and that could
be a problem with the formula you have. There's another formulae below
that's based on MP() rather than CLOSE, and it measures and plots only
from the right side of a chart. If it's of any use and you want a fix for any
errors, I'll see what I can do.
Your summary in the earlier post of how these formulas work seems to be
spot-on.
Kind regards
Roy
www.metastocktips.co.nz
PS The following formula may have some unwanted end-of-line characters
inserted by the time you get it.
{Volume By Price 12-M}
D:=Input("Periods, 0=Full Chart",0,2000,100);
D:=LastValue(If(D=0,LastValue(Cum(1)-1),D));
N:=Input("% Scaling in Box, 1=None",1,100,50);
F:=LastValue(Cum(1));
A:=F-D<Cum(1); {window period}
B:=LastValue(Cum(If(A,V,0))); {window volume}
Q:=LastValue(HighestSince(1,A=0, Max(Max(O,C),MP())));
R:=LastValue(LowestSince(1,A=0, Min(Min(O,C),MP())));
I:=(Q-R)/12; {range increment}
{accumulated volume for each price range}
X1:=LastValue(Cum(If(MP()<(R+I) AND A,V,0))/B);
X2:=LastValue(Cum(If(MP()>=(R+I) AND MP()<(R+I*2) AND A,V,0))/B);
X3:=LastValue(Cum(If(MP()>=(R+I*2) AND MP()<(R+I*3) AND A,V,0))/B);
X4:=LastValue(Cum(If(MP()>=(R+I*3) AND MP()<(R+I*4) AND A,V,0))/B);
X5:=LastValue(Cum(If(MP()>=(R+I*4) AND MP()<(R+I*5) AND A,V,0))/B);
X6:=LastValue(Cum(If(MP()>=(R+I*5) AND MP()<(R+I*6) AND A,V,0))/B);
X7:=LastValue(Cum(If(MP()>=(R+I*6) AND MP()<(R+I*7) AND A,V,0))/B);
X8:=LastValue(Cum(If(MP()>=(R+I*7) AND MP()<(R+I*8) AND A,V,0))/B);
X9:=LastValue(Cum(If(MP()>=(R+I*8) AND MP()<(R+I*9) AND A,V,0))/B);
X10:=LastValue(Cum(If(MP()>=(R+I*9) AND MP()<(R+I*10) AND A,V,0))/B);
X11:=LastValue(Cum(If(MP()>=(R+I*10) AND MP()<(R+I*11) AND A,V,0))/B);
X12:=LastValue(Cum(If(MP()>=(R+I*11) AND A,V,0))/B);
B:=Max(Max(X1,X2),Max(X3,X4));
B:=Max(Max(B,X5),Max(X6,X7));
B:=Max(Max(B,X8),Max(X9,X10));
B:=Max(B,Max(X11,X12));
B:=If(N=1,N,B*100)/N; {set window % usage}
{top of window, HHV for period}
ValueWhen(1,F-D=Cum(1),Q);
{proportion of volume for each price range}
ValueWhen(1,F-Int(X12*D/B)=Cum(1),R+I*11.5);
ValueWhen(1,F-Int(X11*D/B)=Cum(1),R+I*10.5);
ValueWhen(1,F-Int(X10*D/B)=Cum(1),R+I*9.5);
ValueWhen(1,F-Int(X9*D/B)=Cum(1),R+I*8.5);
ValueWhen(1,F-Int(X8*D/B)=Cum(1),R+I*7.5);
ValueWhen(1,F-Int(X7*D/B)=Cum(1),R+I*6.5);
ValueWhen(1,F-Int(X6*D/B)=Cum(1),R+I*5.5);
ValueWhen(1,F-Int(X5*D/B)=Cum(1),R+I*4.5);
ValueWhen(1,F-Int(X4*D/B)=Cum(1),R+I*3.5);
ValueWhen(1,F-Int(X3*D/B)=Cum(1),R+I*2.5);
ValueWhen(1,F-Int(X2*D/B)=Cum(1),R+I*1.5);
ValueWhen(1,F-Int(X1*D/B)=Cum(1),R+I*0.5);
{left and bottom of window, LLV for period}
ValueWhen(1,F-D<=Cum(1) AND F-D>Cum(1)-2,If(A,R,Q));
> -----Original Message-----
> From: equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx]
> On Behalf Of Andrew Tomlinson
> Sent: Friday, May 27, 2005 7:04 PM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: RE: [EquisMetaStock Group] Volume at Price
>
>
> Hi Roy
>
> I hadn't realized you had put something together. I found a version of the
> code on Jose's site - is that what I should be using?
>
> I'm sure I should dive into the code, but here's a couple of observations to
> make sure I'm reading it right:
> - it takes the closing range for the specified period and divides it into 10
> equal price buckets
> - the volume for every bar that closes in a particular range is summed and
> the sum shown as a horizontal line
> - the horizontal line is drawn at the center price of each bucket
>
> This is very cool.
>
> If there are others who haven't tried this yet, I would recommend giving it
> a whirl.
>
> Best
> Andrew
>
>
> -----Original Message-----
> From: equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx]
> On Behalf Of Roy Larsen
> Sent: Friday, May 27, 2005 5:09 PM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: Re: [EquisMetaStock Group] Volume at Price
>
>
> Hi Andrew
>
>
> I assume you're looking for something a little more sophisticated than my
> "Volume by Price"
> indicators?
>
>
> Kind regards
>
> Roy
> www.metastocktips.co.nz
>
>
>
>
>
> ----- Original Message -----
> From: "Andrew Tomlinson" <andrew_tomlinson@xxxxxxxxxxx>
> To: <equismetastock@xxxxxxxxxxxxxxx>
> Sent: Saturday, May 28, 2005 6:02 AM
> Subject: [EquisMetaStock Group] Volume at Price
>
>
>>
>> Has anyone come across a usable Volume at Price indicator or
>> attachment for Metastock? I'd like to be able to qualify the
>> significance of a specific support or resistance level according to
>> the traded volume at that level over a defined period. It would also
>> help fine-tune start/end points for Fibonacci series.
>>
>> Andrew
>>
>>
>>
>>
>> ----------------------------------------------------------------------
>> ----------
>> Yahoo! Groups Links
>>
>> a.. To visit your group on the web, go to:
>> http://groups.yahoo.com/group/equismetastock/
>>
>> b.. To unsubscribe from this group, send an email to:
>> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>>
>> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>> Service.
>>
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
> --------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/equismetastock/
>
> b.. To unsubscribe from this group, send an email to:
> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|