Emerald product-development portfolio
Profit Protector: Engineering for the Risks Around Automated Trading
A TradeStation control system designed to address protective orders, connection failures, lost orders, position mismatches, limit-order fills, and the need for human oversight.
A trading strategy can contain sound entry and exit logic and still encounter a problem outside that logic: a frozen program, a lost connection, an order that does not fill, or a brokerage position that no longer matches the position the strategy believes it holds.
Emerald Trading Technologies developed Profit Protector to address that operational layer surrounding automated TradeStation strategies.
The experience that prompted the product
David Cohn was running an automated strategy on a dedicated trading computer. The strategy held one long E-mini S&P 500 futures contract. Its drawdown eventually exceeded $1,000 before he discovered that the strategy had apparently lost track of its stop-loss order and should have exited earlier.
This was not an inexperienced user overlooking a basic setting. David had worked for nearly five years as a TradeStation EasyLanguage Engineer, answered more than 17,000 EasyLanguage support-forum posts, and written thousands of indicators and strategies. The incident exposed a larger problem: even a knowledgeable trader who is watching the system may not immediately recognize that the automated process has stopped behaving as intended.
Automated trading is not foolproof. The engineering question is what can still protect, detect, reconcile, and alert when one part of the chain fails.
Why a cloud computer does not solve every failure
A well-run cloud server may reduce the chance that the trader's own electricity or internet service will interrupt the platform. It does not eliminate failures within the operating system, TradeStation, the strategy, order routing, or the exchange. It also would not have prevented the lost-order problem David experienced.
Profit Protector therefore did not depend on a single remedy. It combined several independent protections around the strategy and its orders.
Protective orders that can survive a local interruption
A central feature was the use of a protective one-cancels-other, or OCO, exit bracket. After an entry, the bracket could place a profit-target order and a protective stop order on TradeStation's order servers. If one side filled, the other would be cancelled.
Because the protective bracket was managed outside the underlying strategy and held beyond the local computer, its orders were designed to remain active if the computer froze or lost power or internet access. The documented system supported stop-market, stop-limit, and trailing-stop choices, together with controls for adjusting or floating the bracket around the current price.
Six problems addressed as one operating system
Protective server-side orders
OCO exit brackets were designed to remain active beyond the trading computer, helping protect an open position if the local software, power, or internet connection failed.
Position reconciliation
The system compared the strategy's calculated position with the actual brokerage position and could alert the trader or take configured corrective action when they did not match.
Limit-order fill management
A limit order could be converted to a market order using several configurable signals, including elapsed time, traded volume, price pullback, and bid-ask relationships.
Order and reversal handling
The design addressed lost exit orders and failures that can occur when a strategy reverses from long to short or short to long.
Trading boundaries
It included daily profit and loss controls, time-of-day exits, and an exit near the market close.
Human oversight
An interactive console displayed status and allowed the trader to control live operation rather than assuming automation could safely be ignored.
Smarter handling when a limit price is touched but not filled
A market can reach a trader's limit price without filling the order. Simply waiting may miss the trade or leave an intended exit incomplete. Immediately converting every touched limit order to a market order, however, can create unnecessary slippage.
Profit Protector's documented approach was configurable. It could consider how much time had passed, how much volume traded at the limit price, how far price pulled away, and the relationship between buying and selling interest at the bid and ask. Those conditions could then trigger conversion of the remaining limit order to a market order.
The same capability was designed to work with certain manually entered Matrix orders, showing that the product addressed the execution process rather than only one strategy's source code.
Recognizing when the strategy and brokerage account disagree
Automated trading depends on two versions of reality: the position calculated by the strategy and the position actually held in the brokerage account. They can diverge after a rejected, lost, partially filled, or manually changed order.
Profit Protector monitored for that mismatch. Its settings governed how long a discrepancy could persist, whether open orders should be cancelled while correcting it, and whether an audible warning should be issued. It was also designed to keep the strategy synchronized when a trader manually overrode the position.
Designed to supervise rather than disappear
The product's trading console showed real-time status and provided controls for starting and managing operation. The manual repeatedly directed users to test in simulation, understand the settings, monitor live trading, and respond to warnings.
That is an important part of the design. Profit Protector was not presented as a promise that automation could become an unattended money machine. It was an engineering response to known failure modes, combined with explicit human supervision.
Broad compatibility was itself an engineering challenge
The documented version was designed for equities, futures, and foreign exchange; regular, protected, and TradingApp Store strategies; and a wide range of time-based, tick, volume, and price-based bars. It was intended to add its protections without converting the underlying strategy.
Supporting those variations requires more than placing a stop order. The system must account for when different bar types update, how strategies adopt real-world positions, how multiple strategies share a chart, how session endings are identified, and when orders are controlled by the strategy, the local platform, or external order servers.
What Profit Protector demonstrates today
Profit Protector demonstrates David's ability to identify risks that lie between a strategy's intended trade and the position actually held in the market. It also shows the depth required to convert those risks into configurable EasyLanguage controls, validation, alerts, and recovery behavior.
The documented product was built for an earlier TradeStation environment. Before it could be offered or used today, Emerald would need to confirm its compatibility, retest every live-order behavior, and determine what should be updated. Its value as a portfolio example is immediate: it shows the kind of operational thinking that custom automated-trading work may require.
Discuss your requirements
Does your TradeStation strategy need protection beyond its trading rules?
If you need protective-order logic, position reconciliation, specialized exit timing, limit-order handling, or another control around an automated strategy, contact David Cohn to discuss the problem and the current TradeStation environment in which it must operate.
Start a conversation