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

RE: [amibroker] Re: Batching AFL files - Dan Clark



PureBytes Links

Trading Reference Links

Ara,

 

Hi.   I’ve been “entangled” with day-trading at one point.   I was very bad at it.   Now I’m a swing trader.   

 

Regarding the QP download code, it’s very straight-forward.   To keep it simple, I’ve pasted the code below and the file names.  Just save each chunk of code to the appropriate file name in the  ..\Amibroker\Scripts\ folder.  Change paths as appropriate.   Then execute LoadQPDataAndRunScans.cmd from the command line or schedule it with Windows Scheduler (which is what I do).    

 

This will Close AB, download QP data, run AB, and execute the Jscript file to run my daily scans.  You can use all or part of them.  Note that closing AB is critical, because AB will interfere with QP database compacting.   Also, I’m using simple command files to reduce complexity. 

 

Best regards,

 

Dan.

 

 

>> Save to “LoadQPDataAndRunScans.cmd”

@Rem Close AB, if open

TaskKill /fi "Imagename eq Broker.exe" /IM Broker.exe

 

@Rem Sleep for a while to let AB save symbols

SLEEP 120

 

@Rem Start QuotesPlus Downloader

call RunQuotesPlusDownloader.cmd

 

@rem Sleep 10 minutes for downloaded data to process

SLEEP 600

 

@Rem Start AB:

Start RunAmiBroker.cmd

 

@rem Sleep for 30 seconds to let AB start

SLEEP 30

 

@Rem Call 1st Scan

cscript "c:\Program Files\AmiBroker\Scripts\ScanRun_ATCComposite.js"

 

exit

 

>> Save to “RunQuotesPlusDownloader.cmd”

@rem run Quotes Plus Downloader

"C:\Program Files\Quotes Plus\GetPasswd.exe"

 

>> Save to “RunAmiBroker.cmd”

@Rem Run AmiBroker

cd "C:\Program Files\AmiBroker"

 

@REM "C:\Program Files\AmiBroker\Broker.exe"

Broker.exe

 

exit

 

 

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Ara Kaloustian
Sent: Wednesday, February 15, 2006 11:07 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: Batching AFL files - Dan Clark

 

Hi Dan,

 

Would you mind sharing you QP download code?

 

On rel strength ... I have done very little since last correspondace due to entanglement with day trading ... just getting back to swing trading.

 

Thanks

 

Ara

 

----- Original Message -----

From: Dan Clark

Sent: Sunday, November 27, 2005 3:02 PM

Subject: RE: [amibroker] Re: Batching AFL files

 

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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS