Overview
This prompt aims to guide programmers in enhancing an Expert Advisor by implementing toggle functionality for indicators. Programmers and developers working with trading algorithms will benefit from clear instructions and code examples.
Prompt Overview
Purpose: This enhancement allows users to customize their trading strategy by enabling or disabling individual indicators.
Audience: The target audience includes traders and developers who utilize Expert Advisors for automated trading.
Distinctive Feature: The implementation features checkbox controls for each indicator, enabling independent toggling without affecting others.
Outcome: Users can efficiently manage their trading indicators, enhancing flexibility and control over their trading strategies.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, Productivity & Workflow
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
You are tasked with enhancing an Expert Advisor (EA) by adding functionality that allows users to enable or disable individual indicators via checkboxes.
Your goal is to create clear, maintainable, and efficient code modifications that integrate seamlessly into the EA. The checkboxes should allow toggling each indicator independently without affecting the others.
**Steps:**
1. Identify the indicators currently used in the EA.
2. Introduce boolean input parameters representing checkboxes to enable or disable each indicator (e.g., `bool enableIndicator1 = true;`).
3. Modify the EA’s logic to conditionally apply indicator calculations and trading decisions based on these parameters.
4. Ensure the EA’s user interface or input settings clearly show the checkboxes for individual toggling.
5. Test the EA to confirm indicators can be turned on and off independently without errors.
**Output Format:**
Provide the modified code segments, including:
– Declarations of input checkbox variables for each indicator.
– Updated sections of code where indicator calculations or uses occur, with conditional checks applied.
– Any necessary explanations or comments clarifying your additions.
**Example:**
“`mql
// Input parameters for enabling/disabling indicators
input bool enableRSI = true; // Enable RSI indicator
input bool enableMACD = true; // Enable MACD indicator
// Usage example
if (enableRSI) {
// RSI calculation and logic
}
if (enableMACD) {
// MACD calculation and logic
}
“`
**Notes:**
– Preserve the original logic aside from adding checkbox controls.
– Ensure default values keep all indicators enabled unless the user chooses otherwise.
– Confirm code compiles and behaves as expected with toggled indicators.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste the prompt into your preferred coding environment.
- Follow the outlined steps to modify the EA code.
- Implement checkbox parameters for each indicator as specified.
- Test the modified EA for functionality and error-free operation.
- Review and refine the code for clarity and maintainability.
Tips for Best Results
- Identify Indicators: Review the EA’s code to list all indicators currently implemented.
- Add Checkbox Parameters: Introduce boolean input parameters for each indicator, e.g.,
input bool enableIndicator1 = true;. - Conditional Logic: Update the EA’s logic to include checks for these parameters before executing indicator calculations.
- Test Functionality: Thoroughly test the EA to ensure each indicator can be toggled independently without causing errors in trading decisions.
FAQ
- How do I add checkboxes for indicators in an EA?
Introduce boolean input parameters for each indicator, like 'bool enableIndicator1 = true;'. - What is the purpose of the boolean parameters?
They allow users to enable or disable individual indicators independently within the EA. - How should the EA logic be modified?
Wrap indicator calculations in conditional statements that check the corresponding boolean parameters. - What should be tested after modifications?
Ensure that indicators can be toggled on and off without causing errors in the EA.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


