As the title says, when debugging, the debugger randomly stops with uninit reason 4 ("Chart Closed" according to the Uninitialization Reason Codes).
It could be anywhere from 7-15 minutes.
I'm not closing the chart and there's no functions in the EA that would cause the chart to close or even messes with the chart (other than, perhaps, OnChartEvent). In fact, I just leave the EA running without me messing with it to be absolutely sure that it's doing this on its own.
I even set up breakpoints where the code of if statements would process if the conditions were met, just to see if something fishy is going on, and the breakpoints aren't triggered so I know the code is running smoothly (or at least I believe it is).
It's too much code to share in a forum post, so before I delve any deeper into this, I'm just wondering if this is expected behavior. For example, maybe the debugger closes after a while if it doesn't receive any user input or something?
Unfortunately, the markets are closed, but I just thought about debugging another EA to see if I experience the same issue.
I've never found the debugger to be super stable.
When I use it I try to set breakpoints that exactly match my area of interest rather than long debug sessions that repeatedly stop inside loops