I'm writing code that should read a graph (yellow color pixels) and give a sound signal when the graph goes up and another sound signal when the graph goes down (it should also send commands to Buy or Sell, but for that, accuracy is mandatory).
The problem is that the graph in many cases gives several values (Y) on the same X axis (vertical line) and then it is difficult to know if the price has advanced or not. i.e visually you can see the number, but it is an image and not a value that can be read into to a variable.
I am currently doing a double check: reading from above and below. it gives the maximum and minimum value of the vertical line. So I make a sound, and enter into a lot of compares in order to know if I already got that price and made the notification for it or not.
Another problem is the fluctuation between the two values accepted from top_view and Bottom_view.
I tried using all kinds of variables to compare the values, but it's not accurate enough and there are still situations where the script goes into a loop and I don't get an unambiguous reading of the graph.
Is there any unique function that can help in this situation?
Or has someone already solved this problem?
I would appreciate any tips on the subject
James
How to read graph 'values' accurately and reliably
How to read graph 'values' accurately and reliably
- Attachments
-
- גרף בודד מסחר במעוף.png (18.72 KiB) Viewed 370 times
Re: How to read graph 'values' accurately and reliably
You can tell if the value changed by capturing a screenshot where it reports the numbers and use that image as a reference for an ImageSearch loop that would detect when the image has changed. Then you would know the numbers have changed and then you can perform the part that determines how much.
You might also try OCR to read the numbers directly, although that can have its own reliability issues depending on the particular situation. It it happens to work well in your case, it would eliminate all the ambiguity.
Also, even though the numbers are an image, there may be other ways to read them such as this UI Automation library.
You might also try OCR to read the numbers directly, although that can have its own reliability issues depending on the particular situation. It it happens to work well in your case, it would eliminate all the ambiguity.
Also, even though the numbers are an image, there may be other ways to read them such as this UI Automation library.
Re: How to read graph 'values' accurately and reliably
first id ask the developers of ur application whether it already has built-in functionality for streaming this data to a pipe/message/file/whatever
otherwise, if u want an "accurate and reliable" way of retrieving the data, there's always ReadProcessMemory in a loop. but that requires specialized knowledge
otherwise, if u want an "accurate and reliable" way of retrieving the data, there's always ReadProcessMemory in a loop. but that requires specialized knowledge