[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] AFL Plugin that allows AFL to interface with MS Excel



PureBytes Links

Trading Reference Links

Fristly thank you to all those who have helped in my developing 
understanding of AFL programming.

Secondly what is wrong with the logic of the following code:

Cond1=MA(C,15)>MA(C,150);
Cond2=BarsSince(Cross(C,MA(C,150)));
Buy=Cond1 AND Cond2<10;
Filter=Cond1 AND Cond2<10;
AddColumn(Cond2,"Cond2",1.2);

Simply I am attempting to discover stocks that have recently (in the 
last ten days) crossed above their 150 moving average and the 15 day 
moving average is currently above the 150 day moving average.

When I scan or filter I find some stocks that meet these criteria 
while others have been able their 150 MA for ages while reporting 0 
for Cond2.

What have I missed in terms of the logic? 

Regards and sincere thanks,

Graeme Oswin



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/