Please help, need to use a command to activate a Chart Windows

I want to be able to automate a script using AmiBroker Object Model, not AFL, that I wish to run on a periodical basis, say, every 15-minute. I am using Interactive Broker. So far, I am just experimenting it in a very primitive way because I am learning how to code in AOM. With Interactive Broker, I also need to find a way to refresh the stock symbols in an interval that is less than 15 minutes, so that when my main analysis script runs every 15-minute, hopefully the symbols will be refreshed.
Script 1 in the analysis window is as follows.

AB = new ActiveXObject( "Broker.Application" ); //creates AmiBroker object

var i = 0;

try 
{ 
     NewA = AB.AnalysisDocs.Open( "C:\\11\\summary 15.apx" ); //opens previously saved analysis project file 
     // NewA represents the instance of New Analysis document/window 

     if (NewA ) 
     { 
          while (i < 10) {
          		NewA.Run( 1 ); //start  Exploration asynchronously
          		i = i + 1;
          		WScript.Sleep( 1000 * 60 ); // 2 seconds delay
        	}
      } 
} 
catch ( err ) 
{ 
      WScript.echo( "Exception: " +err.message ); // display error that may occur
}

As for refreshing the stock symbols, I use:

iWatchList = 0; /* you can define watch list number here */

AB = new ActiveXObject( "Broker.Application" );
Qty = AB.Stocks.Count;

var k = 0;

while (k < 10) {   // I realize this is laughable, but I am just experimenting it in a very primitive way

		for ( i = 0; i < Qty; i++ )
		{
		    Stk = AB.Stocks( i );
		
		    if ( iWatchList < 32 )
		    {
		        if ( Stk.WatchListBits & ( 1 << iWatchList ) )
		        {
		            AB.ActiveDocument.Name = Stk.Ticker;
		            AW = AB.ActiveWindow;
		            AW.ZoomToRange( "2010-01-01", "2011-01-01" );
		            WScript.Sleep( 2000 ); // 2 seconds delay
		        }
		    }
		    else
		    {
		        if ( Stk.WatchListBits2 & ( 1 << ( iWatchList - 32 ) ) )
		        {
		            AB.ActiveDocument.Name = Stk.Ticker;
		            AW = AB.ActiveWindow;
		            AW.ZoomToRange( "2010-01-01", "2011-01-01" );
		            WScript.Sleep( 2000 ); // 2 seconds delay
		        }
		    }
		}

k = k + 1;
WScript.Sleep( 1000 * 60 ); // 2 seconds delay

}

I want to combine the 2 scripts so that in the analysis script I want to issue a command that will Activate() the chart window programmatically after the analysis script is finished running. I know there are some windows methods and the item property available, but I can't seem to make it to work, please help. Thanks. https://www.amibroker.com/guide/objects.html

Why don't you just add the symbols to the realtime quote window and then select "Backfill all realtime quote window symbols" from the plugin menu? Once backfilled, they will stay updated as long as you don't exceed the number of symbols that you are allowed simultaneously which is 100 unless you subscribe to more.

Hi PeterD, thanks for the reply. I have more than 100, so I do need to know how to get the Windows.item property in the Amibroker Object Model to work, this is because my Amibroker Object Model script is switching back and forth between the analysis portion and the Chart window portion. If I just left it in the Chart window, then the script will continue to update the symbols for as long as I set the loop to be. But I also need to refresh the analysis Explorer window as well, again, if I just left it in the Exploration view, then the script will again, loop as many times as I set it to be. But I don't want to manually flipping back and forth between analysis view and chart view, so I wanted to write a command that will enable me to do that. I think that has to do with issuing a command such as Windows.item(1) or something like that. Thanks

You can't use more than 100 symbols with Interactive Brokers UNLESS you pay them for extra symbols. Exceeding number of symbols is against their rules and if you violate that they may block your account. Also trying to circumvent symbol limit with IB won't work because their backfill is super slow and limited to one request at a time. This forum can NOT be used for circumvention of account limits. If you need more symbols play by the rules. For example IQFeed has accounts that allows 500 or even 1300 symbols. Closing thread.