PureBytes Links
Trading Reference Links
|
Dr_K,
Try this,
Prd:=Input("Enter Periods",3,1000,25);
Pct:=Input("Enter Percentage",0.0001,100,0.25);
type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]
Wght",1,7,2);
x:=Input("Open=1 High=2 Low=3 Close=4 Volume=5 Median=6",1,6,4);
x:=If(x=1,OPEN,
If(x=2,HIGH,
If(x=3,LOW,
If(x=4,CLOSE,
If(x=5,VOLUME,MP()
)))));
A1:=If(type=1,Mov(x,Prd,E),
If(type=2,Mov(x,Prd,S),
If(type=3,Mov(x,Prd,T),
If(type=4,Mov(x,Prd,TRI),
If(type=5,Mov(x,Prd,VAR),
If(type=6,Mov(x,Prd,VOL),Mov(x,Prd,W)
))))));
B:=A1*Pct;
A3:=A1+B;{Sell}
A4:=A1-B;{Buy}
a3;a1;a4
hope this helps,
Preston
--- In equismetastock@xxxxxxxxxxxxxxx, DKMK <dr_khalidmasood@xxx>
wrote:
>
> Preston
>
> Thanks for your code. It works well, but it plots straight line
if I use different parameters. I am posting my code below, plz tell
where I have done a mistake:
>
> Prd:=Input("Enter Periods",3,1000,25);
> type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]
Wght",1,7,2);
> Pct:=Input("Enter Percentage",0.0001,100,0.25);
> x:=Input("Use Open=1 High=2 Low=3 Close=4 Volume=5 WC=6",1,6,4);
>
> A1:=Mov(C,Prd,S);
> B:=A1*Pct;
> A3:=A1+B;{Sell}
> A4:=A1-B;{Buy}
>
> a3;a1;a4
>
> My problem is that when I write "x" in place of "c" in line A1
and place "type" instead of "s" in line A1, it plots three straight
horizontal lines on graph. Please tell me where I done a mistake.
>
>
>
> pumrysh <no_reply@xxxxxxxxxxxxxxx> wrote:
> Dilawar,
>
> Try this:
>
> A:= mov(c,25,s);
> B:= A * .25;
> A+B;
> A-B;
>
> This is not going to be a horizontal line though because the MA
> value will change everyday. What you will have is a line above and
> below that will move just like the MA. If you want a horizontal of
> just the last MA plus or minus the percentages, try this:
>
> A:= Mov(C,25,S);
> B:= A * .25;
> LastValue(A+B);
> LastValue(A-B);
>
> Hope this helps,
>
> Preston
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "infantrader"
> <infantrader@> wrote:
> >
> > I want to draw a horizontal line above and below at some fixed
> > percentages on a moving average, but donot know how to write a
code
> > for that.
> >
> > mov(c,25,s) {+25% & -25% as a horizontal line}
> >
> > I hope some member will help. Thanks in advance.
> >
> > Dilawar
> >
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------
> Choose the right car based on your needs. Check out Yahoo! Autos
new Car Finder tool.
>
> [Non-text portions of this message have been removed]
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|