Fanku
June 17, 2019, 2:44pm
#1
outputdrive = "d:\\temp\\";
saveimage = outputdrive;
var oAB = WScript.CreateObject("Broker.Application");
ADS = oAB.Documents;
ADS.Item(0).ActiveWindow.ExportImage( "D:\\TEMP\\BANKNIFTY.png", 1000, 560); // chart 1
ADS.Item(1).ActiveWindow.ExportImage( "D:\\TEMP\\NIFTY.png", 1000, 560); // chart 2
ADS.Item(2).ActiveWindow.ExportImage( "D:\\TEMP\\TATASTEEL.png", 1000, 560); //
If I want more chart then I need to add more lines to export chart.
And also I need to open chart on amibroker in same series.
Hence I want to add loop, So that all open charts will save as image by the name
of active Window name
Please help..
The above code is working fine in Javascript.
I want to run above codes for 35 script hence i want to use a loop.
In loop ADS.Item(no). and EXPORTIMAGE file name will be variable for 35 charts.
Anyone can tell me how to put above codes in a loop so that active charts will be saved in drive c:\temp
Tomasz
June 17, 2019, 2:59pm
#2
You should not create 35 charts for mere purpose of exporting chart from them.
Instead you should just use ONE chart window (active one) and change the symbol:
doc = oAB.ActiveDocument;
doc.Name = "NIFTY";
doc.ActiveWindow.ExportImage( ... );
doc.Name = "TATASTEEL";
doc.ActiveWindow.ExportImage( ... );
// and so on
Doing so consumes way less resources than opening 35 charts.
As far loops are considered there are plenty of examples how to loop over list of symbols. Use Google.
3 Likes
Dear @Tomasz
OPs Duplicate threads was previously locked where this has been discussed.
outputdrive = "d:\temp\";
saveimage = outputdrive;
var oAB = WScript.CreateObject("Broker.Application");
ADS = oAB.Documents;
// Do not exceed number of active chart tabs.
// So if there are 3 chart tabs then max. number of Items is three, (0) to (3)
ADS.Item(0).ActiveWindow.ExportImage( "D:\TEMP\BANKNIFTY.png", 1000, 560);
ADS.Item(1).ActiveWindow.ExportImage( "D:\TEMP\NIFTY.png", 1000, 560);
ADS.Item(2).ActiveWindow.ExportImage( "D:\TEMP\TATASTEEL.png", 1000, 560);
Above codes are wor…
I hv created watch list of 20 stocks,
And I quick_profit strategy saved in custom folder.
I want afl to run every 5 min and generate chart with quick_profit stratergy from watch list stocks and saved to C:\chart\ Folder.
On Amibroker screen only 2 charts are active of nifty and bank nifty.
Hence auto chart saving should happen in background mode and not active window.
Pls help me with Afl or provide me solution
this guy is like a serial offender
Fanku
June 17, 2019, 4:51pm
#4
I am not good in javascript can u pls share full code.. It will be useful to everyone..
I I tried with loop but loop is not selecting next window.
Humble request please share codes here.
Thank you in advance.