provided by: 
Originally published at Internet.comThe image frame below shows the simulation of some arbitrary (random) stock-price moving average and its Bollinger Bands over discrete time periods. The user is encouraged to run this small application and experiment with varying different parameter values, that is "Number of days" and "Type" (Alpha-level), where the change is reflected instantly from the plottings. You can plot random new generated data by clicking on the button named Generate data. The class that does this simulation is called Bollinger.java; it is named after its inventor, John Bollinger. Interested Java developers who are currently involve in projects developing financial application systems should read the references below:
There are two classes to run the Swing applications: Bollinger.java and BollingGraphics.java.The developer/user can modify the code and develop a JavaBean using Bollinger.java, the WebStart application , applet, or servlet . To get data from a stock market repository, read the data from an input stream, convert each one into double (Java data-type) and store this array as a Matrix object. This object is the input parameter to the calculate method of the Bollinger class. Write a thread to update the data from the stock market repository, say, every 2 minutes. The first element of the old data is chopped-off and a new (recent) data is added to the end of the Matrix object, thus averaging is moving along with every new data that comes in. For example: ...
Read article at Internet.com site