Adding Interactive Buttons to a Strategy Status Panel
Summary
This platform tutorial explains how to display clickable buttons in a strategy’s status panel and receive their commands inside a running strategy. Buttons can appear alone or in a table, and their command field can carry text or, after a reported platform update, numeric values represented as strings. The examples include a close-all action, a changing time value, and a command intended to trigger a custom function.
The walkthrough describes polling for incoming commands, logging them, and using a command prefix to identify a JavaScript snippet. It shows a try-and-catch pattern around evaluation and mentions styling buttons with a class. The examples illustrate interface behavior rather than trading performance. Executing supplied text as code carries practical risk, and the tutorial does not discuss safeguards, authorization, or production deployment. Its value is limited to users of the described strategy platform and API.
Key ideas
- The status panel can display an interactive button on its own or inside a table.
- A strategy can poll for and process the command associated with a clicked button.
- Commands can represent actions, values, or function-related input, with numeric handling described as string-based.
- A command prefix can be used to route text toward code evaluation, which requires careful safeguards.
- Button appearance can be adjusted with styling classes.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.