Automating AFL Code Execution for Daily Analysis with Custom Parameters

#1
I run the AFL code every day in the 'Analysis' window. I manually set parameters and fields such as 'Parameters' entries, 'From' and 'To' dates, 'Periodicity' selection, and 'Watchlist' selection. I want to minimize the need for manual input and perform these operations using AFL coding. Can someone provide me with the AFL code that will give me the desired results when I run it?

Here are the manual operations that need to be hard-coded in the AFL code:
1. Go to the 'Analysis' window.
2. Set 'Apply to' as '*Filter' and choose 'StocksList' from the dropdown menu (my watchlist name).
3. Choose 'Range' as 'From-To dates'.
4. Set the 'From' date to be the Monday candle of the 4th week (if there is a holiday, choose the next day, Tuesday).
- for AFL code sake, number the very recent week as 1st week (the week which is complete and over); the prior week as 2nd...
5. Set the 'To' date to be the Friday candle of the 3rd week (if there is a holiday, choose the previous day, Thursday).
- for AFL code sake, number the very recent week as 1st week (the week which is complete and over); the prior week as 2nd...
6. In the 'Settings' window (from the 'Analysis' window), go to the 'General' tab and set the 'Periodicity' to 'Daily'.

These steps should be hard-coded in the AFL code. When I click 'Explore', the AFL code should run using the specified parameters (Steps 1 through 6) and display the results, overriding the default Windows settings.

I would greatly appreciate any assistance. Thank you.
 

Similar threads