Jump to content

C++ Program to process data from website?!

ClobberXD

Here's my intentions:

  • Check the stock-market daily.
  • Monitor prices of certain stocks.
  • Alert user if price increases (or decreases) beyond specified limit.

I need your help to perform the first function - to check the market daily, but more specifically I need your help in creating a C++ program to access that website and process the data in it... OR is it much easier to just download the webpage and obtain the required data from it?

 

Thanks! 

Nothing to see here ;)

Link to comment
Share on other sites

Link to post
Share on other sites

Normally, this is done by using the API supplied by the exchange you want to monitor. They supply real-time data (as opposed to delayed data on many websites) and you might get other data like the bid/ask stack, etc...

 

(for example, nasdaq's api page: http://www.nasdaqomx.com/transactions/marketdata/europeanproducts/data-products/nasdaq-web-api-service )

 

However, in many cases this is not free. The only free solution would indeed be to download a webpage and parse the downloaded file for the price you seek. A quick test on a yahoo stockquote shows that the price is in there so you should be able to design a algorithm to extract the price from the file.

 

I don't see much use in such a program however. The things you want to implement are available automatically at any decent broker. Why would you use a clunky program that gives you an alert when you can just put a limit order at your broker ?

Link to comment
Share on other sites

Link to post
Share on other sites

It's not a task for C++. You can do it but you are very likely to lose insane amount of time with this language. In my opinion high-level language is much more suitable, you may like Node.JS apis because JS is very common language and npm modules like request provide tools you need.

 

Link to comment
Share on other sites

Link to post
Share on other sites

I'd suggest against using C++ for this, you would be much better off programming this in a language like Python, JS, or PHP, heck, even Java or C# would be better suited for it. 

 

Ninjaed by Clechay!

Edited by Blade of Grass
Ninjaed

15" MBP TB

AMD 5800X | Gigabyte Aorus Master | EVGA 2060 KO Ultra | Define 7 || Blade Server: Intel 3570k | GD65 | Corsair C70 | 13TB

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/14/2016 at 8:25 PM, Unimportant said:

Normally, this is done by using the API supplied by the exchange you want to monitor. They supply real-time data (as opposed to delayed data on many websites) and you might get other data like the bid/ask stack, etc...

 

(for example, nasdaq's api page: http://www.nasdaqomx.com/transactions/marketdata/europeanproducts/data-products/nasdaq-web-api-service )

 

However, in many cases this is not free. The only free solution would indeed be to download a webpage and parse the downloaded file for the price you seek. A quick test on a yahoo stockquote shows that the price is in there so you should be able to design a algorithm to extract the price from the file.

 

I don't see much use in such a program however. The things you want to implement are available automatically at any decent broker. Why would you use a clunky program that gives you an alert when you can just put a limit order at your broker ?

My broker doesn't provide such features... And I've had enough reprimands for mentioning C++. Which language do you suggest for this task? The only ones I'm familiar with are C, C++, HTML (extremely basic). But I'll try to learn a new one online if necessary.

 

Thanks!

Nothing to see here ;)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×