Plan Mode
Plan Mode helps you break down complex trading strategies into clear, actionable steps before writing any code. Perfect for multi-indicator systems, custom logic, or when you want to think through your approach first.
What is Plan Mode?
Plan Mode is a two-phase workflow that separates planning from coding:
- Phase 1: Planning — Discuss your strategy with HorizonAI, clarify requirements, and get a structured plan (no code yet)
- Phase 2: Execution — HorizonAI implements the plan step-by-step, writing actual code
This approach works better for complex strategies because it lets you review and refine the plan before any code is written.
When to use Plan Mode
Use Plan Mode when you're building:
- Multi-indicator strategies — e.g., "RSI + MACD + volume confirmation with dynamic stops"
- Complex entry/exit logic — Multiple conditions, filters, or timeframes
- Custom risk management — ATR-based stops, trailing logic, partial exits
- Strategies you can't describe in one message — Anything that needs back-and-forth discussion
For simple requests like "add a 200 EMA" or "change stop loss to 2%", regular chat mode is faster.
How to use Plan Mode
Step 1: Start Planning
Click the Plan Mode button (or toggle) in the HorizonAI interface. This enters Planning Phase.
Describe what you want to build. You can:
- Start broad: "I want a mean reversion strategy using Bollinger Bands"
- Ask questions: "Should I use RSI or Stochastic for confirmation?"
- Discuss tradeoffs: "What's better for scalping: fixed or dynamic stop losses?"
HorizonAI will ask clarifying questions and won't write any code yet.
Step 2: Review the Plan
Once you've discussed your requirements, HorizonAI will generate a structured plan showing:
- Steps — Each major feature broken into clear tasks
- Todos — Specific actions to implement each step
- Summary — High-level overview of the strategy
Review the plan carefully. Does it capture everything you need? Is the logic correct?
Step 3: Refine (Optional)
If something's missing or wrong, say so:
- "Add a step for plotting support/resistance levels"
- "Remove the volume filter—I don't need it"
- "Move the trailing stop logic to happen after 1R profit"
HorizonAI will update the plan. Repeat until you're satisfied.
Step 4: Execute the Plan
Click Execute Plan (or confirm execution). HorizonAI will:
- Analyze your existing code (if any)
- Implement each step from the plan
- Show progress: "Reading Script..." → "Implementing Step 1..." → "✅ Completed"
- Write clean, commented code based on the plan
You'll see real code appear on the right as each step is completed.
Tips for Better Plans
Be specific about your setup
- Bad: "Add some indicators"
- Good: "Add 20/50 EMA crossover, RSI(14) with 30/70 levels, and ATR(14) for stop loss calculation"
Mention constraints early
- "Pine Script v5, 15-minute timeframe"
- "MT5, one trade at a time, close on opposite signal"
- "Use SL/TP in points, not price"
Discuss edge cases
- "What happens if RSI is overbought but MACD is bullish?"
- "Should we trail stops only in profit, or from entry?"
- "Do we re-enter after a stop loss in the same session?"
Check existing features first
If you already have code in the editor, HorizonAI's plan will build on top of it (not rewrite everything). You can ask:
- "Do we already have a trailing stop? If so, how does it work?"
- "Is there a volume filter in the current code?"
This avoids duplicate logic or conflicts.
Example Workflow
You: "I want to build a Bollinger Bands mean reversion strategy"
HorizonAI: "Great! A few questions: Do you want to go long on lower band touches, short on upper band, or both? Any confirmation indicators like RSI? What about exits—fixed TP/SL or mean reversion back to midline?"
You: "Both directions. Add RSI below 30 for longs, above 70 for shorts. Exit at the middle band."
HorizonAI: (generates plan)
Title: Bollinger Bands Mean Reversion Strategy
Steps:
1. Calculate Bollinger Bands (20, 2.0)
2. Add RSI(14) confirmation
3. Entry logic: Long at lower band if RSI < 30, Short at upper band if RSI > 70
4. Exit logic: Close at middle band crossover
5. Plot bands and signals on chart
You: "Looks good. Execute it."
HorizonAI: (starts coding) "Reading Script... Read Script. Implementing Step 1... ✅ Completed: Bollinger Bands Mean Reversion Strategy with RSI confirmation."
Plan Mode vs Regular Mode
| Feature | Regular Mode | Plan Mode |
|---|---|---|
| Best for | Simple changes, quick fixes | Complex strategies, multi-step features |
| Workflow | Chat → Code immediately | Plan → Review → Execute |
| Refinement | Edit code after it's written | Edit plan before code is written |
| Clarification | Ask questions anytime | Ask questions during planning phase |
Both modes work great—choose based on your task complexity.
Supported Languages
Plan Mode works with both:
- Pine Script (TradingView)
- MQL5 (MetaTrader 5)
The planning process is the same; the prompts and code output are language-specific.
Troubleshooting
"The plan is too vague" → Add more detail in your description. Mention specific indicator settings, timeframes, and logic.
"The plan includes features I already have" → HorizonAI checks your existing code. If it's suggesting duplicates, say: "We already have [feature]. Just add the new parts."
"Execution stopped mid-way" → Check the console for errors. You can say "continue the plan" or "fix the error and keep going."
"I want to change the plan after execution started" → You can't modify mid-execution. Cancel, go back to Plan Mode, revise the plan, then re-execute.
Support
Questions about Plan Mode? Ask in our Discord or use the in-app contact form.