Question: On 8/16/2017 9:30 EST when market opens, due to some reasons the VIX data paused updating for 10 minutes. As a result all brokers’ VIX value is missing for that time period. I am wondering what the api request data .current(‘VIX’,…) will return then? how could the algorithm detect this issue and pause the trading?
Anwser: IBridgePy will not receive any data from IB server if there is no new VIX data during a period of time for any reasons. Therefore, data.current(‘VIX’, …) will return the previous number if IBridgePy has received a valid number before. Otherwise, it will return -1 that is the default value after real-time-price was requested but has not received any values yet. IBridgePy will not receive any error messages in this situation so that it is hard to detect this issue. If it is a serious issue that you want to solve, you may write a code to check real time prices regularly, for example, every 1 second. You may determine it has some issues if there is no new value showing up for a long time, say 10 minutes.