Overview
This prompt aims to guide programmers in modifying a trading script for flexible currency pair configuration. Programmers and traders will benefit by enhancing script usability for various trading instruments.
Prompt Overview
Purpose: This script modification allows users to configure any currency pair dynamically.
Audience: It is intended for traders and developers who utilize automated trading scripts.
Distinctive Feature: The script introduces a variable `symbol` for flexible currency pair selection.
Outcome: Users can now easily adapt the script for various instruments without altering the core functionality.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, General Business Operations
- Techniques: Decomposition, 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
Adjust the provided trading script to allow easy configuration for any currency pair, not just XAUUSD.
To achieve this, introduce a variable or input parameter that enables the user to specify the desired symbol (currency pair or instrument) dynamically.
Ensure the script consistently references this parameter wherever the symbol is used, including:
– Data fetching
– Indicator calculations
– Order placements
Maintain all existing functionality and logic while making the code adaptable to different symbols.
# Steps
1. Identify all occurrences of the hardcoded symbol ‘XAUUSD’ in the script.
2. Replace these hardcoded references with a variable or input parameter named `symbol`.
3. Provide a mechanism (e.g., script input or function argument) to allow the user to set this `symbol` when running the script.
4. Ensure that all functions and operations using the symbol refer to this parameter.
5. Test the script with multiple currency pairs and instruments to verify correctness.
# Output Format
Present the modified script code with:
– Clear inline comments explaining the changes made to enable symbol configurability.
– Any necessary instructions on how to set the desired symbol when running the script.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste it into your preferred coding environment.
- Follow the steps outlined to modify the trading script.
- Ensure all references to ‘XAUUSD’ are replaced with the ‘symbol’ variable.
- Test the updated script with different currency pairs.
- Review the output and inline comments for clarity.
Tips for Best Results
- Identify Hardcoded Symbol: Search the script for all instances of ‘XAUUSD’ to replace with a variable.
- Create Symbol Variable: Introduce a variable named `symbol` to hold the user-defined currency pair.
- Update Function Calls: Ensure all functions that use the symbol reference the new `symbol` variable instead of the hardcoded value.
- Test with Multiple Pairs: Run the script with various currency pairs to confirm that all functionalities remain intact and correct.
FAQ
- How can I configure the trading script for different currency pairs?
Introduce a variable named 'symbol' to replace hardcoded 'XAUUSD' references. - What should I replace 'XAUUSD' with in the script?
Replace 'XAUUSD' with the variable 'symbol' throughout the script. - How do I set the desired symbol when running the script?
Use an input parameter or function argument to specify the 'symbol' value. - What should I test after modifying the script?
Test the script with various currency pairs to ensure functionality remains intact.
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.


