Indicator Problem After Windows 11 Wakes Up

 

Hi,

I have ported an indicator that I wrote over from MT4 to MT5. There was very little that needed changing, just a few MT4 functions that weren't available in MT5 need replacing with their MT5 counterparts.

After a period of inactivity, my Windows 11 PC goes to sleep. When I reactivate the PC and check MT5, the indicator output to the screen has disappeared. If I hit any of the indicators hot-keys that activate certain screen elements, they appear but, the rest of the indicator remains invisible. The chart isn't locked or anything like that. If I change timeframe, everything comes back and works correctly.

If output Print messages in the OnDeinit and OnInit event handlers but, it doesn't seem like MT5 sees this "reawakening" of Windows as an event. I don't know why this is happening, is this behaviour something that is "known" and it can be handled in a certain way? I'm sure a ChartRedraw would resolve this issue but, I have no idea where to put this so that it only happens after the PC re-awakens?

Any helps or suggestions would be much appreciated. Thanks.

 
Just a heads up, ChartRedraw doesn't help. I added this in the OnChartEvent handler because this was firing when I clicked the screen to reactivate/awaken Windows. The Print output confirms the event handler firing but the added ChartRedraw() doesn't change anything.