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

Notification

Icon
Error

Options
Go to last post Go to first unread
bdfranca  
#1 Posted : Thursday, March 11, 2010 3:11:47 PM(UTC)
bdfranca

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/11/2010(UTC)
Posts: 2

Hi there!

Metastock is not capable to draw Range Bar charts.

But I was wondering if it's possible to make an indicator based on the ideia.

The ideia is that the indicator (line) will change if price moves X points/percents above or below the previous value of the indicator.

A solution that I've found was Jose's Stepped Price/Indicator output v2.0:

{ ©Copyright 2005 Jose Silva
For personal use only
http://www.metastocktools.com }

{ Data array or indicator to quantize }
x:=C;
{ User inputs }
step:=Input("Step size",0,10000,0.5);
type:=Input("Step type: [1]$points, [2]%percentage",1,2,1);
{ Step size }
step:=Max(If(type=1,step,
LastValue(x*(step/100))),.00001);
{ Stepped data array }
stepX:=Int(x/step+.5)*step;
{ Plot on price chart or own window }
stepX
{end}

But it didnt work as i thought.

After sometime thinking, i finally got something near of what i want. I don't see problems with the code but it didnt work as i thought too. Can anyone, please, point and solve the problem? In advance, I'm really not sure about the use of PREV function... Here's the code...

=B.F. - Range Bar Indicator=

{begin}

rsize:=Input("Range Size (points)",0,1000000,0);
fstv:=Input("First indicator value",0,1000000,0);

ValueWhen(1,

{CONDITION} (H - If(PREV=0,fstv,PREV) > rsize) OR (If(PREV=0,fstv,PREV) - L > rsize) ,

{PLOTED VALUE}
If((H-If(PREV=0,fstv,PREV) > rsize), If(PREV=0,fstv,PREV) + rsize ,If((If(PREV=0,fstv,PREV)-L > rsize), If(PREV=0,fstv,PREV) - rsize, If(PREV=0,fstv,PREV))));

{end}

The idea is: If PREV=0 than it calls "first value" parameter, although it calls previous value of indicator. If H-(PREV or 'FirstValue') > 'defined range', it gives you (PREV or 'FirstValue') + 'defined range' and If (PREV or 'FirstValue')-L > 'defined range', it gives you (PREV or 'FirstValue') - 'defined range'...

Any help is welcome...

Thanks in advance...

bdfranca  
#2 Posted : Friday, March 12, 2010 1:38:35 PM(UTC)
bdfranca

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/11/2010(UTC)
Posts: 2

SOLVED...

= B.F. - Range Bar Indicator (Points) =

rsize:=Input("Range Size (points)",0,1000000000,0);

If(Cum(If(C>0,1,0))=1, (H+L)/2 ,If( Abs(C-PREV)>=rsize, If(C>PREV, PREV+rsize, PREV-rsize), PREV));

= B.F. - Range Bar Indicator (%) =

rsize:=Input("% Range Size (em no)",0,1000000000,0);
If(Cum(If(C>0,1,0))=1, (H+L)/2 ,If( Abs((C/If(PREV=0,.00001,PREV))-1)>=rsize/100, If(C>PREV, PREV*(1+rsize/100), PREV*(1-rsize/100)), PREV));

= B.F. - Range Bar Indicator =

kind:=Input("Kind: 1.Points, 2.%", 1,2,1);
rsize:=Input("% Range Size (em no)",0,100,0);
rsizep:=Input("% Range Size (em no)",0,100,0);

indpt:=If(Cum(If(C>0,1,0))=1, (H+L)/2 ,If( Abs(C-PREV)>=rsize, If(C>PREV, PREV+rsize, PREV-rsize), PREV));
indpct:=If(Cum(If(C>0,1,0))=1, (H+L)/2 ,If( Abs((C/If(PREV=0,.00001,PREV))-1)>=rsizep/100, If(C>PREV, PREV*(1+rsizep/100), PREV*(1-rsizep/100)), PREV));

If(kind=1, indpt, indpct);

Nice to find congestions...

FormulaPrimer  
#3 Posted : Friday, March 12, 2010 5:25:14 PM(UTC)
FormulaPrimer

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 8/12/2005(UTC)
Posts: 73

Look very similar to Point and Figure... excellent coding. Thx.
parimalp  
#4 Posted : Saturday, February 25, 2012 8:55:37 AM(UTC)
parimalp

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/4/2011(UTC)
Posts: 7
Location: New Bombay, India

Hi,
I copied the above code in Indicator Builder
but the same did not give the desired result or may be I do not know how to use it

Pls let me know if the code needs to be copied somewhere else. It will be nice if someone can help me with the steps in doing so.

I have also searched other forums on how to display the Range Bars in MetaStock, but there is nothing anywhere to that effect.

Kindly let me know if there is any other way to plot the Range Bars. These days a lot of traders have been switching to Range Bars and hence want to try it.

Regards,

Pankaj
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.