Friday, March 7, 2008

Requirements for automatic trading

1. Allowing my software to initiate trade requests and receive confirmations on the fly.
2. The software to calculate based on hitorical data the best stocks that can be traded intra day.
3. The software to find the stocks to buy at every minute with a max investment cap of 5k.
4. The software to sell stocks at right moment with either a loss of x% or a profit of y% and reinvest the money in the next stock.
5. The software to calculate profits made.

Wednesday, March 5, 2008

Complete change

Changed the program completely. Now I upload all the data into one table as rows instead of columns. Earlier I was using columns because the database connectivity was very slow. But now with MySQL database and proper jdbc connection the speed has improved considerably and hence selecting data from the table based on date / symbol is not an issue any more.

Also changed the calculation etc to happend through sored procs in mysql. It took some amount of effort to get good performance but finally managed to accomplish a decent performance. Now the program can automatically download data from the last day of updation till date and do the calculations at around 5 minutes per every day's records.

Simultaneously, created a new program for downloading data from nse site throughout the day. It works fine and takes about 12-14 minutes for downloading for all the shares at a network speed of 128 KBps.