That's a good question, and I'm not sure of the answer. There've certainly been animal markets around for many hundreds of years, which predated anything resembling a modern 'stockmarket', but I'm not sure there's any real connection. Maybe words like 'livestock' suggest a link, as seen also with terms like 'stock cubes'. The origin of what we know today by the term 'stockmarket' seem to have been in 17th Century Amsterdam and the City of London, as far as I can gather.
_________________
On a mountain range
I'm Doctor Strange