This project presents a unique way of tracking the performance of your stock portfolio. It uses an actual traffic signal light and lights up red, green or yellow depending on how your stocks are doing, with results updated every minute. An Atmel AVR ATmega128 microcontroller is paired with an Ethernet controller to provide connectivity to the internet. At different times, the Atmel controller acts as both web server and web client. In order to enter the stock portfolio, the Atmel controller serves up a web page where the user enters the purchase price for each stock, along with the stock symbol and number of shares.
IDel Hatch, the project designer, said that once the portfolio has been entered, the gains (or losses) can be calculated. To do this, the microcontroller accesses the current stock prices via the internet acting as a web client. It does this by sending a request to a friendly web site with the stock symbol as part of the request. After the current stock price (and yesterday’s closing price) is received, another request is sent for the next stock, and so on, until the current prices of all stocks in the portfolio have been received.
Knowing the amount of money originally invested in the stocks, combined with the current valuations, allows the net gain or loss to be calculated. If the portfolio has gained value overall (congratulations!) the signal light illuminates green. If you have lost money, but less than 10 percent, then the yellow light turns on. If the portfolio is down more that 10 percent, the dreaded red light glows brightly.