I'm not convinced that this is a useful feature. Historical data should be generated with a dedicated function, not with live trading.

Aside from many other problems, live data is frequently subject to Internet interruptions and other issues - especially with IB. Data generated this way would be of poor quality and full of gaps. You had to fix it. For this you need code anyway, a lot more code than for collecting it while live trading.