TJ,

Thanks, that certainly helps.

However, I'm not clear on what file extension is the appropriate one to use for 
this universal template (with AB 5.30).

Previous docs (e.g. AmiBroker Change Log) are like so:

AB = new ActiveXObject("Broker.Application");
AW = AB.ActiveWindow;
AW.SaveTemplate("Test.abt");
AW.LoadTemplate("Test.abt");

-----------------

AB = new ActiveXObject("Broker.Application");
AB.LoadLayout("C:\\Program Files\\AmiBroker\\Data\\Layouts\\Default.awl");

But I see no .abt or .awl files in my installation, only .ALY and .Chart files.

Should I be somehow creating .abt and .awl files?

Are those formats current?

Should I expect these calls to work instead?:

AB = new ActiveXObject("Broker.Application");
AW = AB.ActiveWindow;
AW.SaveTemplate("Test.chart");
AW.LoadTemplate("Test.chart");

-----------------

AB = new ActiveXObject("Broker.Application");
AB.LoadLayout("C:\\Program Files\\AmiBroker\\Data\\Layouts\\Default.aly");


In the 5.30 User's Guide, Files and directories used by AmiBroker contains no 
reference to .chart or .aly files, yet those are the files I have tons of and 
use all the time.   Nor are .act files mentioned.

Could you kindly clarify this situation for me?





--- In [email protected], Tomasz Janeczko <gro...@...> wrote:
>
>   Hello,
> 
> Technically there is no OLE method to "apply the indicator" but...
> you can create an universal template that will have a pane with the following 
> single-liner formula:
> 
> #include "generated_code.afl"
> 
> and your program will:
> a) create a file called "generated_code.afl"
> and then
> b) issue OLE command to open template described above
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> On 2010-07-15 14:01, Progster wrote:
> > Hi.
> >
> > I thought that supplying a runnable script that only needed a missing bit 
> > added at an identified point would be most helpful way to ask about this 
> > subject.
> >
> > However, since no one has even so much as said "Yes, that can be done.", 
> > I'm starting to wonder if it can be done at all, and I'm also wondering if 
> > supplying a script made my question seem more complicated to read and reply 
> > to than intended.
> >
> > So, script aside, I will try to re-ask this question in the simplest form I 
> > can come up with:
> >
> > Is it possible using the AB object model to:
> >
> > a.   Open AB, open a chart, apply an AFL, SEE THE CHART WITH YOUR AFL 
> > APPLIED, then dismiss and quit.
> >
> > or
> >
> > b.   Open AB, load a template, SEE THE TEMPLATE DISPLAYED, then dismiss and 
> > quit.
> >
> >
> > Responses that would be helpful to me at this point include:
> >
> > 1.  I wanted to do that too, but I wasn't able to make it happen.  :-(
> > 2.  I've done that.  It can be done.  Keep at it.  Good luck!  :-P
> > 3.  I've done that, here's how ...  :-)
> > 4.  Are you blind?  Exactly how to do it (with a working example!) is right 
> > here in the docs:<   link>      :-[
> >
> > Load, display, dismiss - that should be all I need ...
> >
> > - Progster
> >
> >
> > On 7/9/2010 11:25 AM, Progster wrote:
> >> [Attachment(s)<#TopText>  from Progster included below]
> >>
> >> Hi.
> >>
> >> Using OLE/jscript, I would like to do the following:
> >>
> >> 1. Start AB
> >> 2. Choose a database
> >>
> >> In a loop across multiple symbols (symbol names known in advance):
> >>
> >> 3a. Open a chart and apply an AFL
> >>
> >> or
> >>
> >> 3b. Open a saved layout that has a given AFL applied
> >>
> >> 4. Quit AB
> >>
> >> I've done a good amount of both Googling and experimenting, but I
> >> haven't hit on the right sequence yet to accomplish this.
> >>
> >> It is only step 3 that I'm having a problem with. My problem is not
> >> executing the loop. That seems fine.
> >>
> >> However, nothing I have found or tried opens/loads a chart and
> >> applies/runs an AFL.
> >>
> >> Below is skeleton code that runs.
> >>
> >> If someone is able to be so kind as to fill in the missing bit, I'd
> >> really appreciate it. If there's more than one way to do it,
> >> alternative solutions are very welcome.
> >>
> >> Thanks.
> >>
> >> ---
> >>
> >> /*
> >> LoopDemo_01.js
> >>
> >> _01 201007089 Initial "empty" skeleton by Progster
> >>
> >> It is recommended to run this file in a command window, like so:
> >>
> >>> cscript LoopDemo_01.js
> >> Lines commented with // *** will need to be edited to reflect
> >> the local environment
> >>
> >> Goals:
> >>
> >> 1. Start AB
> >> 2. Choose a database
> >>
> >> In a loop across multiple symbols (symbol names known in advance):
> >>
> >> 3a. Open a chart and apply an AFL
> >> or
> >> 3b. Open a saved layout that has a given AFL applied
> >>
> >> 4. Quit AB
> >>
> >> */
> >>
> >> function pausecomp(millis)
> >> {
> >> var date = new Date();
> >> var curDate = null;
> >>
> >> do { curDate = new Date(); }
> >> while(curDate-date<  millis);
> >> }
> >>
> >> // General paths and setup definitions
> >> Settings_Directory = "C:\\Amibroker_Formula_Root\\"; // ***
> >> SettingsFileName = "Futures_01.ABS"; // ***
> >>
> >> Layout_Directory = "C:\\AmiBroker_Data\\US-PremiumData\\Layouts\\"
> >> // ***
> >> LayoutFileName = "MyLayout.ALY"; // ***
> >>
> >> SettingsFile = Settings_Directory + SettingsFileName;
> >> WScript.Echo( "SettingsFile: " + SettingsFile );
> >>
> >> LayoutFile = Layout_Directory + LayoutFileName;
> >> WScript.Echo( "LayoutFile: " + LayoutFile );
> >>
> >> AFL_Directory = "C:\\Amibroker_Formula_Root\\Custom\\"; // ***
> >>
> >> // Create AmiBroker object
> >> AB = new ActiveXObject("Broker.Application");
> >>
> >> // Load Database
> >> AB.LoadDatabase("C:\\Amibroker_Data\\US-PremiumData"); // ***
> >>
> >> // Test of changing symbols // ***
> >> var symbols = new Array(4);
> >> symbols[0] = "$SPX" ;
> >> symbols[1] = "GOOG" ;
> >> symbols[2] = "AAPL" ;
> >> symbols[3] = "SPY" ;
> >> // symbols[] = "" ;
> >>
> >> for (idx = 0; idx<= 3; idx++)
> >> {
> >> next_symbol = symbols[idx];
> >> WScript.Echo( "Working on: " + next_symbol);
> >>
> >> // Aim is to load a chart here, and load code (which will run
> >> and generate the desired result)
> >>
> >> ChartFileName = "My_Chart_File.afl"; // ***
> >> ChartFile = AFL_Directory + ChartFileName;
> >> WScript.Echo(ChartFile);
> >>
> >> pausecomp( 1000 ) ;
> >> }
> >>
> >> AB.SaveDatabase();
> >> AB.RefreshAll();
> >>
> >> pausecomp( 1000 ) ;
> >>
> >> WScript.Echo("Closing AmiBroker");
> >> AB.Quit();
> >>
> >> WScript.Echo("Pipeline is Done.");
> >>
> >>
> >
> > ------------------------------------
> >
> > **** IMPORTANT PLEASE READ ****
> > This group is for the discussion between users only.
> > This is *NOT* technical support channel.
> >
> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > http://www.amibroker.com/feedback/
> > (submissions sent via other channels won't be considered)
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>


Reply via email to