Batch - Changing Watchlist Filter


#1

I run the same analysis (Analysis1) against several different watchlists (SP500, DJUS, etc). The process is to change the filter to SP500, run Analysis1… then change the filter to DJUS run Analysis1… etc.

I was looking to automate this with the new batch features in Amibroker. I read you can change the symbol in batch mode but don’t see a way to change a watchlist.

I know I can create .apx files for each analysis (.apx for SP500 , .apx for DJUS) but if I make a change to Analysis1, I have to create new .apx files for each variation. Is there a way to change the watchlist filter using the same analysis .apx in batch mode?

I have tried Using Filter = InWatchListName(SP500) before in other AFL Analysis and it’s too slow. Don’t know why setting the filter by hand in the filter settings window is faster than using InwatchListName but it is.

In summary, looking for a way to set a watchlist (like it was selected in the filter settings window) in batch mode.

Thanks Sweetleaf


#2

Watch list filter (and all other settings) is part of Analysis PROJECT FILE. So just save PROJECT FILE (.APX extension) with correct watch list selected. Then in Batch just use LoadProject and EVERYTHING including watch list would be set properly.
http://www.amibroker.com/guide/h_newanalysis.html


#3

Thanks for the reply

I’m trying to find a way to change the watch list in batch mode against the same Project File(.APX). For example, instead of “Set Current Symbol” for a batch command having a “Set Current Watch List”. I know a “Set Current Watch List” does not exist but the following illustrates what I trying to accomplish.

Set Current Watch List SP500
Load Project c:\Sweetleaf.apx
Backtest
Set Current Watch List DJUS
Load Project c:\Sweetleaf.apx (same apx)
Backtest
Set Current Watch List Russell 2000
Load Project c:\Sweetleaf.apx (same apx)

Is there some way to do this?

Thanks, Sweetleaf


#4

Why? Why on earth you are trying to do something that is AGAINST the design?
Just do what I told you instead of inventing your weird ways of doing things backwards

In your car you are sitting in rear row backward to the wheel and trying to steer with your feet?


#5

Thanks again for your reply. I appreciate your time on this forum. If I understand your post, the only way to change the watchlist is to save a new .apx . The watchlist can not be changed on the fly in batch.

Example:

Load Project c:\SP500.apx (has SP500 saved as watchlist )
Backtest

Load Project c:\DJUS.apx (has DJUS saved as watchlist)
Backtest

Load Project c:\Russell2000.apx (has Russell2000 saved as watchlist)
Backtest


#6

Just a small query, I need to work on “From-To dates” within the apx file wherein the From-To dates change everyday e.g. 1) On 13.11.2017 I need to have dates between 06.11.2017 to 10.11.2017, while on 14.11.2017 it should be between 07.11.2017 to 13.11.2017
2) The From-To dates automatically align to last traded date i.e. say 13.11.2017 to 13.11.2017 on last traded date 13.11.2017 & 14.11.2017 to 14.11.2017 on last traded date 14.11.2017