New High, New Low - Outside Market Hours?
ptunney
Posts: 246
This question was asked internally and I thought it would be useful to all users...
Q) Does daily high/daily low only track data during market hours?
I'm trying to track pre-market data.
A) min(md.bar.minute(start=service.time(0,0,0,0),include_extended=True).low) would give you the low including the premkt
Comments
A) part 2 : Initialize an instance variable called self.low in on_start. Then update it in on_minute_bar. That way you can reference it in other methods such as on_trade as self.low
Using on_minute_bar to update minute based variables is an excellent way to keep your script from being resource hungry otherwise you risk making bar calls (very resource hungry) on every trade for every symbol...