The most complex trading simulation I've ever seen was EVE Online. Did you know they even have a Chief Economist on their payroll to keep it all running? You won't need to do that, but there are some basics to economics that make your world believable if you factor them in...
1) Every port needs an industry
People, as a rule, only go out to the middle of nowhere for one of two reasons; either they REALLY want to be alone, or there's money to be made through the production of something. They might be farmers, miners, wood millers, tour guides; you name it. The point being that every port needs a reason to exist and that means the production of either goods or services.
Break your ports into broad categories like farming, hunting, mining, tourism, whatever. Then, you 'produce a set amount of the item your industry is focused around, which other ports need. This allows ships to set up trade routes; travel from a farming port with grain to a mining port, which takes the grain and gives you iron, which you take to another farming port which need it for shoeing horses and making ploughs, but they give you moonshine which you can take to a holiday port, etc...
2) Markets work on supply and demand
If you want a 'balanced' game, make sure that whatever goods are manufactured and fed into the game at a trading centre at the ports, there is an equal need for it across the entire game world. That means that prices won't completely tank or go through the roof, but how you get goods thither and yon is driven by price. A port that really needs grain but doesn't get a lot of trading ships will offer more because the demand is still there (your pirates could be making it difficult for some traders to get through, for instance). That said, your pirates are also a drain on the system when they attack traders so you need to account for a certain percentage of overproduction to cater for the pirates and the overall risk they represent.
3) People consume
The reason why we want goods is in essence to use them. We don't just store grain in a silo forever after buying as much of it as we can; we slowly use it through winters or times of scarcity. So too with your game world. Just as your ports should introduce new goods at a specific rate, the places that use it should slowly take it out of the system at a given rate instead. This reflects most accurately what is really happening in the world, and also allows you to set a reasonable pricing model where the price goes up as the stock on hand goes down, and vice versa. That would also encourage you to beat other ships to empty ports so that you sell your goods at the highest possible price, before they get a chance to unload.
Of course, there's a lot more to economics but these basics, if implemented correctly, will give a sense of a true open world economy and introduce quite a bit of trading realism that automatically covers off things like risk v. reward, supply & demand, time being of the essence, etc.