zipline icon indicating copy to clipboard operation
zipline copied to clipboard

First value generated by RandomWalkSource is always a NaN

Open warren-oneill opened this issue 11 years ago • 3 comments

When I run the following code

source = RandomWalkSource(start_prices = {'TEST' : 50}, start=start, end=end)
algo = TradingAlgorithm(initialize=initialize,
                        handle_data=handle_date)
results = algo.run(source)

and record the values generated for 'TEST' then I always get a NaN for the first trading day.

warren-oneill avatar Feb 06 '15 11:02 warren-oneill

I think this might be due to the fact that record() has nothing to record on the intial day.

warren-oneill avatar Mar 12 '15 15:03 warren-oneill

When is your start date?

devanp92 avatar Oct 19 '15 19:10 devanp92

@devanp92 can't remember and don't have the code anymore. Why do you ask?

warren-oneill avatar Oct 27 '15 09:10 warren-oneill