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

RE: [amibroker] Re: Batching AFL files



PureBytes Links

Trading Reference Links

Dave,

 

Here’s a script that I use.   Modify to taste and save to a file with the extension “.js” in the Amibroker\Scripts folder.  

 

You can call the script from the tools menu.  Add it from “Tools à Customize à Tools”.

 

Or, you can schedule this to run whenever you want.  I have a combo of command files and Jscript files that close AB if open, downloads the daily Quotes Plus data, reopens AB and then executes the script below.  This is scheduled to run at 4:45 pm every day.  So, when I get home from work, my fresh daily data is waiting for me.

 

Regards,

 

Dan.

 

 

 

/* create AB object */

AB = new ActiveXObject("Broker.Application");

 

/* retrieve automatic analysis object */

AA = AB.Analysis;

 

/* load formula from external file */

AA.LoadFormula("C:\\Program Files\\AmiBroker\\Formulas\\Systems_DailyScans\\A_QPAddCompositeIndexes7.afl")

 

/* setup filters */

AA.ClearFilters();

 

/* set apply to and range */

AA.ApplyTo = 0; // use all symbols

AA.RangeMode = 0; // all quotes

 

/* run Scan */

AA.Scan();

 

 

//Now B_QPAddIndexRelativeStrength.afl

/* create AB object */

AB = new ActiveXObject("Broker.Application");

 

/* retrieve automatic analysis object */

AA = AB.Analysis;

 

/* load formula from external file */

AA.LoadFormula("C:\\Program Files\\AmiBroker\\Formulas\\Systems_DailyScans\\B_QPAddIndexRelativeStrength.afl")

 

/* setup filters */

/* backtest over symbols present in market 0 only (zero-based number) */

AA.ClearFilters();

AA.Filter( 0, "watchlist" ) = 49;

 

/* set apply to and range */

AA.ApplyTo = 2; // use filters

AA.RangeMode = 2; // use last day's quotes

AA.RangeN = 1;

 

/* run backtest and display report */

AA.Scan();

 

 

//Now C_QPAddIndexRank.afl

/* create AB object */

AB = new ActiveXObject("Broker.Application");

 

/* retrieve automatic analysis object */

AA = AB.Analysis;

 

/* load formula from external file */

AA.LoadFormula("C:\\Program Files\\AmiBroker\\Formulas\\Systems_DailyScans\\C_QPAddIndexRank.afl")

 

/* setup filters */

/* backtest over symbols present in market 0 only (zero-based number) */

AA.ClearFilters();

AA.Filter( 0, "watchlist" ) = 48;

 

/* set apply to and range */

AA.ApplyTo = 2; // use filters

AA.RangeMode = 2; // use last day's quotes

AA.RangeN = 1;

 

/* run backtest and display report */

AA.Scan();

 

 

//Now G_CMFAndOBVToPriceLRDvrg_WLongTrend.afl

/* create AB object */

AB = new ActiveXObject("Broker.Application");

 

/* retrieve automatic analysis object */

AA = AB.Analysis;

 

/* load formula from external file */

AA.LoadFormula("C:\\Program Files\\AmiBroker\\Formulas\\Systems_DailyScans\\G_CMFAndOBVToPriceLRDvrg_WLongTrend.afl")

 

/* setup filters */

/* backtest over symbols present in market 0 only (zero-based number) */

AA.ClearFilters();

AA.Filter( 0, "watchlist" ) = 1;

 

/* set apply to and range */

AA.ApplyTo = 2; // use filters

AA.RangeMode = 2; // use last day's quotes

AA.RangeN = 1;

 

/* run backtest and display report */

AA.Explore();

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of dmcleod1981
Sent: Sunday, November 27, 2005 12:27 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Batching AFL files

 

Steve & Perry,

Thank you for pointing out those two solutions. I should have been
able to at least have remembered "Batman"!

Thanks again for the help.

DM = Dave 

--- In amibroker@xxxxxxxxxxxxxxx, "Perry Lentine" <lentino@xxxx> wrote:
>
> DM,

> The third party program is Batman.zip.  It can be found in the files
section
> of AmiBroker TS group on yahoo at:
> http://finance.groups.yahoo.com/group/amibroker-ts/files/

> Additionally, I have been using the batchtest.js script written by
Tomasz
> which can be found in AmiBroker help contents.  Search for batchtest
and you
> should be able to find it at the bottom of the Automation Object
model page.
> I needed to make some minor modifications to make it work the way I
wanted.

> Perry Lentine
>
>   _____ 
>
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On Behalf
> Of Dave McLeod
> Sent: Sunday, November 27, 2005 10:55 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Batching AFL files
>
>
> Is it possible to run consecutive or multiple AFL files? I thought I
saw a
> post about a third party batch program but I seem to be inept in
finding it.
> What I am trying to do is run some composites then use those values in
> another AFL routine and was looking to find a way to automate it
somewhat.
>
> Thanks,
> DM
>
>
>
>   _____ 
>
> Yahoo!
>
<http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.c
> om/unlimited/> Music Unlimited - Access over 1 million songs. Try it
free.
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
>
>
>
>   _____ 
>
> YAHOO! GROUPS LINKS
>
>
>      
> *      Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker> " on the web.
>  
>
> *      To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>  
>
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
>   _____
>







Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS