Stock Trading by Computer

2005 Skadron Prize In Computational Physics

image003

Stock trading by computer is an example where computational physics knowledge may be applied to the financial world. This subfield is often called "econophysics" and has been a significant career opportunity for physicists in the last decade. In this year's contest, entrants act as stock investors trying to maximize the value of their portfolio which, for simplicity, we consider to contain only one stock. Each entrant/investor should submit a subroutine that takes action on a single stock on the stock market (a sample price-to-time graph is presented above). The action includes the decision to buy, sell or hold on the shares of the stock in your portfolio using the money available in your cash account. Each investor will be given the same amount of assets at the start of the competition. The goal is to maximize the total value of your portfolio by the end of the trading period (with a gain).

Overview

Write a Fortran subroutine, action (time, price, cash, stock, buysellhold,nshares), with the following inputs and outputs:

time input a number representing the number of time units
price input the stock price per share at time time
cash input the amount of cash available to the investor for purchasing stock
stock input the amount of stocks currently held
buysellhold output parameter determining the action to be taken:

1 = buy more stock
2 = sell some stock
3 = hold (do not buy or sell)

nshares output the number of shares to buy or sell if buysellhold < 3

Investors' decisions will be gathered and the specified trading will be made before the next stock price is generated and presented to the investor for the next time unit. The master program will load your control subroutine into its main code to monitor the whole market activity. For simplicity no fee will be imposed on the trading and a fraction of a share is permitted for buy/sell transactions. Initially each player will have $10 in the cash account and no stock.

To test your subroutine, click this link to download a sample main code and add your subroutine to that file before compiling. This sample code simulates stock prices using random numbers, while the actual competition code will use real historical stock data. When you're satisfied with the performance of your subroutine, e-mail it as an attachment (.f, .f90, or .f95 extension, plain text format) to Dr. Su.

Prizes

$ 200 for the first place, $100 for the second place.

Who can participate

Physics majors at ISU.

How to submit an entry

Email your subroutine to Dr. Su.

Deadline

4 pm, April 8, 2005. The winning entries will be determined and announced at the department award ceremony on April 19, 2005.