When using Xen to build automated trading systems, the most common cause of failure is overly complex or unclear initial requirements. This applies to both AI and human developers.

The Correct Approach
You should not attempt to build a full, complex strategy in one step.
Instead, follow a structured workflow:
1. Start with a simple, clear idea
Define only the core logic:
- Entry conditions
- Exit conditions
- Basic trade direction
Keep it minimal and precise.
2. Build the first version
Use Xen to generate a baseline cBot based on those simple rules.
3. Test in cTrader
Run a backtest in cTrader:
- Verify entries and exits
- Check behaviour matches expectations
- Identify issues early
4. Improve step by step
Once the base version works:
- Add one feature at a time
- Rebuild
- Retest
Repeat:
Build → Test → Improve → Test
Why This Matters
Submitting a full specification like:
“Short Account Grid + Intraday High Sensitive Hedge Manager” with multi-layered logic, grid resets, hedge pairing, EOD rules, and re-arming
will not work reliably, even with an experienced developer.
Reasons:
- Too many moving parts at once
- High risk of misinterpretation
- Difficult to validate correctness
- Impossible to debug in a single pass
This is exactly why the reported case failed.
Requirements Must Be Clear, Not Abstract
Avoid:
- Long documents with mixed logic
- Vague or conceptual descriptions
- Multiple systems combined into one specification
Use instead:
- Direct, unambiguous rules
- Short, structured statements
- One behaviour at a time
Example
Good
- Open Buy when RSI crosses above 30
- Close Buy at +0.25% profit
Bad
- “Adaptive recovery hedge logic with dynamic grid sensitivity”
Recommended Development Flow
- Build a simple version of the strategy
- Confirm it works in backtesting
- Add grid logic (if required)
- Test again
- Add hedge logic
- Test again
- Add advanced features (EOD rules, resets, etc.)

Standard Mode vs Developer Mode
Xen offers two working styles, and choosing the right one will improve both quality and cost control.
Standard Mode
Standard Mode is best when you want Xen to return a full updated file or a more complete implementation in one response.
Use Standard Mode when:
- Starting a new baseline cBot
- Generating a full first version
- Making larger, clearly defined updates
- You want the complete code returned in one step
Because Standard Mode often regenerates the full file, it can use more tokens and take longer on large projects.
Developer Mode
Developer Mode is designed for smaller, targeted changes.
Instead of regenerating everything at once, it works better when you ask Xen to:
- Change one method
- Add one feature
- Update one section of logic
- Fix one specific issue
This makes Developer Mode useful for:
- Reducing token usage
- Lowering cost on existing projects
- Making changes easier to review
- Avoiding unnecessary full-file rewrites
How Developer Mode Helps Reduce Cost
If you ask Xen to make a very small change in Standard Mode, it may still process and regenerate a large part of the project.
In Developer Mode, you should give narrow, specific instructions, for example:
- Add a Stop Loss parameter
- Change the RSI entry threshold from 30 to 25
- Rename the robot and update the class name
- Fix the sell condition only
This keeps the request focused and usually reduces:
- Output size
- Processing time
- Token consumption
Best Practice
Use:
- Standard Mode to create the first working version
- Developer Mode to refine it in small steps afterwards
This matches the recommended Xen workflow:
Build → Test → Improve → Test
and helps keep development faster, cheaper, and easier to control.
Key Principle
A complex system is not built in one step.
It is built as a series of validated components.
Summary
- Do not submit full complex strategies in one request
- Start simple and expand gradually
- Always test in cTrader between iterations
- Keep requirements clear and specific
Following this approach will produce reliable, testable, and scalable trading systems with Xen.