PureBytes Links
Trading Reference Links
|
Henry:
William's code is correct and the simplest. Another way to do it, although
not exactly what you asked for but similar, is this:
//first create a 5-day (or x-day) moving average of ADX(14), then create a
condition where the ADX is less than the 5-day or x-day ma.
ADXAv=ma(ADX(14),5)<=20; //you can also use ema rather than ma
Buy = Cond3 AND ADX(14)<ADXAv;
Have fun.
Al V.
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
<A title=williampeters@xxxxxxxxxxxx
href="">William Peters
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, August 31, 2003 3:10
PM
Subject: RE: [amibroker] Help with
formula
Hello
Henry,
This is one way to do it,
just add the formula to your conditions..
/* Created
using PowerScan. Date: 31
Aug 2003The ADX for the previous 5 bars has been above 20
*/Buy = BarsSince( <FONT
color=#0000ff>ADX( 14 ) <= <FONT
color=#ff00ff>20 ) >= <FONT
color=#ff00ff>5;
Regards,William Peters<A
href="">www.amitools.com
<FONT face=Tahoma
size=2>-----Original Message-----From: Henry Chau
[mailto:henry_chau@xxxxxxxxxxxxxxx]Sent: August 31, 2003 7:47
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker]
Help with formula
Hi guys,
For the following buy search what code do i need
to add if I want the ADX(14) to be less than 20 for the last x days
?
Cond1=PDI<FONT color=#000000
size=1>(14<FONT color=#000000
size=1>)>MDI<FONT color=#000000
size=1>(14<FONT color=#000000
size=1>);
Cond2=Cross<FONT color=#000000
size=1>(ADX<FONT color=#000000
size=1>(14<FONT color=#000000
size=1>),MDI<FONT color=#000000
size=1>(14<FONT color=#000000
size=1>));
Cond3=Cond1 AND Cond2;
Filter=cond3;
AddColumn(cond3,<FONT
color=#ff00ff size=1>"My Test");
Buy=Cond3;
Cheers
HenrySend BUG
REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|