Halting execution of indicator until VolumeProfile is finished building to avoid error

Questions about MultiCharts .NET and user contributed studies.
johnromeronc
Posts: 53
Joined: 18 Feb 2011
Has thanked: 11 times
Been thanked: 13 times

Halting execution of indicator until VolumeProfile is finished building to avoid error

Postby johnromeronc » 06 Sep 2019

Is there an environment variable or some other way to be able to tell my indicator that is calculated using VolumeProfile Bid / Ask values @ each level to wait for the load / completion of calc of Volume Profile, so it's data / collections per bar are available to use?

If the indicator is on the chart when it starts / loads, then it gets an error & status is automatically changed to "OFF". once the chart is running, I can go back in on the "Format Indicators" window and turn the status to "ON" and all is well. I wold like to be able to set and wait for an event or use some kind of a loop that fires every 5 or 10 secs to see if the Volume Profile has completed.

a possible thought is to do a check for vp == null and return, then first time vp is not null tell indicator to recalculate. I also assume a bool switch / variable would need to be set up using Global Variable - to be able to keep the value, after the recalc so I don't end up in a continuous loop.

Any help or guidance would be appreciated.

John - struggling but getting better @ C# within MC.Net

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Halting execution of indicator until VolumeProfile is finished building to avoid error

Postby Henry MultiСharts » 11 Sep 2019

Hello John,

Unfortunately at the moment there is no way to postpone the indicator calculation until all Volume Profile data is loaded. I have forwarded an improvement request to address that to our dev team.


Return to “MultiCharts .NET”