An update on where I'm at with this: I've been playing around with many versions, not all of which I've posted because they're so highly experimental.
Here are some things I've learned.
If for some reason we (or the
EA) are/is unable to place orders to ensure profitability, the next exit can be a losing exit, wiping out many nice winning cycles. That's bad of course.
So the game is to not use up the margin. Halting new orders on an existing trap grid when margin is low can
trigger a losing exit. Not starting a new "trap" on low margin, though, is a good idea when trading lots of pairs and is what we see in the original williama_improved_all_margin EA.
My main effort now is in dissecting the heart of the order placement logic, trying to make sure no more orders than needed get opened, to preserve precious margin.