By default, for
timeframes less than 1D, the API returns the data points during market open times, to change this behavior the
intraday_reporting query can be set to
extended_hours, to include the premarket and after-hours trading prices.
The API can be used both for crypto and equities trading accounts. By default the API is aiming at the equities trading use-case, however, it can be configured to return data more suited for visualizing crypto portfolios.
For crypto, we recommend setting the following flags:
intraday_reporting=continuousso that 24/7 graphs are returned
pnl_reset=no_resetso that the Profit And Loss calculation is continuous over the given period of time.
timeframe can only be set to less than 1 day, when the requested
period is less than 30 days.
In the case of
continuous mode (
intraday_reporting), the current price of the equities is calculated in the following way:
4:00 am ET - 9:30 am ET - Last trade based on the premarket in the specific time bucket
9:30 am ET - 4pm ET - Last trade in the specific time bucket
4:00 pm ET - 10:00 pm ET - Last trade based on after-hours trading in the specific time bucket
10 pm ET - 4:00 am ET next trading day - Official closing price from the primary exchange at 4 pm ET.
Regardless of the
intraday_reporting's value the 1D chart only contains data for days when the market was open.