PureBytes Links
Trading Reference Links
|
Chorlton, try this indicator code:
===============
Chorlton custom
===============
---8<---------------------------
{ http://www.metastocktools.com }
{ User inputs }
sm:=Input("Starting Month",1,12,1);
sd:=Input("Starting Day of Month",1,31,1);
sy:=Input("Starting Year",1980,2100,2006);
type:=Input("Band type [1]High/Low since day 1, [2]H/L of bar",1,2,
1);
{ Selected date signal }
start:=Year()>sy
OR (Year()=sy AND (Month()>sm
OR Month()=sm AND DayOfMonth()>=sd));
d1:=start AND Alert(start=0,2);
{ Custom plot }
pv:=MP()*Cum(V);
denom:=If(Cum(V)-ValueWhen(1,d1,V)=0,1,
Cum(V)-ValueWhen(1,d1,V));
plot:=If(BarsSince(d1),(pv)/denom,MP());
{ Upper/Lower bands }
Hi:=HighestSince(1,d1,H);
Lo:=LowestSince(1,d1,L);
range:=If(type=1,(Hi-Lo)/2,(H-L)/2);
UpperBand:=plot+range;
LowerBand:=plot-range;
{ Plot on price chart }
UpperBand;LowerBand;plot
---8<---------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "chorlton_c_hardy"
<micro_dot_uk@xxx> wrote:
>
>
> Hi All,
>
> I'm having a few problems trying to modify an existing indicator and
> would very much welcome any help in solving it.
>
> I currently have the following indicator which plots a line on the
> price chart:
>
> sm:=Input("Starting Month (Month must exist in
> chart)",1,12,1);
> sd:=Input("Starting Day of Month (Day must exist in chart)",1,31,1);
> sy:=Input("Starting Year",1980,2100,2000);
> d1:= sd=DayOfMonth() AND sm=Month() AND sy=Year();
> pv:=MP()*Cum(V);
> denom:=If(Cum(V)-ValueWhen(1,d1,V)=0,1,Cum(V)-ValueWhen(1,d1,V));
>
> If(BarsSince(d1),(pv)/denom, MP())
>
>
> What I would like to do is add 2 further lines which will act as an
> UPPER and a LOWER band.
>
> The Upper band should be the value of the above indicator PLUS the
> difference between the HIGH & LOW for the same period divided by 2.
> (ie. Value for above indicator + (HIGH-LOW)/2
>
> The Lower band should be similar to the above but instead of adding
> the (HIGH-LOW)/2 it should be deducted.
>
> I hope this makes sense :-/
>
> Any help much appreciated........
>
> Many Thanks,
>
> Chorlton
------------------------ Yahoo! Groups Sponsor --------------------~-->
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/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/
|