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

[amibroker] Problem with AA.filter in JS



PureBytes Links

Trading Reference Links

Hello,

Could someone please spot what I am doing wrong with AA.filter, here
is a small javascript that is supposed to run an optimization over a
watchlist, it does not work (nothing happens) although when the filter
is set on the market, group or current ticker, it is working fine .. 

I really can figure out what's going on, many thanks for the help ! 

Nicolas


AFL_FileName= "C:\\Program
Files\\AmiBroker\\Formulas\\Custom\\test.afl"; // file exists ..
var AB, AA; 
AB = new ActiveXObject("Broker.Application");
AA = AB.Analysis;
AA.RangeMode=0; // all quotations
AA.ClearFilters();
AA.Filter(0,"watchlist") = 0; // nothing happens although the list has
 been populated
//AA.Filter(0,"market") = 0;  // works fine
//AA.Filter(0,"group")=255;  // works fine
AA.ApplyTo = 2;  // use filter

if(AA.LoadFormula(AFL_FileName)) {
	AA.Optimize(1);	
	AA.Export("c:\\temp\\export.csv");
}


and here is the AFL file, but the problem arises similarly with any other:
// test.afl
fast = Optimize("fast",12,10,12,1);
slow = Optimize("slow",20,19,21,1);
Buy = Cross(MACD(fast,slow),Signal(fast,slow));
Sell = Cross(Signal(fast,slow),MACD(fast,slow));

 

  



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.0/557 - Release Date: 11/29/2006 4:15 PM