How to get a close price from last day or from previous days?
zp162218
Posts: 3
How can I query close prices from last trading day or any days before?
Thanks
ZP
Comments
In backtesting there are two ways to access close prices, md.stat.prev_close and through the bars.
See the following code for an example...
At the moment the values they return can differ if a symbol has split or had a dividend.
Try the following code on 2018-03-20 to see three symbols that have split and how the previous close price from stat differs from the adjusted previous close price in the bars...
In live-trading or forward-testing there are two variables available md.stat.prev_close (which is adjusted) and md.stat.unadjusted_prev_close.
Hope this helps!
Paul