This is why I avoid the player market as much as I can, in regards to power and water purchases.

So yes, you can make money off of gold, but you have to balance your needs for water and power, so you can find a constant production rate. In other words, have the power and water needs met in between your mining production times.
Suffice it to say, despite being told to "Always go by market prices, to figure out the actual production cost" doesn't always have to apply to you nor all of your products. Just remember, balancing the back inventory needs to make your product, while the factory or mine is busy in production, is very important for a constant production flow (especially when customers depend on daily contracts or even weekly).
To delve a little further, let's make an example.
Let's say you want to be able to produce 32.780 grams of gold a day. In order to do this, you need 27,863,000Kw power and 2.950,000 liters of water. Your company level, for the sake of argument, is Billionaire. You have one mine that is 2100 m2 in size. It can mine 1365.85 grams of gold per hour.
Total production time = 32,780/1365.85 = 24 hours (rounded off)
So this means in 24 hours, you need to have 27,863,000 power and 2,950,000 liters of water ready to go for the next batch (Also don't forget to have the cash for production ready as well, which in this case is 295,020 c).
So as long as your power plants and wells are large enough to balance such a large operation, you'll do fine. Just remember to adjust your gold production to your power plant and well's own production abilities (and watch your cash balance). Also, don't forget to sub-manage your well's water production because it needs power too. As long as you use this formula for gold in this example, just be able to produce a minimum of 10% over your mining needs to ensure your wells can keep pumping water.
So if you sold the gold, 150 per gram, every 24 hours, you're making 4,917,000 c per day from just one mine. Now imagine being able to do this with 10 mines.
* Gold unit price = 9.00 (prod) + 25.5 (power**) + 1.8 (water) = 36.30
** If you have all green power plants, it's 9 + 8.5 + 1.8 = 19.30 (approximately, figure is not exact due to not having a green power plant)
Footnote: My power is generated in Germany and my water is pumped from Saudi Arabia.
Cheers
Opus