Is VBA more CPU efficient than using excel formulas?

Please post any questions regarding the program here.

Moderator: 2020vision

Is VBA more CPU efficient than using excel formulas?

Postby Captain Sensible » Fri Feb 14, 2014 6:03 pm

BA and excel regularly take my CPU up to 100% at the moment for some reason , probably due to my poor coding somewhere along the line :)

Looking to rejig things and wanted to know if I'd be more efficient coding in VBA rather than mainly using the formulas on some of my older sheets that were written before I gained some VBA knowledge.
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby alrodopial » Fri Feb 14, 2014 7:17 pm

Does your code backs up odds,amounts,bets etc at every refresh or just calculates if a bet must be fired?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby Captain Sensible » Fri Feb 14, 2014 7:25 pm

Not sure what you mean by backs up? It doesn't store any info just uses current odds to do it's calcualtions
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby alrodopial » Fri Feb 14, 2014 7:46 pm

Then it's not a case of write/read that usually is the case of high cpu usage.
We'll have to wait for os to answer but it's weird that so much cpu is needed for just calculations.
Are there any calls (at every refresh) using the com?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby Captain Sensible » Fri Feb 14, 2014 7:49 pm

Not using the COM just three sheets via the normal excel link and a little VBA. I'll have to sit down and look through it all to see where the problem is at some time.

Was mainly questioning if I'd be better off using VBA or formulas when I get round to re-writing them , whatever is likely to be more efficient
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby mak » Fri Feb 14, 2014 7:52 pm

I have also noticed lately high cpu demands and have report it to Gary.
Without any changes at all one day my bots started "consume" all my cpu and slow down my vps.
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby wizardofmann » Fri Feb 14, 2014 8:31 pm

This may not relevant in this case and I know sweet FA about VBA or Excel but since the 16th of January this year, the odds movements have become more erratic than usual. Also getting too many unmatched and partial matches, where as before that date it they were infrequent. Has anyone else noticed these changes :?:
Never say never
wizardofmann
 
Posts: 166
Joined: Tue Jul 23, 2013 2:43 pm
Location: Isle of Mann

Postby osknows » Sat Feb 15, 2014 2:45 am

It depends..... and actually it would make a really good thread to ask the best way of performing certain functions in both Excel and VBA.

Generally, Excel formulae are normally quicker than VBA.

Excel array formulae are almost always bad and can be improved using alternative methods.

If placing more than a single trade on a runner then VBA will always be faster than Excel as a bet can be placed at the same time as clearing existing bet references so will always be one refresh ahead if no other performance issues impact the trade.

Personally, most of my systems are Excel formulae based to highlight a trade and then VBA is used to place the trade.

Also, you have a 200ms window between refreshes to calculate so assuming this is actually nearer 150ms in real terms then it doesn't really matter if your PC calculates in 1ms or 150ms, you won't place a trade any quicker. However, if trading multiple markets then the quicker the better.

Os
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby Captain Sensible » Mon Feb 17, 2014 4:44 pm

Thanks Osknows, I was more concerned with the efficiency of the various methods rather than speeds. Luckily my methods never rely on speed for an edge, I realised a long time ago people would always be putting more effort/money into obtaining those type of edges. Just wondering if one method would require or use more CPU resources than the other.
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 64 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.