Several modifications to improve the GetHistoricTradeData function.