I am not a programmer have some programming background. I have stiched around a the following cscript by googling and through this forum. I read that it is not adviceable to use com script, so want to convert this script to afl please let me know
Thanks and Regards
Mubariz
//iWatchList = 66;
AB = new ActiveXObject("Broker.Application"); //AB.loadLayout ( "C:\Program Files (x86)\AmiBroker\Layouts\Activate.awl");
//docs = AB.Documents();
//doc = docs( 0 ); //doc.Activate();
AW = AB.ActiveWindow;
stks = AB.Stocks;
Qty = AB.Stocks.Count;
for ( i = 0; i < Qty; i++ )
{
Stk = AB.Stocks( i );
Anyway, it is perfectly fine to use OLE for this kind of things (mainly creating a slideshow of all tickers in a specific watchlist).
On the other hand, if you want a slideshow using AFL you could start looking at this code originally posted by Herman van den Bergen in the old Yahoo group and try to modify it as per your needs:
Thanks for the reply. This was my first posting and dint know how to paste the script. Will do it in future. I see there is a clear help window in the right side i dint observer.
But the issue with OLE is when i close AB there is background process keep running which doesnt gets killed/closed. Due to this when i reopen AB, my feed provider thinks its a second login and doesnt allow me to connect.
Background task of AB is still active and consume memory and cpu
@mahmed4 I tested the script on my machine, and it works well (no Broker.exe is left when the slideshow is completed, and the script is automatically terminated).
I also tried to close manually AmiBroker while running the slideshow: I got a jscript error dialog but closing it also terminated the Broker.exe process.
So I cannot further help on this issue. Sorry.
In any case, take some time to explore the AFL code I suggested!