Often, trading strategies use the current day's lowest price of a financial instrument as one of the qualifying conditions before making decisions to place new trades. This data is dynamic in nature as it may change continuously during the live trading hours. This recipe demonstrates how to fetch the current day's lowest recorded price of 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. Refer to the Attributes of a financial instrument recipe of this chapter to set up instrument1.
How to do it…
Fetch and print the recorded lowest price of the day of instrument1:
>>> low_price_day = broker_connection.get_low_price_day(instrument1)
>>> print(f'Lowest price today: {low_price_day}')
We get the following output (your...