When retrieving the open and close for a given session, we only care about the scalar values, so using DataFrame.at instead of DataFrame.loc is significantly faster.
can_trade