Auto Capture Image... some help required

#1
Hi
I'm trying to live stream my ami chart online so that I can use it else...

so when I capture the image with the below code- MANUALLY it works!
Code:
Capture = ParamTrigger("Capture", "Click");
if ( Capture )
ShellExecute("E:\\AutoExportChart\\AutoExportChart.js","","");
but when I try to capture images automatically then I get a windows host error... some one please help me auto capture the images....

this is what I tried....
Code:
_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
    Time 		= Now( 4 );
    Seconds 	= int( Time % 100 );
    Minutes 	= int( Time / 100 % 100 );
    Hours 	= int( Time / 10000 % 100 );
    SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
    return SecondNum;
}
 
RequestTimedRefresh( 1 );
TimeFrame=15;
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft	 = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo	 = TimeFrame - SecsLeft;
 
if ( NewPeriod )
{
ShellExecute("E:\\AutoExportChart\\AutoExportChart.js","","");
}
or is there any other means thru which I can live stream my chart online?
 

KelvinHand

Well-Known Member
#4
This is really a good thread...don't know who will help him out...
av1428 He himself should help himself out to verify:

windows host error tell that the ShellExecute() facing some problem, but what the messages ?
These the likely 3 thing need to confirm:
1- Is there really a E:\\AutoExportChart\\ folder ?
2- Is there really a AutoExportChart.js file ?
3- Is your ShellExecute("E:\\AutoExportChart\\AutoExportChart.js","",""); syntax correct ?

if all above are there, what inside the AutoExportChart.js script that cause error ?
 
Last edited:
#6
KelvinHand ...Sometimes I really stunned why I don't think in this way?
u r awesome...
Kevin...
As I mentioned earlier the code works when I do it thru param click...

meaning..... Auto*.js exist... here is the code
Code:
outputdrive = "F:\\";
saveimage = outputdrive;
var oAB = WScript.CreateObject("Broker.Application");
Ticker = oAB.ActiveDocument.Name;
AB = new ActiveXObject("Broker.Application");
Win = AB.ActiveWindow;
Output=saveimage + Ticker + ".jpg ";
Win.ExportImage(Output, 1280, 960);
Had this saved in e drive and I'm trying to export to f drive so that later we can MAP the FTP of a webhost and have the charts saved directly into the website. autorefresh the page to have the new images displayed...

now someone please help resolve the process as it works when you click thru param. and not automatically
 
#7
KelvinHand ...Sometimes I really stunned why I don't think in this way?
u r awesome...
I still get
Windows script host error
Line 8
char 1
err: the server had threw an exception
code 80010105
source null.....\\\


or is there any other means thru which we can do this...

here is a link but unfotunatly this guys wants 15K to help me....
http://jackpottrade.forumotion.in/h1-nifty

this seems like super trend... and I'm longing to create one like this.

I work in a call center in UK shift as a supervisor so I'm unable to trade as I don;t have permission to install ami on workstation. I would like to bring my system online so that I can trade when free at work.

Some one please help
 

trash

Well-Known Member
#8
Kevin...
As I mentioned earlier the code works when I do it thru param click...

meaning..... Auto*.js exist... here is the code
Code:
outputdrive = "F:\\";
saveimage = outputdrive;
var oAB = WScript.CreateObject("Broker.Application");
Ticker = oAB.ActiveDocument.Name;
AB = new ActiveXObject("Broker.Application");
Win = AB.ActiveWindow;
Output=saveimage + Ticker + ".jpg ";
Win.ExportImage(Output, 1280, 960);
Had this saved in e drive and I'm trying to export to f drive so that later we can MAP the FTP of a webhost and have the charts saved directly into the website. autorefresh the page to have the new images displayed...

now someone please help resolve the process as it works when you click thru param. and not automatically
The code looks kinda nonsense to me
Try this
Code:
var dir = "F:\\";
var AB = new ActiveXObject("Broker.Application"); // create Amibroker object
AB.ActiveWindow.ExportImage( dir + AB.ActiveDocument.Name + ".png", 1280, 960); // export image
 
#9
The code looks kinda nonsense to me
Try this
Code:
var dir = "F:\\";
var AB = new ActiveXObject("Broker.Application"); // create Amibroker object
AB.ActiveWindow.ExportImage( dir + AB.ActiveDocument.Name + ".png", 1280, 960); // export image

tried the code and still encountering the same error...
or is there any other way thru which we can stream the chart online like smcharts.com
 

KelvinHand

Well-Known Member
#10
tried the code and still encountering the same error...
or is there any other way thru which we can stream the chart online like smcharts.com
I tested both scripts. no problem at all.
Can you tell me what is your F Drive ?

Since you put the AutoExportChart folder in E: Drive

Then 1st make sure it work in E: Drive
Code:
outputdrive = "E:\\";
saveimage = outputdrive;
var oAB = WScript.CreateObject("Broker.Application");
Ticker = oAB.ActiveDocument.Name;
AB = new ActiveXObject("Broker.Application");
Win = AB.ActiveWindow;
Output=saveimage + Ticker + ".jpg ";

WScript.Echo("ExportImage: " + Output);

Win.ExportImage(Output, 1280, 960);

WScript.Echo("ExportImage: Done !");

How to run
=======

- Open Amibroker, select and focus your favorite chart.
- Goto E:\AutoExportChart\ folder, execute directly the AutoExportChart.js
 
Last edited:

Similar threads