Though you can use historical data API to fetch this for testing purposes. We don't recommend using this in the live strategies. For live strategies, you can generate candles at your end using the live market data provided via websockets. You may refer to this thread to get started.
For live strategies, you can generate candles at your end using the live market data provided via websockets.
You may refer to this thread to get started.