Restoring Missing Stop Levels with a Chart-Based Expert Advisor
Summary
This installment describes changes to a MetaTrader expert advisor that let traders recreate missing take-profit or stop-loss levels by dragging chart objects. It adapts the existing order interface: when a stop value is absent, the EA retains or creates a movable indicator so the trader can set the level directly on the chart, without an external tool. The article also explains adjustments to price handling so take-profit values stay on the valid side of an order entry, while position stop values can follow the trader’s input.
The material focuses on implementation logic and the design rationale, rather than trading performance. It presents code fragments for updating chart indicators, setting selection values, and handling order versus position stops. The author frames this approach as a personal workflow choice and describes the order system as nearly complete, with further development still planned. No empirical comparison or evidence of execution reliability is provided, so the article teaches an interface and order-management technique rather than a tested trading edge.
Key ideas
- A chart object can act as a movable control for creating a missing take-profit or stop-loss level.
- When a stop value is absent, the EA can preserve an indicator for dragging instead of removing it.
- The same chart-based update flow can support both pending orders and open positions.
- Price validation should account for trade direction and whether the EA is handling an order or a position.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.