PureBytes Links
Trading Reference Links
|
Steve
Play with this exercise and adjust the Alert extensions to get a good idea of the timing
relationships within your code. The first thing you'll notice is that an Alert extension of 1 is no
extension at all, and a parameter of 2 only extends a true by 1 bar.
Writing your EMA's as follows clearly shows that it is the same EMA displaced by zero, 1 and 2 bars
(not quite so obvious to me the way you've written but still perfectly legitimate assuming your
intension was for the same displacements).
Mov(C,20,E);
Ref(Mov(C,20,E),-1);
Ref(Mov(C,20,E),-2);
{exercise}
A1:=Input("First Alert Extension" ,1,15,1);
A2:=Input("Second Alert Extension",1,15,1);
A3:=Input("Third Alert Extension" ,1,15,1);
A4:=Input("Fourth Alert Extension",1,15,1);
L0:=L;
L1:=Ref(L,-1);
L2:=Ref(L,-2);
EMA0:=Mov(C,20,E);
EMA1:=Mov(Ref(C,-1),20,E);
EMA2:=Mov(Ref(C,-2),20,E);
Alert(L0>EMA0,A1)+3.3;
Alert(L1>EMA1,A2)+2.2;
Alert(L2<EMA2,A3)+1.1;
Alert(L0>EMA0 AND L1>EMA1 AND L2<EMA2,A4);
> I have a formula as shown below
> L0:=L;
> L1:=Ref(L,-1);
> L2:=Ref(L,-1);
> EMA0:=Mov(C,20,e);
> EMA01=Mov(Ref(C,-1),20,e);
> EMA2:=Mov(Ref(c,-2),20,e);
> L0>EMA0 And L1>EMA1 AND L2<EMA2
>
> What I want to do is find out when this has happened in say the last
> 5, 10 or maybe 15 days.
>
> The syntax for the alert function is alert( EXPRESSION, PERIODS )
>
> My question is if I use L0>EMA0 And L1>EMA1 AND L2<EMA2 as the
> EXPRESSION does that then adjust each of the values so that the
> expression will evaluate correctly.
The "expression" in Alert will be treated as a whole, not as individual componets. I hope the
exercise helps.
Roy
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|