Often, trading strategies use the current day opening price of a financial instrument as one of the first qualifying conditions before making decisions to place new trades. Comparing the current day's opening price with the previous day's close price may give a hint as to whether the market price is bound to rise or fall for the current day for an instrument. If the open price is significantly higher than the previous day's close price, the price may continue to rise for the day. Similarly, if the open price is significantly lower than the previous day's close price, the price may continue to fall for the day. The recorded open price data is static in nature, meaning it does not change during the live trading hours. This recipe shows how to fetch the current day's opening price of a financial instrument.
Getting ready
Make sure the broker_connection and instrument1 objects are available in your Python...