My indicator uses vertical lines drawn on the chart to determine the start and end dates use to compute instead of specifying them through the input parameters. This is more intuitive for user to drag the vertical lines to specific the range to study instead of reload the indicator and respecifying the dates.
The problem is when I launch the debugger, it actually debugs on a new chart of its own without the vertical lines. How can I config the debugger to debug on the chart I created instead?
How can I config the debugger to debug on the chart I created instead?
Unfortunatelly you can't, but you have workarounds:
1. The best way is doing check in OnCalculate function of your indicator. Indicator should check for existing of vertical lines on the chart and do nothing when lines aren't exist.
2. When the new charts window is opening in terminal, template from file "Default.tpl" (if file is exist) will automatically applied for new chart. So you can save chart template with two vertical lines into file "Default.tpl". This template will be applied for chart window which will be opened by editor. You also can save your own template into any file and apply it for the chart using ChartApplyTemplate() function.
3. You can place the call of function DebugBreak() at the beginning of function OnInit. When you run your indicator in debug mode the breakpoint will be triggered and execution will paused. So you will have your time to place vertical lines on the chart. After that you should continue execution of your indicator.
We made auto applying of template from file "Debug.tpl" for charts which is opening in debug.