Each financial instrument has a well-defined price band. The instrument price is expected to be within this price band for the day. During the market hours, if the instrument price breaches the band on the upper or lower side, trading may be halted for the instrument by the exchange for a certain time or the entire day. This is done to prevent the sudden rise or fall in an instrument's price within a single day. The upper edge of the price band is known as the upper circuit limit and the lower edge of the price band is known as the lower circuit limit. This data is static, meaning it doesn't change during the day. However, it can significantly change from one day to another. This recipe helps find the circuit limits for a financial instrument.
Getting ready
Make sure the broker_connection and instrument1 objects are available in your Python namespace. Refer to the Technical requirements section of this chapter to set up broker_connection...