MarketData.jl
MarketData.jl copied to clipboard
Create constructor for random time series
User supplies the date range and the method uses a RNG to create a random walk time series.
Some code I'm using in TimeSeriesResampler.jl
idx = DateTime(2010,1,1):Dates.Minute(1):DateTime(2010,4,1)
# or idx = range(DateTime(2010,1,1), length=500, step=Dates.Minute(1))
idx = idx[1:end-1]
N = length(idx)
price = rand(-1.0:0.01:1.0, N)
price_init = rand(1.0:1000.0)
price = price_init .+ cumsum(price)
ta_price = TimeArray(collect(idx), price, ["Price"])
vol = rand(0:0.01:1.0, N)
ta_vol = TimeArray(collect(idx), vol, ["Volume"])