Hi Gary.garyfritz wrote:That's right. Empty4 calls the start() function on every tick. Most indicators (including the 10.5 CSS indicators) do all their calculations and displays on every tick.spotdespot wrote:I actually think that the issue is with the indicators themselves - or more accurately Empty4 and how it deals with indis. I think (Baluda/Steve/coders please advise) that indicators do whatever it is they do every tick (and presumably cannot do their thing every bar close like an EA can).
But it's easy to fix. Just add this at the beginning of start():
(Not tested since the markets are closed, but it's pretty trivial.)Code: Select all
datetime LastUpdate = 0; if (TimeCurrent() - LastUpdate < 10) return(0); LastUpdate = TimeCurrent();
That will update every 10 seconds. Change the 10 to 60 if you want it to update every minute.
More likely it's 12%. You have a quad-core CPU, with each core having two "threads." So your CPU power gets divided into 8 chunks. 1/8 of 100% is 12.5%. When one CPU is spinning as fast as it can, due to a loop or a hang in Empty4, it only consumes 12.5% of your total CPU.I have 16 GB and I never get close to using it all and each Empty4 terminal maxes out at around 8% cpu when it is bogged down.
Could you please explain in a bit more detail for a newbie how to get that code operating.
Where is "beginning of start"?
Cheers