How to get data from screen ?

Smartman

Junior member
12 0
Hi

I want to get a program that will get data from my screen automatically and to use the data in a program . Can this be done !

Any ideas/help


Thank you
 

iq200

Well-known member
338 12
NO! The only way is to read off the data from the chart or table or whatever by eye. 2nd choice is see if the program allows you to save or export the data to a file. Last alternative is find out if the program supports some kind of interface (e.g. DDE, programmable .. etc) and implement or use that.
 

Trader333

Moderator
8,502 881
Hmm, It depends on how the data is presented on the screen. If it is from a website then it may be possible using XML programming techniques. Can you give an example of exactly what you are trying to achieve ?


Paul
 

riddle

Member
67 4
IF you can use your mouse to hilight and copy the data on the screen (so you can copy it into another program), then you should be able to do this automatically using a macro program. This is never as good as using a real api, or even a dde link, but it can work.
Google for "screen scraping" for more info.
Steve
 

blackcab

Established member
523 51
The answer is yes, you can do this, but maybe no-one's written the program yet. A program could request a chart from a Web site, decompress the GIF/PNG into a flat format, then 'read' the scale, bars, time by knowing what colour pixels to look for, what shape the characters are, etc. It would be a long, tedious program to write but a fun challenge if you're into that sort of thing. If you had such a program, you could schedule it to get charts of any instrument every day and have free, up to date data.
 

Strategic Trader

Active member
100 2
you can read any data that you see on a screen - either by writing a program that directly reads the screen data or else 'sniiffing' the data sent to the screen, so you can effectivly automate programs which seemingly are only manually controllable
 

TWI

Senior member
2,527 252
When I was working at Enron we had some code that would scrape data from websites each day and dump it into our own database. So this definitely can be done. An example of the kind of data we "scraped" is
http://www.eex.de/
 

Strategic Trader

Active member
100 2
scraping data from websites is a little different - since you then have the internet pages that can be directly read in code - but you can also just have a program that can read any data that you see on a screen, regardless of how it is originated
 

dippy46

Junior member
19 0
The answer is as stated by some, YES, but the ease with which it can be done depends entirely on the delivery method. Such items as graphs may be downloaded seperately from the web page and displayed on screen. The html when downloaded does not usually include the graphics but can be read as a text file and data extracted to datafile including csv etc. The problems only really begin when trying to scrape flash screens but even then the problems are not insurmountable, but, in all cases it requires a small amount of programming effort. All of the above can be achieved with AUTOHOTKEY. This site is updated on a very regular basis and the author responds very quickly to forum users requests. The members are extremely helpful to newbies. This environment has worked well for me for the last 12 months.Anyone who has used/or prefers basic could use AUTOIT3 from which AUTOHOTKEY was forked. The language recently underwent major updates to make it state of the art BASIC including calls to DLL's.It is a compileable environment annnnnnnd its FREE !
QED.
 

zzaxx99

Active member
151 2
Strategic Trader said:
you can read any data that you see on a screen - either by writing a program that directly reads the screen data or else 'sniiffing' the data sent to the screen, so you can effectivly automate programs which seemingly are only manually controllable
Interested in how you go about doing this - in the good old days, you'd just read the data straight out of the memory mapped screen data - is this still possible under Windows with the HAL* in the way? Or do/did you read something to read from memory on the graphics card?

(*Hardware Abstraction Layer)
 

dippy46

Junior member
19 0
@zzaxx99
Basically unlike Html which can downloaded and scraped in background, flash presentations are more easily done on screen. Some screens will allow CtrlA CtrlC sequences to be pushed onto the clipboard where they can be retrieved as text and proccessed accordingly. However some screens reject this sequence,but if the window has an edit control no probs, just Alt Edit Select All - AltEdit Select Copy again all details will be pushed to the clipboard. It is important to make sure that the box to be trapped is left clicked before above operations. Because this method is interactive, it really needs to be run on a machine on its own,but then several screens can be trapped in sequence.I use AUTOHOTKEY to automate the process including proccessing of the clipboard data into realtrime csv data files . (Whoops now the secrets out of the bag)

QED.
 

zzaxx99

Active member
151 2
Can't see that this will work in my case - I want to be able to grab streaming prices off Advfn or MoneyAM and convert them to CSV - cut & paste doesn't work (presumably because all of the prices are being displayed by a Java applet).

In theory, you could capture the screen buffer and decode it, or maybe grab the window context and interrogate it, or patch the Java runtime to intercept the screen calls, or install a proxy server to intercept it - be any awful lot easier if someone else has already written it, though! :)
 

bdholmes

Junior member
34 1
zzaxx99 said:
Can't see that this will work in my case - I want to be able to grab streaming prices off Advfn or MoneyAM and convert them to CSV - cut & paste doesn't work (presumably because all of the prices are being displayed by a Java applet).

In theory, you could capture the screen buffer and decode it, or maybe grab the window context and interrogate it, or patch the Java runtime to intercept the screen calls, or install a proxy server to intercept it - be any awful lot easier if someone else has already written it, though! :)
I think what you need is OCR software that can be automatically used to grab a screen print, recognise the characters and then place the text elsewhere so it can be analysed. I did some work on this back in my Deal4Free days when they often took out the stops I had placed with them even though the stop price was never reached in the cash market. I wanted to write a program that would scrape D4F's prices off the screen, and automatically exit my position (or at least alert me) when my stop was reached without D4F ever knowing where my stop was. I never finished it as I gave up on discretionary trading - too much like hard work.

The name of the software I looked at is Textract. It comes in both DLL format which can be called from most programming languages, and command executable format which can be scripted. You tell it the screen coordinates you want to capture (in your case where the ADFN prices are displayed) in x and y values, and it will take a screen print, OCR it and put the text in a file/variable ready to be used. Put it in a loop and you have a solution.

Cheers,

Brendan
 

dippy46

Junior member
19 0
@bdholmes
Yes , that was my next topic, but you seem to have covered it well enough. Bit more hard work though unless your in to serious programming. Worth a look might be Ibasic, very easy environment to work with, Oh and thanx for the tip on textract, have'nt seen that one before. :)
 

zzaxx99

Active member
151 2
bdholmes said:
I think what you need is OCR software that can be automatically used to grab a screen print, recognise the characters and then place the text elsewhere so it can be analysed. I did some work on this back in my Deal4Free days when they often took out the stops I had placed with them even though the stop price was never reached in the cash market. I wanted to write a program that would scrape D4F's prices off the screen, and automatically exit my position (or at least alert me) when my stop was reached without D4F ever knowing where my stop was. I never finished it as I gave up on discretionary trading - too much like hard work.

The name of the software I looked at is Textract. It comes in both DLL format which can be called from most programming languages, and command executable format which can be scripted. You tell it the screen coordinates you want to capture (in your case where the ADFN prices are displayed) in x and y values, and it will take a screen print, OCR it and put the text in a file/variable ready to be used. Put it in a loop and you have a solution.

Cheers,

Brendan
that's an interesting idea - I hadn't thought of going the OCR route.
 

Similar threads


AdBlock Detected

We get it, advertisements are annoying!

But it's thanks to our sponsors that access to Trade2Win remains free for all. By viewing our ads you help us pay our bills, so please support the site and disable your AdBlocker.

I've Disabled AdBlock