I would like to know if there is a way to know if an script is running in background (some event or property to check).
I have a custom script that is using intrabars data (AddDataSeries(BarsPeriodType.Tick, 1)), OnBarUpdate, OnMarketData and OnRender to print some info around time based bars. My problem is that I'm working with multiple workspace and I change between them. Indicator work as expected in realtime, except when I switch workspace. I read that workspace that are not active are running in background but in my case OnBarUpdate, OnMarketData are frozen while another workspace is active, when workspace is active again, OnMarketData continues in realtime but my OnBarUpdate executes all previous changes but my script expects realtime so ignores those changes (to avoid duplicate ticks with OnMarketData). I know I can check DataSeries Count to check if there are missing data to process, but I wonder if there are a more elegant way.
Thank you for the help.
Regards
Comment