metatrader api question

 
i use the version 3 of the api , i have already a code example that works with quotes streaming but i want to retrieve all the quotes at the same time when the program starts and only after use the streaming for quotes changes ...

i tried GetPrices() function but when the market is closed this function returns an error "trade disabled" and not the last known bid/ask for the securities.

any suggestion to always be able to retrieve the last known bid/ask ?
 
store last bid/ask when they are accesible
Reason: