|
This routine was written by someone on the
forum, possibly dingo.
Sure, you can step through a watchlist and save
the chart for every ticker, like this routine does,
by concatenating Stk.Ticker to png
Stk.Ticker+".png".
This is could be a well behaved routine but
without being careful I ended up with more
than one instance of AB running.
So, advice is to start clean, load AB with a chart display, then execute this script and
you should have a series of ticker png's stored
in the Amibroker root directory,
apa.png apc.png !rut.png.
iWatchList = 8; /* you can define watch list num
operations. ber here */
AB = new
ActiveXObject("Broker.Application"); Qty = AB.Stocks.Count;
for( i = 0; i < Qty; i++ ) { Stk =
AB.Stocks( i ); if( iWatchList < 32 ) { if( Stk.WatchListBits
& ( 1 << iWatchList ) ) { Doc =
AB.Documents.Open( Stk.Ticker ); WScript.Sleep( 4000 ); // 4
seconds delay AB.ActiveWindow.ExportImage(Stk.Ticker +
".png") Doc.Close(); } } else {
if( Stk.WatchListBits2 & ( 1 << ( iWatchList - 32 )) )
{ Doc = AB.Documents.Open( Stk.Ticker );
AB.ActiveWindow.ExportImage(Stk.Ticker + ".png") WScript.Sleep(
4000 ); // 4 seconds delay Doc.Close(); } }
}
----- Original Message -----
Sent: Tuesday, March 07, 2006 11:06
AM
Subject: Re: [amibroker] jScripts to
produce and save PNG plots.
Hello Joe,
Can the script be modified to save
the png with the name of the ticker instead of Test.png.
Thanks
Prashanth
----- Original Message -----
Sent: Tuesday, March 07, 2006 7:26
PM
Subject: Re: [amibroker] jScripts to
produce and save PNG plots.
For those of you bored with this trail,
sorry, hit delete. The method does save the image but still need
image size adjustments.
Apologize for not testing it first before
asking questions, but any help would be
appreciated/
AB.ActiveWindow.ExportImage("Test.png");
Best regards
JOE
Sent: Tuesday, March 07, 2006 7:28
AM
Subject: Re: [amibroker] jScripts to
produce and save PNG plots.
Hi Dingo - Before you say RTFM,
(;> I found your slide show script with what looks like to be all
the
elements of doing what I want, except to
save the image. I need to find the source of
the documentation
on the ActiveWindow object.
JOE
----- Original Message -----
Sent: Tuesday, March 07, 2006 7:04
AM
Subject: Re: [amibroker] jScripts
to produce and save PNG plots.
Ah! I found a clue to how I might be able to do
this. (it was in my own Infoselect database) but could use additional
help
in how to manage the image size if possible.
Best regards
Joe
Example script:
AB = new ActiveXObject("Broker.Application");
AB.ActiveWindow.ExportImage("Test.png");
----- Original Message -----
Sent: Tuesday, March 07, 2006
6:53 AM
Subject: [amibroker] jScripts to
produce and save PNG plots.
Hi Gents: (Fred, Dingo,
Dan)
I'd like to produce 5 plots
produced from 5 equity composites for a web
site.
I'm tracking "guru" stock
pickers on a web site and I'd
like to automate the production of the image
display of their record on a
weekly basis.
Being a real "code monkey", I know how to string batch steps using
jScript to produce these equity curves(ATCs),
but I'd like to automate
and produce, save the PNG images in order that I could post
them and display them on the web site.
I know this was discussed several
months ago when it came to controlling the shape/size of the png
image but I can't find the
discussion nor the object/method in
the COM model that will give me the
hooks to do this. (I promise, I
googled it on purebytes
and couldn't find it but maybe it's more recent than
that). Fred in IO is able to drive this
function
to produce the backtest version of the
equity plot, but my requirement is more simple than that.
I guess if the image had an Amibroker
watermark/attribution it would be all the better for the author and
community. (;>
Thanks in advance
JOE
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 other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
|