Stock Price Algorithm

In order to simulate the stock path, we need to utilize the equation below to determine the movement of the stock price.

S – Stock Price; r – risk free rate; sigma – volatility; h – change in time; epsilon – randomly generated number (Gaussian)

From this algorithm, we can feed the algorithm the required inputs and project a number of stock paths. Once we have sufficiently many paths, we can apply the following equation to the paths in order to determine the Option price.

T – time to maturity; n – number of iterations; S(T) – final stock price; K – strike price

VHDL Architecture

With the required Stock Price equations now in place, we can outline the structure of the FPGA design. Using VHDL, we will use the following flow chart as the overall structure to price the Barrier Options.

Firstly, random numbers with Gaussian distributions must be generated for the volatility calculation and for the Stock Price algorithm. A single next stock price step will be calculated, and the process will repeat until a final stock price has been reached. This will iterate a large number of times, and payoffs will be accumulated. At the end of the process, the average of all payoffs is calculated to determine the fair value of the Barrier Option, thereby giving us the price of the Option.