Page 1 of 1

Magic numbers and the multi-order mess in automated scalping

Posted: Sat Oct 31, 2026 8:17 pm
by Amanhasnoname
Automated strategies tag their orders with an identifier so that each knows which ones belong to it. When several systems run on one account, mistakes in that tagging cause real damage.

Common problems include two strategies using the same magic number, one closing the other's trades, and orders opened manually being modified by a script. Hedging accounts add complexity, since multiple tickets can exist on one symbol at the same time.

Symptoms are puzzling. Trades close for no apparent reason, stops get moved, and positions open twice.

Simple discipline avoids most of it. Give every system a unique identifier, document it, and keep manual trading on a separate account or at least clearly flagged.

Logging every order action with its identifier gives an audit trail for tracing odd behaviour.

When moving to a netting account, the whole logic changes, since positions merge into one per symbol. Strategies written for hedging need rework.

How do you separate multiple systems or manual trades on the same account?