Reconciliation after a reconnect: the step most retail setups skip
There is a step that professional setups treat as mandatory and retail ones skip almost universally. You do it after any disconnect, before you resume trading: compare what your software thinks it holds against what the broker says it holds, and stop if they disagree.
Most retail setups don't do this. They reconnect and carry on with whatever state was in memory, which is fine right up until an order filled during the gap. Then your software believes it's flat, the broker knows you're long, and your strategy proceeds to open a second position on top of one it can't see.
The minimum version, and it really is the minimum:
1. On reconnect, fetch positions and open orders from the broker.