Is there a way to set the ApplyTo option in explore using AFL?

I have developed a trading system, in it I would like to click the Backtest button to display various reports. If it is a summary report, I would set SetOption("PortfolioReportMode", 2); if it is a Trade list report, I would set SetOption("PortfolioReportMode", 0); But I also want to set the ApplyTo drop box to either All symbols or Current using AFL, not by clicking the drop box. I noticed there is a GetOption ("ApplyTo"); but there isn't a SetOption("ApplyTo", 0); My question is: is there a way to set the ApplyTo option using AFL? Thanks

switch(TradeType) { 
			case "Default":
						break;
			case "Scan":
						SetOption("PortfolioReportMode", 0);
						// other AFL code here ...
						break;

			case "Summary":
						SetOption("PortfolioReportMode", 2);
						// other AFL code here ...
						break;

			case "Trade":
						SetOption("PortfolioReportMode", 0);
						// other AFL code here ...
						break;
}

No, because it is too late. When AFL is running ApplyTo must be known. You can however just use APX (Analysis project) file - it stores everything, including ApplyTo settings and can be automatically loaded and run from batch.

1 Like