Start by placing the fish in a pot of cold water and leaving it to soak for a good 12 hours. Make sure to change the water 2 or 3 times during this period. Once soaked, drain the cod.
Place the soaked cod in a little water in a saucepan and bring it to a light simmer for 15 minutes to remove the excess salt. Careful not to overcook the fish at this stage. Drain the saltwater, remove the skin and bones and shred the flesh into small pieces and set it aside.
Next, fry the onion and garlic in some oil in a large enough skillet, until the onion is translucent and glossy and the garlic golden. Add the chopped tomato and tomato puree, mix and let cook for 3 minutes.
Incorporate the shredded cod, along with the bay leaf, cinnamon, pepper, red peppers, almonds, olives, capers, and parsley. Give it a good stir, then cook it over medium heat, keeping it covered, for 15 minutes.
Add the potatoes to the skillet, cover and cook over high heat for an additional 10 minutes or until a fork inserted into the potatoes meets a slight resistance. You can add more salt at this point if required, but keep in mind the balacao should be salty enough.
Serve the dish at room temperature, with chiles gueros and white bread on the side.
Any leftovers can be refrigerated, and should keep for about a week.