[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Windows.Add(), NewWindow.Close()



PureBytes Links

Trading Reference Links

Just a cupla ideas:
 
I use templates to load all of the charts for a particular chart viewing session.
 
If you want to make sure that all charts are closed before you start work you can step the windows and close them right before you run your script.
 
If its something else you want to do just ask.
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Joe Landry
Sent: Wednesday, June 20, 2007 8:21 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Windows.Add(), NewWindow.Close()

Hi Dingo.. thanks for responding. 
What I'm trying to do is manage the number of charts that show up each time I launch a "daily"  job.
(using old timey terms like job, and job steps, but I'm sure you'll understand them)  
 
As I was reading your response and framing out my answer, I see a few things I could try to check out,  
to see what's happening, but I thought I'd go ahead, thank you, and show you the original script that caused the issues.
For example I start each step as noted below, by making sure the current issue has a long history,
so I load the  Russell 2000 index before running group average ATCs.  At the end of the job (say with 4 job steps)
I end up with 4 "windows" usually without the correct window or layout in view. 
If the script line 7   ABD.Open(ticker); causes a new window to open.  Would the complementary method Close() work? 
Well I haven't tested it out and I'm going to in a short while. 
 
Best regards,
 Joe
 
/* setup filters */
/* SCAN over symbols in the default watchlist built by step above WL #62*/
AA.ClearFilters();
// load a ticker with a long history
var ABD = AB.Documents;
var ticker = "!RUT";
    ABD.Open(ticker);   // Point to !RUT -  QP3 ticker name
    Open_Ticker = AB.ActiveDocument.Name;
//    WScript.Echo ("Current Stock = " + Open_Ticker );
 
/* set apply to and range */
AA.ApplyTo =                           2;    // use filters  0 all symbols, 1 current symbol, 2 use filter
AA.Filter(0,"watchlist")  =      62;
AA.RangeMode             =        1; // use n last quotations
AA.RangeN                    =    512; // for two years
/* run SCAN */
AA.scan();
 
 WScript.Echo("Industry Group Files written to default folder");
 
 /* load formula from external file */
if(AA.LoadFormula("C:\\program files\\amibroker\\afl\\WeeklyJobs\\SSGROUPAVG.afl"))
 {
oWSH.popup("Industry Groups Averages Loaded Successfully",1,"Status",64);
 }
 
----- Original Message -----
From: dingo
Sent: Tuesday, June 19, 2007 7:32 PM
Subject: RE: [amibroker] Windows.Add(), NewWindow.Close()

Joe,
 
the script appears to be adding 2 windows and closing 1. So each time you run it you get one more window...??
 
The code you're using from 4.83 was just to show you how you could use some new properties and methods. I doesn't do any management at all.  I don't understand what you are trying to do.
 
d


From: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Joe Landry
Sent: Tuesday, June 19, 2007 6:05 PM
To: amibroker@xxxxxxxxxps.com
Subject: [amibroker] Windows.Add(), NewWindow.Close()

Hello:
I'd like to be able to manage the number of charts that appear, seemingly out of nowhere, as a run a multi step script;
so along those lines,  I thought I'd explore the attached script that was introduced with 4.83.
However when I run this I get a large number of DocsQty on the order of 17, and I can't reason out why this is so high.   How are those documents associated with the default window that I'm using?
And when I add and close a window I don't see the evidence of this. Like nothing changes.
  
I'm missing something fundamental here and wondering if someone would help me?
 
Thanks in advance
Joe L.
 
 
outBuffer = ""; // global output string buffer
 
function output( string )
{
   outBuffer = outBuffer + string + "\n";
}
 
AB = new ActiveXObject( "Broker.Application");
 
Docs = AB.Documents;
DocsQty = Docs.Count;
 
WScript.echo("Num of Docs = "+ DocsQty );
for( i = 0; i < DocsQty; i++ )
{
   Doc = Docs( i );
   output( "Document " + i + " name : " + Doc.Name );
   Windows = Doc.Windows;
   WinsQty = Windows.Count;
 
   for( j = 0; j < WinsQty; j++ )
   {
     Win = Windows( j );
       output( "  Window " + j + " Selected tab " + Win.SelectedTab );
   }
}
 
WScript.echo( outBuffer );
WScript.echo( "Now will add one window" );
Doc = Docs( 0);
Windows = Doc.Windows;
NewWindow = Windows.Add();
WScript.echo( "Now will add another window" );
NewWindow = Windows.Add();
WScript.echo( "and close it" );
NewWindow.Close();
 
 

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___