<jupyter_start><jupyter_text>Example of how to use the OHLC objectThis is an async library so there is a bit more boilerplate code to get the methods and coroutines running in your code.  You should *await* the response.<jupyter_code>import sys; sys.path.insert(0, '..')
import asyncio<jupyter_output><empty_output><jupyter_text>Getting started Let's suppose you want to get the last five days of daily candles on Microsoft *MSFT* ...<jupyter_code># Import
from yahoo_finance_async import OHLC, Interval, History

# Fetch coroutine
response = await OHLC.fetch('MSFT', interval=Interval.DAY, history=History.FIVE_DAYS)
response<jupyter_output><empty_output><jupyter_text>You will see that the main OHLC candles are returned as a list of candle dictionaries under the `candles` key in the response dictionary.   **Note** that the most recent candle may have a slightly different timestamp as in the example below of the last candle which should be printing the open time 13:30 UTC but seems to be out of sync until it is closed.  This is somethign that the Yahoo API gives and I have not tried to fix it.<jupyter_code>response['candles']<jupyter_output><empty_output><jupyter_text>The meta data for the API call is returned under the `meta` key in the response dictionary.  This may be useful to confirm that you have indeed requested what you wanted.<jupyter_code>response['meta']<jupyter_output><empty_output><jupyter_text>That's it.  Very simple.  Requesting different symbols The Yahoo Finance API has a huge number of different stocks available on it.  You can look up the stock symbols at https://finance.yahoo.com/lookup  Different candle periods and history The `Interval` object contains the different API options you can use for different candle lengths<jupyter_code>Interval
[(e.name, e.value) for e in Interval]<jupyter_output><empty_output><jupyter_text>Similarly the `History` object shows the available look-back periods for collecting candle data.  Note that some long history with short candle intervals may throw errors or return vast amounts of data.  If in doubt and you want a lot of data, use the `History.MAX` option.<jupyter_code>History
[(e.name, e.value) for e in History]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0646900269541779, 'fraction_numerical': 0.0022461814914645105, 'mean_word_length': 5.627976190476191, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '507736', 'license': 'MIT', 'n_tokens_mistral': 632, 'n_tokens_neox': 614, 'n_words': 287, 'path': 'examples/ohlc-example.ipynb', 'repo_name': 'afedotov89/yahoo-finance-async', 'size': '2226'}