Add Alerts & Trade Signals
What this Workflow Does
The Add Alerts & Trade Signals workflow helps you extend an existing trading tool with notifications and signal outputs.
This workflow is used to add alerts such as:
- Sound alerts
- Message box alerts
- On chart text or icons
- Trade signal flags or outputs
It does not create a new indicator or trading robot.
It assumes you already have a working tool and want to add alert logic safely without breaking existing behaviour.
When to Use This Workflow
Use this workflow when:
- Your indicator or robot already compiles and runs correctly
- You want alerts based on existing conditions or signals
- You need clear, controlled notification logic
- You want to avoid modifying core calculation logic
Do not use this workflow to design a new strategy or indicator from scratch.
What You Should Prepare
Before starting, make sure you have:
- The full source code of the indicator or robot
- A clear description of:
- What condition should trigger the alert
- When the alert should fire (once, per bar, per tick)
- The type of alert you want:
- Sound
- Message
- Chart display
- Signal output
If the tool does not compile, use Fix & Refactor Code Bugs first.
How to Interact with CodePilot
When using this workflow, describe your request precisely.
Good examples:
- “Add a sound alert when RSI crosses above 70.”
- “Show a message box when a buy signal is generated.”
- “Display an arrow on the chart when the signal condition is met.”
- “Trigger the alert only once per bar.”
Avoid vague requests such as: - “Add alerts everywhere.” - “Make it notify me.” - “Add signals like TradingView.”
Clear conditions lead to correct results.
How CodePilot Handles Alerts
CodePilot will:
- Preserve existing logic and calculations
- Insert alert code in the correct lifecycle methods
- Prevent repeated or spam alerts where possible
- Add parameters so alerts can be enabled or disabled
- Return a complete, compile-ready file
CodePilot will not guess alert conditions.
If something is unclear, it will ask for clarification before generating code.
Common Mistakes to Avoid
- Adding alerts before confirming the tool works correctly
- Mixing alert logic with calculation logic
- Requesting multiple alert types in a single step
- Forgetting to specify when the alert should trigger
Always add alerts incrementally and test after each change.
Recommended Next Steps
After adding alerts:
- Test the tool in a simulator or demo environment
- Confirm alerts trigger exactly as expected
- Adjust parameters or alert frequency if needed
If you want to extend further, consider: