I updated the title question to correct a typo and include important details about your request.
The solution to this is far more complicated than it first appears. There are many hoops the code must jump through in order to handle the transitions from regular session market to extended session market.
Further complicating the solution... By stating things the way you have: "Premarket range" and "Premarket high". You have intentionally excluded the first half of the extended hours session. The extended hours session consists of the time immediately following the regular session close up to the time of the next regular session open. It is common to refer to the first half of the extended hours session as "post market hours" or "after market hours". This is the portion of the extended trading session you have excluded when you requested this measure the "premarket range". The premarket session takes place from midnight Eastern up until the regular session open.
I was not able to complete this and work out all of the bugs within the brief 15 minutes I allow for free solutions in the Q&A forum.