PERF: Use stored values for open and close.

The market_open_and_close method was a performance bottleneck,
since it was creating new dates on each query for open and close.

Instead use the pre-rendered frame of open and closes values
from the trading environment.
STY: Remove unused imports.
PERF: Remove in operator from inner loop.

Ask forgiveness via exception handling instead.