GBM source code in C++ for generating time-series

GBM is not random data, it is simulated market data (some call it "synthetic market data").
Where can you get say 5-second bar data for hundereds of stocks for say 1000 years? :D
With GBM it is possible to test 1000s of market situations fast and with no costs.
It is very good for market modelling and forwardtesting, much like BSM is for modelling options.

And: you even don't need to store the mass data in databases; just store the "seed number" which is just a single 32bit or 64bit value depending on the operating system... :)
Ie. in the above code one would at program start in main() do something like this:
Code:
   randgen.seed(123456);
It means that you can replay/repeat the same sequence it generates. This is important during system design and development (ie. for debugging the system).

This explains everything :)

Botpro, in addition to C++ please take a look at something called R :) you will be enlightened by it, the best part you won't have to reinvent the wheel (in particular with regards to stochastic processes and such).
 
For debugging it should be great but when would try use it for generating tick data would it work as good as 30 sec/minute bars or will be differences on larger scale if generating higher resolution?
 
For those who want to go further, I recommend some more complex models like Ornstein-Uhlenbeck(best for mean reverting regimes).
Heston model is a very interesting one but be aware that is next to impossible to calibrate Heston if you have only the time series of the given instrument. You need the option prices to calibrate it correctly.
Maybe add a jump process too to simulate a spike in the price.
 
Back
Top