Designing a Chart Trade Message Protocol for an Expert Advisor
Summary
This installment describes stabilizing a chart-based trading panel’s mouse-event handling and designing the message it sends to an Expert Advisor. The code adjusts panel coordinates when the chart is resized, manages dragging and editing, and uses a shared click-state check to avoid unreliable interactions between the mouse indicator and panel controls. The author reports that moving cleanup and state updates into a common condition resolves cases where controls failed when the mouse indicator was loaded first.
The message packages an event type, symbol, day-trade or swing mode, leverage, and take-profit and stop-loss values converted from money into points. Sending converted point values is presented as a way to simplify the receiving Expert Advisor. The installment argues that protocol fields and representations should be planned before implementation, and says the receiving side will be covered later. It provides no systematic reliability testing or trading-performance evidence, and the excerpt omits much of the protocol discussion.
Key ideas
- Mouse-event handling changes are presented as a fix for chart panel controls that sometimes failed to respond.
- The panel sends an event code, symbol, trade mode, leverage, and converted take-profit and stop-loss point values.
- Converting monetary risk settings to points is intended to simplify the Expert Advisor’s processing.
- The author recommends designing the communication protocol before building the message receiver.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.