PureBytes Links
Trading Reference Links
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
If you meant 20 previous closes above the *current* MA,
- --8<--
period = 10;
nbars = 20;
aboveMA = LLV(C,nbars) > MA(C,period);
- --8<--
if you meant close has been above MA for 20 bars
- --8<--
period = 10;
nbars = 20;
aboveMA = sum(C>MA(C,period), nbars)==nbars;
- --8<--
Does this help?
Nigel
if you meant
On Thu, 12 Feb 2004 19:27, kk2628 wrote:
> Hi,
>
> I want to make sure all the previous 20 bars close are above a 10-day MA,
> currently I am using a lengthy method to code AFL and I appreciate if
> someone can share with me the shorter way to code.
>
> Lengthy way
> 10ma=ma(10,C);
> aboveMA = ref(C,-1)>10ma and ref(C,-2)>10ma and
> ref(C,-3)>10ma................
>
> Thanks
> KK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAK2Y+BbmcM2pfckkRAjDwAJwIE8qzLg8uDe7UYUvaQbYJaaRJ2QCfWIyO
Tv6cK34bF0C1O+TChjwfyjM=
=CIJQ
-----END PGP SIGNATURE-----
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|