@DdlV

Error 054 won't happen in Test mode because in Test mode Zorro doesn't request market data from Broker.

For the download:
1. The plugin adjusts the end time to 15 minutes prior to now (the DateTime when the function is called) otherwise Alpaca will reject the request. Alpaca might shorten the range if there is not enough data available on their end.
2. Ending date changes because Zorro only requests a limited number of bars. After the plugin returned the bars, Zorro often sends another request with the same start date and different end data.
3. When there are no more data available within the given range, 0 bars are turned to Zorro. Zorro often sends a couple of more requests with the end date decreasing by 1, I think that is Zorro’s way to make sure no data are missing.